> ## Documentation Index
> Fetch the complete documentation index at: https://docs.4mica.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit a checkpoint

> Submit a payer's signed running total for a settlement cycle.

`POST /core/checkpoints`

A checkpoint covers every payment the payer made in the cycle with a timestamp at or below `timestamp_cutoff`. `cumulative_gross` is the sum of those payments. Core recomputes the sum and refuses a checkpoint that disagrees. Build one from the [checkpoint batch](https://docs.4mica.io/api-reference/operator/checkpoint-batch.md).

Once a checkpoint is accepted, core refuses a new payment stamped at or before its cutoff.

## Authorization

**Authorization** `string` *required*

`Bearer <access_token>`. The token must belong to the payer, or have the `admin` or `facilitator` role.

## Request body

**payload** `object` *required*

**payload.payer** `string` *required*

**payload.cycle\_id** `string` *required*

On-chain cycle ID, 32 bytes as hex.

**payload.asset\_address** `string` *required*

**payload.cumulative\_gross** `string` *required*

Sum of the covered payments in base units, as a hex quantity.

**payload.timestamp\_cutoff** `number` *required*

Unix seconds. It must not be in the future.

**signature** `string` *required*

The payer's 65-byte EIP-712 signature over the payload under the `ClearingHouse` domain, as hex.

## Responses

**cycle\_id** `string` *required*

**cycle\_id\_text** `string` *required*

**asset\_address** `string` *required*

**payer** `string` *required*

**cumulative\_gross** `string` *required*

Decimal string.

**timestamp\_cutoff** `number` *required*

**covered** `number` *required*

How many payments this checkpoint newly covers. `0` when it repeats the latest accepted checkpoint, which core accepts again.

```bash cURL theme={null}
curl -X POST "https://base.sepolia.api.4mica.io/core/checkpoints" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "payload": {
      "payer": "0x1111111111111111111111111111111111111111",
      "cycle_id": "0x4444444444444444444444444444444444444444444444444444444444444444",
      "asset_address": "0xba50Cd2A20f6DA35D788639E581bca8d0B5d4D5f",
      "cumulative_gross": "0x61a800",
      "timestamp_cutoff": 1796292000
    },
    "signature": "0xPayerSignature"
  }'
```

```javascript title="Fetch" theme={null}
const response = await fetch("https://base.sepolia.api.4mica.io/core/checkpoints", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.ACCESS_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ payload, signature }),
});
console.log(await response.json());
```

```python Python theme={null}
import os
import requests
url = "https://base.sepolia.api.4mica.io/core/checkpoints"
print(requests.post(url, json={"payload": payload, "signature": signature}, headers={"Authorization": f"Bearer {os.environ['ACCESS_TOKEN']}"}).json())
```

```json 200 OK theme={null}
{
  "cycle_id": "0x4444444444444444444444444444444444444444444444444444444444444444",
  "cycle_id_text": "0xba50cd2a20f6da35d788639e581bca8d0b5d4d5f:1796256000",
  "asset_address": "0xba50Cd2A20f6DA35D788639E581bca8d0B5d4D5f",
  "payer": "0x1111111111111111111111111111111111111111",
  "cumulative_gross": "6400000",
  "timestamp_cutoff": 1796292000,
  "covered": 64
}
```

```json 400 Bad Request theme={null}
{
  "error": "checkpoint cumulative gross 6300000 does not match the 6400000 core computes for the covered authorizations",
  "code": "CHECKPOINT_MISMATCH",
  "details": {
    "cycle_id": "0x4444444444444444444444444444444444444444444444444444444444444444",
    "cycle_id_text": "0xba50cd2a20f6da35d788639e581bca8d0b5d4d5f:1796256000",
    "asset_address": "0xba50Cd2A20f6DA35D788639E581bca8d0B5d4D5f",
    "payer": "0x1111111111111111111111111111111111111111"
  }
}
```

## Status codes

| Code | Description |
| - | - |
| `200` | Checkpoint accepted. |
| `400` | The checkpoint is malformed, its signature does not verify, its cutoff is in the future, it covers no new payments, or the cycle no longer accepts checkpoints. With `code` `CHECKPOINT_MISMATCH`, the total or cutoff disagrees with the payments core holds. |
| `401` | The bearer token is missing or invalid, or belongs to another wallet. |
| `409` | A concurrent update interfered. Retry. |
| `500` | Core could not store the checkpoint. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.