Skip to main content
All Musubi APIs follow the same conventions regardless of participant type.

Base URL

All endpoints are prefixed with /api/v1:
https://your-backend.example.com/api/v1/orders

Response Envelope

Every successful response wraps the payload in a standard envelope:
{
  "data": {
    "intent_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "status": "PENDING",
    "source_currency": "JPYSC0",
    "target_amount": "100000"
  },
  "meta": {
    "request_id": "req_a1b2c3d4",
    "timestamp": "2025-03-15T09:00:00.000Z"
  }
}

Error Codes

CodeHTTP StatusDescription
VALIDATION_ERROR400Missing or invalid request fields
UNAUTHORIZED401Missing or invalid JWT token
NOT_FOUND404Order, quote, or settlement not found
CONFLICT409Invalid state transition (e.g., cancelling a SETTLED order)
CANTON_ERROR502Settlement network unavailable
INTERNAL_ERROR500Unexpected server error

Pagination

List endpoints accept these query parameters:
ParameterDefaultRangeDescription
page11+Page number (1-indexed)
page_size201-100Items per page

Filtering & Sorting

Order list endpoints support:
ParameterExampleDescription
statusPENDING,QUOTEDComma-separated status filter
source_currencyJPYSC0Filter by source currency
target_currencyUSDCxFilter by target currency
created_after2025-03-01T00:00:00ZOrders created after this timestamp
created_before2025-03-31T23:59:59ZOrders created before this timestamp
sort_bycreated_atSort field: created_at, target_amount, status, settled_at
sort_orderdescSort direction: asc or desc

Data Formats

TypeFormatExample
TimestampsISO 8601 UTC2025-03-15T09:00:00.000Z
Decimal amountsString"10000000", "112.0"
IDsUUID v4f47ac10b-58cc-4372-a567-0e02b2c3d479
Party IDsCanton formatSenderInstitution::209fa2c...b341
Field namessnake_casesource_currency, intent_id
Decimal amounts are strings to prevent floating-point precision loss. Always parse them as decimals in your application, not as floats.

Server-Sent Events (SSE)

Each participant API provides an SSE endpoint for real-time updates. Connect using EventSource:
const events = new EventSource(
  'https://your-backend.example.com/api/v1/orders/events',
  { headers: { 'Authorization': `Bearer ${token}` } }
);

events.addEventListener('order_updated', (e) => {
  const order = JSON.parse(e.data);
  console.log(`Order ${order.intent_id} is now ${order.status}`);
});

events.addEventListener('heartbeat', () => {
  // Keepalive every 30 seconds
});
BehaviorDetail
HeartbeatEvery 30 seconds
ReconnectionAutomatic via EventSource
FilteringOptional intent_id query parameter to watch a specific order

Currencies

The testnet supports two stablecoins:
CodeNamePeg
JPYSC0Japanese Yen Stablecoin1:1 JPY
USDCxCanton-wrapped USDC1:1 USD