Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/orders | Create a new FX order |
| GET | /api/v1/orders | List your orders (filterable, paginated) |
| GET | /api/v1/orders/{intent_id} | Get order by ID |
| POST | /api/v1/orders/{intent_id}/cancel | Cancel a PENDING or QUOTED order |
| GET | /api/v1/orders/{intent_id}/quotes | List quotes for an order |
| POST | /api/v1/orders/{intent_id}/quotes/{quote_id}/accept | Accept a quote |
| GET | /api/v1/orders/events | Real-time SSE event stream |
| GET | /api/v1/dashboard/stats | Order counts and settlement volume |
/health and /auth/token). See Authentication and API Conventions for details on headers, pagination, error handling, and response envelopes.
Quick Example: Order to Settlement
1. Create an Order
PENDING status with intent_id assigned.
2. Accept a Quote
QUOTED with fx_rate, source_amount_actual, and market_maker_party_id populated.
3. Verify Settlement
PollGET /api/v1/orders/{intent_id} until status is SETTLED:
Order Status Lifecycle
| Transition | Trigger |
|---|---|
| PENDING -> QUOTED | Quote accepted via API |
| QUOTED -> EXECUTING | Musubi begins atomic settlement (automatic) |
| EXECUTING -> SETTLED | All four DvP legs complete (automatic) |
| PENDING -> EXPIRED | expires_at reached without accepted quote |
| QUOTED -> EXPIRED | Quote’s valid_until passed before settlement |
| PENDING/EXECUTING -> FAILED | Validation or settlement failure |
Failure Reasons
| Reason | Description |
|---|---|
NO_QUOTE | No market maker quoted before expiry |
SLIPPAGE | Best quote below source_amount_max |
KYC_FAIL | KYC/AML validation failed |
TIMEOUT | Settlement window exceeded |
REVERT | DvP transaction reverted |
Real-Time Events (SSE)
Connect toGET /api/v1/orders/events for real-time updates:
| Event | Trigger |
|---|---|
order_updated | Order status changed |
quote_received | New quote on a PENDING order (sender only) |
heartbeat | Keepalive every 30 seconds |
?intent_id={uuid}