Skip to main content

Interactive API Explorer

Every endpoint below is generated from the real OFFER-HUB Orchestrator OpenAPI spec (public/openapi.json) — fill in parameters, set a bearer token, and send a real request straight from your browser.

Try-it setup

Requests go straight from your browser to the base URL above when you click Try it on an endpoint below. Nothing here is stored or sent anywhere else.

Auth

Create and list API keys, exchange a key for a short-lived token, and read the current auth context.

Creates an API key. The plain-text key is in this response only; the database stores a salted hash.

support scope

application/json

Request URL

POSThttp://localhost:4000/api/v1/auth/api-keys

Example Response

{  "data": {    "id": "key_V1StGXR8Z5jdHi6B3mEv0",    "key": "ohk_live_key_V1StGXR8Z5jdHi6B3mEv0_9f2c1a7e5b3d8f6041c2a9e7b5d3f1a08c6e4b2d7f9a1c3e",    "name": "Marketplace backend",    "scopes": [      "read",      "write"    ]  },  "meta": {    "requestId": "req_1ab90c",    "timestamp": "2026-09-30T10:00:00.000Z"  }}

Lists API keys, newest first. Key values are never returned, only their metadata.

support scope

Query Parameters

optional

Keys per page; capped at 100, default 20.

optional

The nextCursor from the previous page.

Request URL

GEThttp://localhost:4000/api/v1/auth/api-keys

Example Response

{  "data": {    "data": [      {        "id": "key_V1StGXR8Z5jdHi6B3mEv0",        "name": "Marketplace backend",        "scopes": [          "read",          "write"        ],        "lastUsedAt": "2026-09-30T09:58:12.000Z",        "createdAt": "2026-09-29T14:20:00.000Z"      }    ],    "pagination": {      "hasMore": false,      "nextCursor": null    }  },  "meta": {    "requestId": "req_1ab90d",    "timestamp": "2026-09-30T10:00:05.000Z"  }}

Exchanges an API key ID for a short-lived token (ohk_tok_...) valid for 1 hour, carrying the scopes of the key with that ID. No request body.

write scope

Path Parameters

required

The API key ID, not the key secret.

Request URL

POSThttp://localhost:4000/api/v1/auth/api-keys/{id}/token

Example Response

{  "data": {    "token": "ohk_tok_eyJhbGciOiJIUzI1NiIs..."  },  "meta": {    "requestId": "req_1ab90e",    "timestamp": "2026-09-30T10:01:00.000Z"  }}

Returns the identity behind the credential sent. Any valid API key, token, or master key works; no specific scope is needed.

Authenticated

Request URL

GEThttp://localhost:4000/api/v1/auth/me

Example Response

{  "data": {    "apiKeyId": "key_V1StGXR8Z5jdHi6B3mEv0",    "apiKeyName": "Marketplace backend",    "scopes": [      "read",      "write"    ]  }}

Config & Health

Public endpoints needing no credential: platform configuration and basic/detailed health checks.

Returns platform configuration (limits, currencies, feature flags). Limits/currencies/provider names are hardcoded string literals in the controller, not read from the environment.

Request URL

GEThttp://localhost:4000/api/v1/config

Example Response

{  "data": {    "currencies": [      "USD"    ],    "limits": {      "topup": {        "min": "1.00",        "max": "10000.00"      },      "withdrawal": {        "min": "10.00",        "max": "5000.00"      },      "order": {        "min": "1.00",        "max": "50000.00"      }    },    "features": {      "milestones": true,      "disputes": true,      "sse": false,      "airtm": true,      "trustlessWork": true    },    "providers": {      "fiat": "airtm",      "escrow": "trustless_work"    },    "version": "1.0.0"  }}

Does no I/O and answers immediately; tells you only that the API process is up.

Request URL

GEThttp://localhost:4000/api/v1/health

Example Response

{  "data": {    "status": "healthy",    "version": "1.0.0",    "timestamp": "2026-09-30T10:00:00.000Z"  },  "meta": {    "requestId": "req_1ab90c",    "timestamp": "2026-09-30T10:00:00.002Z"  }}

Tests database, Redis, Airtm, and Trustless Work in parallel, each capped at 5 seconds. Always returns HTTP 200; read data.status for the real result.

Request URL

GEThttp://localhost:4000/api/v1/health/detailed

Example Response

{  "data": {    "status": "degraded",    "version": "1.0.0",    "dependencies": {      "database": {        "status": "healthy",        "latency": 4      },      "redis": {        "status": "healthy",        "latency": 2      },      "airtm": {        "status": "degraded",        "error": "Not configured"      },      "trustlessWork": {        "status": "healthy",        "latency": 180      }    },    "timestamp": "2026-09-30T10:00:00.000Z"  },  "meta": {    "requestId": "req_1ab90d",    "timestamp": "2026-09-30T10:00:00.190Z"  }}

Orders

Order lifecycle up to escrow funding, plus milestone bookkeeping inside IN_PROGRESS.

Creates the order row and, optionally, its milestones. No funds move and no contract is deployed by this call.

application/json

Request URL

POSThttp://localhost:4000/api/v1/orders

Example Response

{  "data": {    "success": true,    "data": {      "id": "ord_xyz789",      "clientOrderRef": "REQ-1001",      "buyerId": "usr_buyer123",      "sellerId": "usr_seller456",      "amount": "5000.00",      "currency": "USD",      "status": "ORDER_CREATED",      "title": "Mobile App Development",      "description": "Design, build and ship a customer app",      "metadata": {        "platformFee": "3.5"      },      "escrow": null,      "milestones": [        {          "id": "mls_abc123",          "orderId": "ord_xyz789",          "milestoneRef": "design",          "title": "UI/UX Design",          "amount": "1000.00",          "status": "OPEN"        }      ],      "createdAt": "2026-02-25T12:00:00.000Z",      "updatedAt": "2026-02-25T12:00:00.000Z"    }  },  "meta": {    "requestId": "req_1ab90c",    "timestamp": "2026-02-25T12:00:00.404Z"  }}

Lists orders newest first, with cursor pagination and role/status filters.

Query Parameters

optional

Return orders where this user is the buyer.

optional

Return orders where this user is the seller.

optional

Filter by one status. Unknown values are ignored.

optional

Items per page; capped at 100, default 20.

optional

The nextCursor from the previous page.

Request URL

GEThttp://localhost:4000/api/v1/orders

Example Response

{  "data": {    "success": true,    "data": [      {        "id": "ord_xyz789",        "buyerId": "usr_buyer123",        "sellerId": "usr_seller456",        "amount": "5000.00",        "currency": "USD",        "status": "IN_PROGRESS",        "title": "Mobile App Development",        "createdAt": "2026-02-25T12:00:00.000Z"      }    ],    "hasMore": true,    "nextCursor": "ord_abc123"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Fetches one order, including its escrow and milestones relations.

Path Parameters

required

Order ID with the ord_ prefix.

Request URL

GEThttp://localhost:4000/api/v1/orders/{id}

Example Response

{  "data": {    "success": true,    "data": {      "id": "ord_xyz789",      "clientOrderRef": "REQ-1001",      "buyerId": "usr_buyer123",      "sellerId": "usr_seller456",      "amount": "5000.00",      "currency": "USD",      "status": "IN_PROGRESS",      "title": "Mobile App Development",      "escrow": {        "id": "esc_01JKL",        "trustlessContractId": "CCBSP2XK4T7Q",        "status": "FUNDED",        "fundedAt": "2026-02-25T12:07:41.512Z"      },      "milestones": [        {          "id": "mls_abc123",          "milestoneRef": "design",          "title": "UI/UX Design",          "amount": "1000.00",          "status": "COMPLETED"        }      ],      "createdAt": "2026-02-25T12:00:00.000Z",      "updatedAt": "2026-02-25T12:07:41.600Z"    }  },  "meta": {    "requestId": "req_1ab91d",    "timestamp": "2026-02-25T12:09:12.331Z"  }}

Moves order.amount from the buyer's available balance to reserved. Mandatory step before escrow creation. Sends no request body.

Path Parameters

required

Order ID with the ord_ prefix.

Request URL

POSThttp://localhost:4000/api/v1/orders/{id}/reserve

Example Response

{  "data": {    "success": true,    "data": {      "id": "ord_xyz789",      "buyerId": "usr_buyer123",      "sellerId": "usr_seller456",      "amount": "5000.00",      "currency": "USD",      "status": "FUNDS_RESERVED",      "title": "Mobile App Development",      "escrow": null,      "milestones": [],      "createdAt": "2026-02-25T12:00:00.000Z",      "updatedAt": "2026-02-25T12:03:18.204Z"    }  },  "meta": {    "requestId": "req_1ab92e",    "timestamp": "2026-02-25T12:03:18.331Z"  }}

Cancels an order that has not reached escrow. Moves to CLOSED; reserved funds (if any) return to the buyer's available balance.

Path Parameters

required

Order ID with the ord_ prefix.

application/json

Request URL

POSThttp://localhost:4000/api/v1/orders/{id}/cancel

Example Response

{  "data": {    "success": true,    "data": {      "id": "ord_xyz789",      "buyerId": "usr_buyer123",      "sellerId": "usr_seller456",      "amount": "5000.00",      "currency": "USD",      "status": "CLOSED",      "title": "Mobile App Development",      "escrow": null,      "milestones": [],      "updatedAt": "2026-02-25T12:04:55.882Z"    }  },  "meta": {    "requestId": "req_1ab93f",    "timestamp": "2026-02-25T12:04:56.010Z"  }}

Lists the milestones of one order, ordered by creation time.

Path Parameters

required

Order ID with the ord_ prefix.

Request URL

GEThttp://localhost:4000/api/v1/orders/{id}/milestones

Example Response

{  "data": {    "success": true,    "data": [      {        "id": "mls_abc123",        "orderId": "ord_xyz789",        "milestoneRef": "design",        "title": "UI/UX Design",        "amount": "1000.00",        "status": "COMPLETED",        "createdAt": "2026-02-25T12:00:00.000Z"      }    ]  },  "meta": {    "requestId": "req_1ab940",    "timestamp": "2026-02-25T12:20:02.774Z"  }}

Marks one milestone COMPLETED. Bookkeeping write only; moves no money and makes no on-chain call. No request body.

Path Parameters

required

Order ID with the ord_ prefix.

required

The ref supplied when the order was created.

Request URL

POSThttp://localhost:4000/api/v1/orders/{id}/milestones/{milestoneRef}/complete

Example Response

{  "data": {    "success": true,    "data": {      "id": "mls_abc123",      "orderId": "ord_xyz789",      "milestoneRef": "design",      "title": "UI/UX Design",      "amount": "1000.00",      "status": "COMPLETED",      "createdAt": "2026-02-25T12:00:00.000Z"    }  },  "meta": {    "requestId": "req_1ab951",    "timestamp": "2026-02-25T12:22:44.117Z"  }}

Escrow

Smart contract creation and funding for a funded order, deployed through Trustless Work.

Deploys the Trustless Work escrow contract for an order in FUNDS_RESERVED and links it to the order. No request body.

Path Parameters

required

Order ID with the ord_ prefix.

Request URL

POSThttp://localhost:4000/api/v1/orders/{id}/escrow

Example Response

{  "data": {    "success": true,    "data": {      "id": "ord_abc123",      "status": "ESCROW_FUNDING",      "amount": "2500.00",      "currency": "USD",      "escrow": {        "id": "esc_01JKL",        "trustlessContractId": "CCBSP2XK4T7Q",        "status": "CREATED",        "amount": "2500.00"      }    }  },  "meta": {    "requestId": "req_2c8a10",    "timestamp": "2026-02-10T09:00:44.700Z"  }}

Moves the buyer's reserved balance into the on-chain contract and moves the order to IN_PROGRESS. No request body.

Path Parameters

required

Order ID with the ord_ prefix.

Request URL

POSThttp://localhost:4000/api/v1/orders/{id}/escrow/fund

Example Response

{  "data": {    "success": true,    "data": {      "id": "ord_abc123",      "status": "IN_PROGRESS",      "escrow": {        "id": "esc_01JKL",        "status": "FUNDED",        "fundedAt": "2026-02-10T09:02:11.120Z"      }    }  },  "meta": {    "requestId": "req_2c8a11",    "timestamp": "2026-02-10T09:02:11.402Z"  }}

Resolution

Settles a funded escrow: release to seller, refund to buyer, or open a dispute.

Releases the escrowed funds to the seller. Requires every milestone COMPLETED. Completes synchronously; the returned order is already CLOSED.

Path Parameters

required

Order ID with the ord_ prefix.

application/json

Request URL

POSThttp://localhost:4000/api/v1/orders/{orderId}/resolution/release

Example Response

{  "data": {    "success": true,    "data": {      "id": "ord_abc123",      "status": "CLOSED",      "amount": "2500.00",      "escrow": {        "id": "esc_01JKL",        "status": "RELEASED",        "releasedAt": "2026-02-17T16:40:02.881Z"      }    }  },  "meta": {    "requestId": "req_7f3a1c",    "timestamp": "2026-02-17T16:40:03.004Z"  }}

Returns the escrowed funds to the buyer via a dispute-then-resolve flow against Trustless Work. Completes synchronously; the returned order is already CLOSED.

Path Parameters

required

Order ID with the ord_ prefix.

application/json

Request URL

POSThttp://localhost:4000/api/v1/orders/{orderId}/resolution/refund

Example Response

{  "data": {    "success": true,    "data": {      "id": "ord_abc123",      "status": "CLOSED",      "escrow": {        "status": "REFUNDED",        "refundedAt": "2026-02-17T17:02:55.140Z"      },      "milestones": []    }  },  "meta": {    "requestId": "req_91b2de",    "timestamp": "2026-02-17T17:02:55.510Z"  }}

Freezes the escrow and opens a dispute. No on-chain transaction is sent.

Path Parameters

required

Order ID with the ord_ prefix.

application/json

Request URL

POSThttp://localhost:4000/api/v1/orders/{orderId}/resolution/dispute

Example Response

{  "data": {    "success": true,    "data": {      "id": "dsp_01JKQ7",      "orderId": "ord_abc123",      "openedBy": "BUYER",      "reason": "QUALITY_ISSUE",      "evidence": [        "https://files.example.com/revision-3.png"      ],      "status": "OPEN",      "order": {        "id": "ord_abc123",        "status": "DISPUTED"      }    }  },  "meta": {    "requestId": "req_4d0f81",    "timestamp": "2026-02-16T11:20:09.180Z"  }}

Disputes

List, inspect, assign, and resolve disputes raised on escrowed orders.

Returns all disputes for the caller's marketplace, newest first. Not paginated — returns every match.

Query Parameters

optional

Filter to disputes of a single order

optional

Dispute status filter

optional

Who opened the dispute

Request URL

GEThttp://localhost:4000/api/v1/disputes

Example Response

{  "data": {    "success": true,    "data": [      {        "id": "dsp_01JABCDEF",        "orderId": "ord_01HGFEDCBA",        "openedBy": "BUYER",        "reason": "NOT_DELIVERED",        "evidence": [          "https://cdn.example.com/proof.png"        ],        "status": "OPEN",        "resolutionDecision": null,        "decisionNote": null,        "createdAt": "2026-02-01T10:15:00.000Z",        "updatedAt": "2026-02-01T10:15:00.000Z"      }    ]  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Returns a single dispute including the related order (with escrow, dispute, and milestones relations).

Path Parameters

required

Dispute identifier

Request URL

GEThttp://localhost:4000/api/v1/disputes/{id}

Example Response

{  "data": {    "success": true,    "data": {      "id": "dsp_01JABCDEF",      "orderId": "ord_01HGFEDCBA",      "openedBy": "BUYER",      "reason": "QUALITY_ISSUE",      "evidence": [        "https://cdn.example.com/screenshot.png"      ],      "status": "UNDER_REVIEW",      "resolutionDecision": null,      "decisionNote": null,      "createdAt": "2026-02-01T10:15:00.000Z",      "updatedAt": "2026-02-02T09:30:00.000Z",      "order": {        "id": "ord_01HGFEDCBA",        "amount": "100.00",        "escrow": {          "id": "esc_01JKL",          "status": "FUNDED"        },        "milestones": []      }    }  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Moves an OPEN dispute to UNDER_REVIEW and records the assigned support agent. Requires the dispute to be in OPEN state; writes a DISPUTE_ASSIGNED audit entry and emits dispute.under_review on the event bus. Supports an optional Idempotency-Key header.

Path Parameters

required

Dispute identifier

application/json

Request URL

POSThttp://localhost:4000/api/v1/disputes/{id}/assign

Example Response

{  "data": {    "success": true,    "data": {      "id": "dsp_01JABCDEF",      "orderId": "ord_01HGFEDCBA",      "openedBy": "BUYER",      "reason": "NOT_DELIVERED",      "evidence": [        "https://cdn.example.com/proof.png"      ],      "status": "UNDER_REVIEW",      "resolutionDecision": null,      "decisionNote": null,      "createdAt": "2026-02-01T10:15:00.000Z",      "updatedAt": "2026-02-03T08:00:00.000Z"    }  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Closes a dispute that is UNDER_REVIEW by executing a financial decision (FULL_RELEASE, FULL_REFUND, or SPLIT) and setting status to RESOLVED. Writes a DISPUTE_RESOLVED audit entry and emits dispute.resolved. Supports an optional Idempotency-Key header.

Path Parameters

required

Dispute identifier

application/json

Request URL

POSThttp://localhost:4000/api/v1/disputes/{id}/resolve

Example Response

{  "data": {    "success": true,    "data": {      "id": "dsp_01JABCDEF",      "orderId": "ord_01HGFEDCBA",      "openedBy": "BUYER",      "reason": "NOT_DELIVERED",      "evidence": [        "https://cdn.example.com/proof.png"      ],      "status": "RESOLVED",      "resolutionDecision": "SPLIT",      "decisionNote": "Partial work completed",      "createdAt": "2026-02-01T10:15:00.000Z",      "updatedAt": "2026-02-04T12:00:00.000Z"    }  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Users

Create users with an automatic balance, and link a user's Airtm account.

Creates a user and their balance in one transaction. If a user with the same externalUserId already exists, the existing user is returned instead of an error.

write scope

application/json

Request URL

POSThttp://localhost:4000/api/v1/users

Example Response

{  "data": {    "id": "usr_V1StGXR8Z5jdHi6B3mEv0",    "externalUserId": "user_123",    "email": "buyer@example.com",    "type": "BUYER",    "status": "ACTIVE",    "balance": {      "available": "0.00",      "reserved": "0.00",      "currency": "USD"    },    "airtmLinked": false,    "airtmUserId": null,    "airtmLinkedAt": null,    "createdAt": "2026-09-30T10:00:00.000Z",    "updatedAt": "2026-09-30T10:00:00.000Z"  }}

Verifies a user's email against Airtm and stores the link. If already linked, the stored link is returned without re-verifying.

write scope

Path Parameters

required

The internal user ID (usr_ prefix), not externalUserId.

application/json

Request URL

POSThttp://localhost:4000/api/v1/users/{id}/airtm/link

Example Response

{  "data": {    "userId": "usr_V1StGXR8Z5jdHi6B3mEv0",    "airtmUserId": "airtm_8f3a2c",    "airtmLinkedAt": "2026-09-30T10:05:00.000Z",    "eligible": true,    "email": "buyer@example.com"  }}

Wallet & Top-ups

Stellar wallet info, crypto deposit instructions, transaction history, and AirTM top-up flow.

Returns the user's primary Stellar wallet with current on-chain USDC and XLM balances.

read scope

Path Parameters

required

Internal OFFER-HUB user ID (prefix usr_).

Request URL

GEThttp://localhost:4000/api/v1/users/{userId}/wallet

Example Response

{  "data": {    "publicKey": "GABCDEF...",    "type": "INVISIBLE",    "provider": "STELLAR",    "isActive": true,    "isPrimary": true,    "balance": {      "usdc": "150.0000000",      "xlm": "5.0000000"    },    "createdAt": "2026-09-24T10:00:00.000Z"  }}

Returns deposit instructions: the Stellar address to send USDC to, plus asset and network details.

read scope

Path Parameters

required

Internal OFFER-HUB user ID (prefix usr_).

Request URL

GEThttp://localhost:4000/api/v1/users/{userId}/wallet/deposit

Example Response

{  "data": {    "provider": "crypto",    "method": "stellar_address",    "address": "GCV24WNJYXPG3QFNP6ZQMLVEMHQX5S6J2OWKGVF5U3XC6HF4QQHG7WMD",    "asset": {      "code": "USDC",      "issuer": "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5"    },    "network": "testnet",    "instructions": "Send USDC to this Stellar address. Deposits are detected automatically within seconds."  }}

Returns recent USDC/XLM activity for the user's wallet, read from the Stellar Horizon API, filtered to payment and create_account operations.

read scope

Path Parameters

required

Internal OFFER-HUB user ID (prefix usr_).

Query Parameters

optional

Number of transactions to return, capped at 100, default 20.

Request URL

GEThttp://localhost:4000/api/v1/users/{userId}/wallet/transactions

Example Response

{  "data": [    {      "id": "3574536253440001",      "type": "payment",      "from": "GSENDER...",      "to": "GABCDEF...",      "amount": "50.0000000",      "asset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",      "createdAt": "2026-09-24T09:58:00Z",      "hash": "a1b2c3d4e5f6",      "successful": true    }  ]}

Creates an AirTM pay-in for the authenticated user and returns a confirmationUri to redirect the user to. User is resolved from the auth context, not the body.

write scope

application/json

Request URL

POSThttp://localhost:4000/api/v1/topups

Example Response

{  "data": {    "id": "topup_jKL3mN0PqR4sT5uV6wX7yZ",    "amount": "100.00",    "currency": "USD",    "status": "TOPUP_AWAITING_USER_CONFIRMATION",    "confirmationUri": "https://app.airtm.com/payin/abc123...",    "expiresAt": "2026-09-25T10:00:00.000Z",    "createdAt": "2026-09-24T10:00:00.000Z"  },  "meta": {    "timestamp": "2026-09-24T10:00:00.000Z"  }}

Lists the authenticated user's top-ups, newest first, with cursor pagination.

read scope

Query Parameters

optional

Items per page, capped at 100, default 20.

optional

ID of the last top-up from the previous page.

Request URL

GEThttp://localhost:4000/api/v1/topups

Example Response

{  "data": {    "data": [      {        "id": "topup_jKL3mN0PqR4sT5uV6wX7yZ",        "userId": "usr_abc123def456",        "amount": "100.00",        "currency": "USD",        "status": "TOPUP_SUCCEEDED",        "airtmPayinId": "payin_2026-01-01x123",        "createdAt": "2026-09-24T10:00:00.000Z",        "updatedAt": "2026-09-24T10:05:00.000Z"      }    ],    "hasMore": true,    "nextCursor": "topup_jKL3mN0PqR4sT5uV6wX7yZ"  },  "meta": {    "timestamp": "2026-09-24T10:05:00.000Z"  }}

Returns a single top-up owned by the authenticated user.

read scope

Path Parameters

required

Top-up ID (prefix topup_).

Request URL

GEThttp://localhost:4000/api/v1/topups/{id}

Example Response

{  "data": {    "id": "topup_jKL3mN0PqR4sT5uV6wX7yZ",    "userId": "usr_abc123def456",    "amount": "100.00",    "currency": "USD",    "status": "TOPUP_PROCESSING",    "airtmPayinId": "payin_2026-01-01x123",    "confirmationUri": "https://app.airtm.com/payin/abc123...",    "createdAt": "2026-09-24T10:00:00.000Z",    "updatedAt": "2026-09-24T10:03:00.000Z"  },  "meta": {    "timestamp": "2026-09-24T10:03:00.000Z"  }}

Re-checks the top-up status with AirTM. No-op if already terminal. On transition to TOPUP_SUCCEEDED the user's available balance is credited automatically.

read scope

Path Parameters

required

Top-up ID (prefix topup_).

Request URL

POSThttp://localhost:4000/api/v1/topups/{id}/refresh

Example Response

{  "data": {    "id": "topup_jKL3mN0PqR4sT5uV6wX7yZ",    "status": "TOPUP_SUCCEEDED",    "updatedAt": "2026-09-24T10:07:00.000Z"  },  "meta": {    "timestamp": "2026-09-24T10:07:00.000Z"  }}

Cancels a top-up still awaiting user confirmation; any other state returns 409 INVALID_STATE.

write scope

Path Parameters

required

Top-up ID (prefix topup_).

Request URL

POSThttp://localhost:4000/api/v1/topups/{id}/cancel

Example Response

{  "data": {    "id": "topup_jKL3mN0PqR4sT5uV6wX7yZ",    "status": "TOPUP_CANCELED",    "updatedAt": "2026-09-24T10:10:00.000Z"  },  "meta": {    "timestamp": "2026-09-24T10:10:00.000Z"  }}

Public endpoint (@Public()), no authentication. The URL AirTM redirects the buyer's browser to after payment confirmation/cancellation. Refreshes status and issues a 302 redirect; never called directly by integrators.

Path Parameters

required

Top-up ID (prefix topup_).

Query Parameters

optional

Optional status echoed by AirTM; ignored, final status re-read from AirTM.

optional

Optional code echoed by AirTM; ignored.

Request URL

GEThttp://localhost:4000/api/v1/topups/{id}/callback

Example Response

(no example body)

Balance

Atomic ledger balance operations scoped to a user, backed by Prisma transactions and audit logging.

Returns the user's current available and reserved ledger balance. Returns a zero balance object if no balance record exists yet for the user.

read scope

Path Parameters

required

Internal user ID.

Request URL

GEThttp://localhost:4000/api/v1/users/{userId}/balance

Example Response

{  "data": {    "user_id": "usr_abc123",    "available": "1250.00",    "reserved": "200.00",    "currency": "USD",    "total": "1450.00",    "updated_at": "2026-02-25T12:00:00.000Z"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Credits funds to the user's available balance (e.g. top-up success, escrow refund). Validated and executed atomically via BalanceService.creditAvailable.

write scope

Path Parameters

required

Internal user ID.

application/json

Request URL

POSThttp://localhost:4000/api/v1/users/{userId}/balance/credit

Example Response

{  "data": {    "success": true,    "balance": {      "user_id": "usr_abc123",      "available": "1350.00",      "reserved": "200.00",      "currency": "USD",      "total": "1550.00",      "updated_at": "2026-02-25T12:00:00.000Z"    },    "operation": "CREDIT_AVAILABLE",    "amount": "100.00",    "previousBalance": {      "available": "1250.00",      "reserved": "200.00"    },    "newBalance": {      "available": "1350.00",      "reserved": "200.00"    },    "auditLogId": "aud_01HZY"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Debits funds from the user's available balance (e.g. manual deduction, fee collection). Fails if available balance is less than the requested amount.

write scope

Path Parameters

required

Internal user ID.

application/json

Request URL

POSThttp://localhost:4000/api/v1/users/{userId}/balance/debit

Example Response

{  "data": {    "success": true,    "balance": {      "user_id": "usr_abc123",      "available": "1200.00",      "reserved": "200.00",      "currency": "USD",      "total": "1400.00",      "updated_at": "2026-02-25T12:00:00.000Z"    },    "operation": "DEBIT_AVAILABLE",    "amount": "50.00",    "previousBalance": {      "available": "1250.00",      "reserved": "200.00"    },    "newBalance": {      "available": "1200.00",      "reserved": "200.00"    },    "auditLogId": "aud_01HZZ"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Moves funds from available to reserved balance for a specific order, locking them ahead of escrow funding.

write scope

Path Parameters

required

Internal user ID (buyer).

application/json

Request URL

POSThttp://localhost:4000/api/v1/users/{userId}/balance/reserve

Example Response

{  "data": {    "success": true,    "balance": {      "user_id": "usr_abc123",      "available": "750.00",      "reserved": "700.00",      "currency": "USD",      "total": "1450.00",      "updated_at": "2026-02-25T12:00:00.000Z"    },    "operation": "RESERVE",    "amount": "500.00",    "previousBalance": {      "available": "1250.00",      "reserved": "200.00"    },    "newBalance": {      "available": "750.00",      "reserved": "700.00"    },    "auditLogId": "aud_01HZ1"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Two-party operation: deducts from the buyer's reserved balance and credits the seller's available balance in a single serializable transaction. Writes an audit log entry for both parties.

write scope

Path Parameters

required

Internal user ID of the buyer whose reserved funds are released.

application/json

Request URL

POSThttp://localhost:4000/api/v1/users/{userId}/balance/release

Example Response

{  "data": {    "success": true,    "balance": {      "user_id": "usr_seller456",      "available": "500.00",      "reserved": "0.00",      "currency": "USD",      "total": "500.00",      "updated_at": "2026-02-25T12:00:00.000Z"    },    "operation": "RELEASE",    "amount": "500.00",    "previousBalance": {      "available": "0.00",      "reserved": "0.00"    },    "newBalance": {      "available": "500.00",      "reserved": "0.00"    },    "auditLogId": "aud_01HZ2"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Returns previously reserved funds back to the user's available balance (e.g. order cancelled before escrow funding).

write scope

Path Parameters

required

Internal user ID.

application/json

Request URL

POSThttp://localhost:4000/api/v1/users/{userId}/balance/cancel-reservation

Example Response

{  "data": {    "success": true,    "balance": {      "user_id": "usr_abc123",      "available": "1250.00",      "reserved": "200.00",      "currency": "USD",      "total": "1450.00",      "updated_at": "2026-02-25T12:00:00.000Z"    },    "operation": "CANCEL_RESERVATION",    "amount": "500.00",    "previousBalance": {      "available": "750.00",      "reserved": "700.00"    },    "newBalance": {      "available": "1250.00",      "reserved": "200.00"    },    "auditLogId": "aud_01HZ3"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Removes funds directly from the user's reserved balance without crediting another party (e.g. platform penalty on a disputed reservation).

write scope

Path Parameters

required

Internal user ID.

application/json

Request URL

POSThttp://localhost:4000/api/v1/users/{userId}/balance/deduct-reserved

Example Response

{  "data": {    "success": true,    "balance": {      "user_id": "usr_abc123",      "available": "1250.00",      "reserved": "100.00",      "currency": "USD",      "total": "1350.00",      "updated_at": "2026-02-25T12:00:00.000Z"    },    "operation": "DEDUCT_RESERVED",    "amount": "100.00",    "previousBalance": {      "available": "1250.00",      "reserved": "200.00"    },    "newBalance": {      "available": "1250.00",      "reserved": "100.00"    },    "auditLogId": "aud_01HZ4"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Compares the local ledger balance against the active payment provider (Stellar Horizon for crypto, AirTM otherwise) and flags any discrepancy found. Writes a BALANCE_SYNC audit log entry.

write scope

Path Parameters

required

Internal user ID.

Request URL

POSThttp://localhost:4000/api/v1/users/{userId}/balance/sync

Example Response

{  "data": {    "synced": true,    "localBalance": "1250.00",    "providerBalance": "1250.00",    "discrepancy": "0.00",    "action": "none"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Returns the local balance plus a providerVerified flag, after running the same provider-sync check as the sync endpoint. Throws if a significant (> $1.00) discrepancy is detected against the payment provider.

read scope

Path Parameters

required

Internal user ID.

Request URL

GEThttp://localhost:4000/api/v1/users/{userId}/balance/verify

Example Response

{  "data": {    "user_id": "usr_abc123",    "available": "1250.00",    "reserved": "200.00",    "currency": "USD",    "total": "1450.00",    "updated_at": "2026-02-25T12:00:00.000Z",    "providerVerified": true  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Withdrawals

Payout operations from a user's ledger balance to a bank account, crypto address, or AirTM balance, via AirTM payouts or direct Stellar transfers.

Creates a withdrawal. For destinationType "crypto" it executes a synchronous Stellar USDC transfer and completes immediately; for "bank"/"airtm_balance" it reserves funds and creates an asynchronous AirTM payout (two-step unless commit=true). userId is a required body field, not a path parameter — this is a server-to-server API where the caller's API key does not identify the acting user.

write scope

application/json

Request URL

POSThttp://localhost:4000/api/v1/withdrawals

Example Response

{  "data": {    "id": "wd_01HZY",    "amount": "100.00",    "currency": "USD",    "status": "WITHDRAWAL_CREATED",    "destinationType": "crypto",    "committed": true,    "createdAt": "2026-02-25T12:00:00.000Z"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Lists withdrawals for a user, newest first, with cursor pagination.

read scope

Query Parameters

required

User whose withdrawals to list.

optional

Items per page. Default 20, capped at 100.

optional

The nextCursor value from the previous page; omit for the first page.

Request URL

GEThttp://localhost:4000/api/v1/withdrawals

Example Response

{  "data": {    "data": [      {        "id": "wd_01HZY",        "userId": "usr_abc123",        "amount": "100.00",        "currency": "USD",        "status": "WITHDRAWAL_COMPLETED",        "destinationType": "crypto",        "destinationRef": "GBCG42WTVWPO4Q6N...",        "createdAt": "2026-02-25T12:00:00.000Z",        "updatedAt": "2026-02-25T12:05:00.000Z"      }    ],    "hasMore": false  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Returns a single withdrawal's status and details, scoped to the owning user.

read scope

Path Parameters

required

Withdrawal ID.

Query Parameters

required

Owning user ID — the lookup is scoped to (id, userId) together.

Request URL

GEThttp://localhost:4000/api/v1/withdrawals/{id}

Example Response

{  "data": {    "id": "wd_01HZY",    "userId": "usr_abc123",    "amount": "100.00",    "currency": "USD",    "status": "WITHDRAWAL_COMPLETED",    "destinationType": "crypto",    "destinationRef": "GBCG42WTVWPO4Q6N...",    "createdAt": "2026-02-25T12:00:00.000Z",    "updatedAt": "2026-02-25T12:05:00.000Z"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Commits a withdrawal that was created in two-step mode (commit=false). Only valid while the withdrawal is still in a committable status; commits the associated Airtm payout and returns the refreshed withdrawal.

write scope

Path Parameters

required

Withdrawal ID.

Query Parameters

required

Owning user ID.

Request URL

POSThttp://localhost:4000/api/v1/withdrawals/{id}/commit

Example Response

{  "data": {    "id": "wd_01HZY",    "userId": "usr_abc123",    "amount": "100.00",    "currency": "USD",    "status": "WITHDRAWAL_COMMITTED",    "destinationType": "bank",    "destinationRef": "bank_acct_01",    "createdAt": "2026-02-25T12:00:00.000Z",    "updatedAt": "2026-02-25T12:06:00.000Z"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Re-fetches the withdrawal's payout status from Airtm and applies the state transition locally if the orchestrator's WithdrawalStateMachine allows it. Use when a status-change webhook may have been missed. If the withdrawal has no Airtm payout yet, returns its current state unchanged.

read scope

Path Parameters

required

Withdrawal ID.

Query Parameters

required

Owning user ID.

Request URL

POSThttp://localhost:4000/api/v1/withdrawals/{id}/refresh

Example Response

{  "data": {    "id": "wd_01HZY",    "userId": "usr_abc123",    "amount": "100.00",    "currency": "USD",    "status": "WITHDRAWAL_COMPLETED",    "destinationType": "bank",    "destinationRef": "bank_acct_01",    "airtmPayoutId": "pay_01HZY",    "createdAt": "2026-02-25T12:00:00.000Z",    "updatedAt": "2026-02-25T12:07:00.000Z"  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Audit Logs

Query the marketplace audit trail with filters and cursor pagination. Requires the support scope.

Returns audit entries for the caller's marketplace, ordered by occurredAt descending then id descending. Cursor-paginated; the controller fetches limit+1 rows to compute hasMore. payloadBefore/payloadAfter are redacted (sensitive keys replaced with ***REDACTED***) by RedactionService before storage.

support scope

Query Parameters

optional

Filter by resource type, e.g. dispute, order, withdrawal

optional

Filter to one resource instance

optional

Action performed on the resource

optional

Filter by the acting user

optional

ISO date string; include entries at/after this time (occurredAt >= from); ignored if unparseable

optional

ISO date string; include entries at/before this time (occurredAt <= to); ignored if unparseable

optional

Page size; default 20, capped at 100 (@IsInt @Min(1) @Max(100) — over 100 returns 400, unlike other list endpoints which just clamp)

optional

Audit log id from pagination.nextCursor of the previous page

Request URL

GEThttp://localhost:4000/api/v1/audit/logs

Example Response

{  "data": {    "data": [      {        "id": "aud_01JABCDEF",        "occurredAt": "2026-02-04T12:00:00.000Z",        "action": "DISPUTE_RESOLVED",        "resourceType": "dispute",        "resourceId": "dsp_01JABCDEF",        "payloadBefore": {          "status": "UNDER_REVIEW"        },        "payloadAfter": {          "status": "RESOLVED",          "decision": "SPLIT",          "releaseAmount": "60.00",          "refundAmount": "40.00",          "note": "Partial work completed"        },        "actorType": "SYSTEM",        "actorId": null,        "result": "SUCCESS",        "correlationId": "550e8400-e29b-41d4-a716-446655440002"      }    ],    "pagination": {      "hasMore": true,      "nextCursor": "aud_01JABCDEF"    }  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Events

Real-time domain event stream over Server-Sent Events (SSE).

Server-Sent Events stream of domain events (DomainEvent envelope: eventId, eventType, occurredAt, aggregateId, aggregateType, payload, metadata), scoped to the marketplace bound to the caller's API key. Sends a 'ping' heartbeat every 30 seconds. Supports reconnection via the Last-Event-ID header (exclusive replay from Redis, capped at the last 1000 events) or the since query param. This is NOT a JSON response — it is a text/event-stream, unlike every other endpoint in this API.

Authenticated

Query Parameters

optional

Repeatable. Exact event type(s) to include (e.g. order.created). Exact match only — wildcards like order.* are not valid on this public stream.

optional

Repeatable. Exact aggregate type(s) to include (e.g. Order, Balance).

optional

ISO 8601 timestamp. Replays buffered events after this time when no Last-Event-ID header is supplied; the header takes precedence over this param.

Request URL

GEThttp://localhost:4000/api/v1/events
This endpoint streams Server-Sent Events and doesn't fit a one-shot request. Try it with curl:
Try it with curl
curl -N "http://localhost:4000/api/v1/events"

Example Response

id: 2026-02-18T17:37:12.000Zevent: order.escrow_fundeddata: {"eventId":"evt_abc123","eventType":"order.escrow_funded","occurredAt":"2026-02-18T17:37:12.000Z","aggregateId":"ord_abc123","aggregateType":"Order","payload":{"orderId":"ord_abc123","escrowId":"esc_abc123","trustlessContractId":"CTW...","amount":"100.00","fundedAt":"2026-02-18T17:37:12.000Z"},"metadata":{}}

Webhooks

Inbound webhook receivers that external providers (AirTM, Trustless Work) call to notify the Orchestrator. Not an outbound subscription API — integrators use the SSE event stream instead.

Receives pay-in (topup.*) and pay-out (withdrawal.*) status updates from AirTM. Signature verification runs first (Svix headers + AIRTM_WEBHOOK_SECRET); an invalid signature is rejected with 401 before any processing. Duplicate deliveries (same provider+eventId) are acknowledged and skipped. Responses are always 200 after a valid signature, even for business-logic failures, to avoid provider retry storms.

application/json

Request URL

POSThttp://localhost:4000/api/v1/webhooks/airtm

Example Response

{  "data": {    "status": "ok",    "processed": true  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}

Receives escrow lifecycle events from Trustless Work (escrow.created, escrow.funding_started, escrow.funded, escrow.milestone_completed, escrow.released, escrow.refunded, escrow.disputed) and flips the escrow/order state machines, re-emitting the corresponding domain events on the SSE stream. Events carrying a transaction_hash are verified against the Stellar network before the state change is applied.

application/json

Request URL

POSThttp://localhost:4000/api/v1/webhooks/trustless-work

Example Response

{  "data": {    "status": "ok",    "processed": true  },  "meta": {    "requestId": "3f2b8c1e-9d4a-4c7e-8a51-0b6e2d9f7a13",    "timestamp": "2026-02-25T12:00:00.412Z"  }}