# List settlements

List settlements

`GET https://api.cadmospay.com/machine/v1/gateway/settlements`

Your settlements, oldest first, 100 a page; follow `cursor=<next>` until `next` is `null`. Send `since` or `cursor`, never both; neither starts from the beginning.

This is the catch-up for webhooks. To resume, ask `since` the time of your last sync minus a few minutes and drop the `id`s you already have: a settlement can be recorded slightly after one stamped later. It also lists payments to the links you made in the app (`externalReference: null`).

## Authentication

`Authorization: Bearer <accessToken>`

The `accessToken` from `POST /v1/external-auth/token`, valid 15 minutes.

## Example requests

```bash
curl --fail-with-body 'https://api.cadmospay.com/machine/v1/gateway/settlements' \
  -H "Authorization: Bearer ${CADMOS_ACCESS_TOKEN:?Set CADMOS_ACCESS_TOKEN}"
```

```javascript
const { CADMOS_ACCESS_TOKEN } = process.env;
if (!CADMOS_ACCESS_TOKEN) {
  throw new Error("Set CADMOS_ACCESS_TOKEN");
}

const url = new URL("https://api.cadmospay.com/machine/v1/gateway/settlements");
const response = await fetch(url, {
  method: "GET",
  redirect: "error",
  headers: {
    Authorization: "Bearer " + CADMOS_ACCESS_TOKEN,
  },
});
console.log(response.status, await response.json());
```

```python
from http.client import HTTPSConnection
import os

conn = HTTPSConnection("api.cadmospay.com", timeout=30)
path = "/machine/v1/gateway/settlements"
headers = {
    "Authorization": "Bearer " + os.environ["CADMOS_ACCESS_TOKEN"],
}
conn.request("GET", path, headers=headers)
response = conn.getresponse()
print(response.status, response.read().decode())
conn.close()
```

## Parameters

- `since` (string, query, optional, format date-time). ISO 8601 time with a `Z`, inclusive.
- `cursor` (string, query, optional, pattern ^\d{13}\.\d{1,10}$). The `next` of the previous page.

## Responses

### 200

One page.

[SettlementPage](https://cadmospay.com/developers/schemas/settlement-page.md)

```json
{
  "items": [
    {
      "id": "0x5f2c0c3d2b1a09f8e7d6c5b4a39281706f5e4d3c2b1a09f8e7d6c5b4a3928170",
      "linkUuid": "0b6f5a8e-1c2d-4e3f-9a8b-7c6d5e4f3a2b",
      "externalReference": "order-42",
      "asset": "USDT",
      "gross": "100000000",
      "gatewayFee": "500000",
      "appliedRateBps": 50,
      "netCusd": "99500000",
      "settledAt": "2026-11-17T10:00:00.000Z",
      "settlement": {
        "chain": "arbitrum",
        "txHash": "0xdfd1a5041e8abc7c9b2f6a0e1d3c5b7a9f8e6d4c2b0a1f3e5d7c9b8a6f4e2d0c"
      },
      "whishCashIn": null,
      "destination": "cadmos_wallet"
    }
  ],
  "next": null
}
```

### 401

No token, or a token that is expired or not for this route: sign in again.

[Error](https://cadmospay.com/developers/schemas/error.md)

### 403

Your identity is not allowed this route, or has no business wallet.

[Error](https://cadmospay.com/developers/schemas/error.md)

### 422

The request does not match this contract: `VALIDATION_ERROR` lists each field and the rule it broke. An amount outside $0.50 to $1,000,000 is refused here too.

[Error](https://cadmospay.com/developers/schemas/error.md)

### 429

Over a limit. Wait and retry.

[Error](https://cadmospay.com/developers/schemas/error.md)

### 5XX

A Cadmos service failed or did not answer (`{ "message": "Service Error" }`). Retry; retry a create with the same `requestId`.

[Error](https://cadmospay.com/developers/schemas/error.md)
