# Payments API

Base URL: `https://interact-uat.hsbc.com/payment-service/`

### GET /api/v0/payment-files/summary

**File Status Summary**

Returns the number of payment files grouped by status for the authenticated customer, optionally filtered by creation-date range and file status.

#### Parameters

| Name | In | Type | Description |
|---|---|---|---|
| `X-HSBC-Request-Correlation-Id` | header | string | Optional trace identifier forwarded to downstream services and recorded in logs. Include this value when raising support requests. A UUID is recommended; auto-generated when not supplied. |
| `fileStatus` | query | array | Optional and repeatable. Restrict the summary to these file statuses. When omitted, all statuses are counted. |
| `creationDateFrom` | query | string | Only count files created on or after this instant (ISO-8601 UTC). |
| `creationDateTo` | query | string | Only count files created on or before this instant (ISO-8601 UTC). |


#### Responses

- **200** — Payment file counts keyed by status
- **401** — Missing or invalid NEO session
- **429** — Too many requests — rate limit exceeded
- **500** — Unexpected server error
- **503** — The payment file service is temporarily unavailable
- **400** — Bad request — invalid or missing parameters
- **403** — Forbidden — insufficient permissions for this resource


#### Examples

```bash
curl "https://interact-uat.hsbc.com/payment-service/api/v0/payment-files/summary" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-HSBC-Request-Correlation-Id: YOUR_X_HSBC_REQUEST_CORRELATION_ID"
```

```javascript
const response = await fetch("https://interact-uat.hsbc.com/payment-service/api/v0/payment-files/summary", {
  headers: {
      "Authorization": "Bearer YOUR_TOKEN",
      "X-HSBC-Request-Correlation-Id": "YOUR_X_HSBC_REQUEST_CORRELATION_ID"
  },
});

const data = await response.json();
```

```python
import requests

url = "https://interact-uat.hsbc.com/payment-service/api/v0/payment-files/summary"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "X-HSBC-Request-Correlation-Id": "YOUR_X_HSBC_REQUEST_CORRELATION_ID",
}

response = requests.get(url, headers=headers)
print(response.json())
```

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://interact-uat.hsbc.com/payment-service/api/v0/payment-files/summary"))
    .header("Authorization", "Bearer YOUR_TOKEN")
    .header("X-HSBC-Request-Correlation-Id", "YOUR_X_HSBC_REQUEST_CORRELATION_ID")
    .GET()
    .build();

HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

#### Example response

```json
{
  "summary": {
    "statusCounts": {
      "FAILED": 3,
      "PENDING_AUTHORISATION": 1
    }
  }
}
```

