Aira

Settlements

Seal unsettled receipts into Merkle-anchored settlements and verify inclusion proofs — periodic chain-of-custody anchoring for the Aira audit trail.

All endpoints require a Bearer token (Authorization: Bearer aira_live_xxxxx). Base URL: https://api.airaproof.com/api/v1

Create Settlement

POST /api/v1/settlements
Authorization: Bearer aira_live_xxxxx

Admin only. Seals every unsettled receipt for the organization into a new Merkle settlement. If there are no unsettled receipts, the response is null (no-op). In production this is typically called by a scheduled task; the endpoint serves as a manual escape hatch.

Rate-limited to 5 requests per minute per organization.

Request Body

No request body required.

Example Request

curl -X POST https://api.airaproof.com/api/v1/settlements \
  -H "Authorization: Bearer aira_live_xxxxx"

Response (201 Created)

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "org_uuid": "org_01J9A...",
  "period_start": "2026-06-01T00:00:00.000Z",
  "period_end": "2026-06-05T12:00:00.000Z",
  "receipt_count": 142,
  "merkle_root": "sha256:a1b2c3d4...",
  "settlement_hash": "sha256:e5f6a7b8...",
  "signature": "ed25519:base64url...",
  "signing_key_id": "aira-signing-key-v1",
  "timestamp_token": "base64...",
  "sealed_at": "2026-06-05T12:00:00.000Z",
  "request_id": "req_01J9E..."
}

Returns null with status 200 if there are no unsettled receipts.


List Settlements

GET /api/v1/settlements?page=1&per_page=20
Authorization: Bearer aira_live_xxxxx

Returns a paginated list of settlements for the organization.

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number (minimum 1)
per_pageinteger20Results per page (1--100)

Example Request

curl https://api.airaproof.com/api/v1/settlements?page=1&per_page=20 \
  -H "Authorization: Bearer aira_live_xxxxx"

Response (200 OK)

{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "period_start": "2026-06-01T00:00:00.000Z",
      "period_end": "2026-06-05T12:00:00.000Z",
      "receipt_count": 142,
      "merkle_root": "sha256:a1b2c3d4...",
      "sealed_at": "2026-06-05T12:00:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 20,
    "total": 5,
    "has_more": false
  },
  "request_id": "req_01J9E..."
}

Get Settlement

GET /api/v1/settlements/{settlement_uuid}
Authorization: Bearer aira_live_xxxxx

Returns the full detail for a single settlement.

Path Parameters

ParameterTypeDescription
settlement_uuidstring (UUID)The settlement ID

Example Request

curl https://api.airaproof.com/api/v1/settlements/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer aira_live_xxxxx"

Response (200 OK)

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "org_uuid": "org_01J9A...",
  "period_start": "2026-06-01T00:00:00.000Z",
  "period_end": "2026-06-05T12:00:00.000Z",
  "receipt_count": 142,
  "merkle_root": "sha256:a1b2c3d4...",
  "settlement_hash": "sha256:e5f6a7b8...",
  "signature": "ed25519:base64url...",
  "signing_key_id": "aira-signing-key-v1",
  "timestamp_token": "base64...",
  "sealed_at": "2026-06-05T12:00:00.000Z",
  "request_id": "req_01J9E..."
}

Error Codes

StatusCodeDescription
404NOT_FOUNDSettlement does not exist

Get Settlement Receipts

GET /api/v1/settlements/{settlement_uuid}/receipts
Authorization: Bearer aira_live_xxxxx

Returns all receipts sealed into a given settlement.

Path Parameters

ParameterTypeDescription
settlement_uuidstring (UUID)The settlement ID

Example Request

curl https://api.airaproof.com/api/v1/settlements/550e8400-e29b-41d4-a716-446655440000/receipts \
  -H "Authorization: Bearer aira_live_xxxxx"

Response (200 OK)

[
  {
    "receipt_uuid": "r_01J9B...",
    "action_uuid": "act_01J9B...",
    "action_type": "transaction",
    "agent_id": "procurement-agent",
    "payload_hash": "sha256:f0e1d2c3...",
    "created_at": "2026-06-04T10:30:00.000Z"
  }
]

Response Fields

FieldTypeDescription
receipt_uuidstringUUID of the receipt
action_uuidstringUUID of the associated action
action_typestringType of the action (e.g. transaction, decision)
agent_idstringID of the agent that performed the action
payload_hashstringSHA-256 hash of the receipt payload
created_atstringISO 8601 timestamp of receipt creation

Inclusion Proof

GET /api/v1/settlements/inclusion-proof/{receipt_uuid}
Authorization: Bearer aira_live_xxxxx

Returns the Merkle inclusion proof for a specific receipt within its settlement. This proof can be independently verified to confirm that the receipt was included in the settlement's Merkle tree.

Path Parameters

ParameterTypeDescription
receipt_uuidstring (UUID)The receipt ID to look up

Example Request

curl https://api.airaproof.com/api/v1/settlements/inclusion-proof/r_01J9B... \
  -H "Authorization: Bearer aira_live_xxxxx"

Response (200 OK)

{
  "settlement_uuid": "550e8400-e29b-41d4-a716-446655440000",
  "receipt_uuid": "r_01J9B...",
  "merkle_root": "sha256:a1b2c3d4...",
  "leaf_hash": "sha256:b2c3d4e5...",
  "index": 7,
  "leaf_count": 142,
  "siblings": [
    "sha256:c3d4e5f6...",
    "sha256:d4e5f6a7...",
    "sha256:e5f6a7b8..."
  ],
  "request_id": "req_01J9E..."
}

Response Fields

FieldTypeDescription
settlement_uuidstringUUID of the settlement containing this receipt
receipt_uuidstringUUID of the receipt
merkle_rootstringRoot hash of the settlement's Merkle tree
leaf_hashstringHash of this receipt's leaf in the tree
indexintegerPosition of the leaf in the tree
leaf_countintegerTotal number of leaves in the tree
siblingsstring[]Sibling hashes needed to reconstruct the path to the root
request_idstringRequest ID for tracing

On this page