# Payments API

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

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

**Payment File List**

Returns the payment files for the authenticated customer, optionally filtered by creation-date range, file status, file name, or file reference.

#### 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. |
| `fromMillis` | query | long | Only include files created on or after this instant (ISO-8601 UTC). When omitted, no lower bound is applied. |
| `toMillis` | query | long | Only include files created on or before this instant (ISO-8601 UTC). When omitted, no upper bound is applied. |
| `fileStatus` | query | array | Optional and repeatable. Restrict results to these file statuses. When omitted, all statuses are returned. |
| `fileName` | query | string | Optional. Restrict results to files matching this file name. |
| `fileReference` | query | string | Optional. Restrict results to files matching this file reference. |


#### Responses

- **200** — Payment files matching the supplied filters
- **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" \
  -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", {
  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"
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"))
    .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
{
  "files": [
    {}
  ],
  "totalResults": 0
}
```

