Skip to main content

API Reference — FX Engine

All requests require authentication via Bearer token issued during partner onboarding.

Authentication

HeaderValueDescription
AuthorizationBearer {api_key}API key issued during partner onboarding
Content-Typeapplication/jsonAll bodies are JSON
X-Partner-ID{partner_id}Required for fee routing and audit trail

GET /v1/quote — Indicative Price

Returns a wide reference price. No inventory reservation, no expiry.

// Request
GET /v1/quote?pair=USD-IDR&side=BUY&amount=10000

// Response
{
"pair": "USD-IDR",
"side": "BUY",
"indicative_rate": 16020.50,
"mid": 15980.00,
"spread_bps": 25,
"timestamp": "2026-02-27T10:00:00Z",
"quote_type": "INDICATIVE"
}

POST /v1/firm-quote — Executable Quote

Returns a firm BID/ASK with hard expiry and inventory reservation.

FieldTypeRequiredDescription
pairstringYesCurrency pair
sidestringYesBUY or SELL
amountnumberYesNotional in source currency
quote_typestringYesMust be FIRM
client_refstringNoPartner-side reference for reconciliation
// Request
{
"pair": "USD-IDR",
"side": "BUY",
"amount": 50000,
"quote_type": "FIRM",
"client_ref": "TXN-20260227-001"
}

// Response
{
"quote_id": "QT-8821-USD-IDR",
"pair": "USD-IDR",
"side": "BUY",
"amount": 50000,
"bid": 15940.00,
"ask": 16020.00,
"adjusted_mid": 15980.00,
"spread_bps": 25,
"expiry_timestamp": "2026-02-27T10:00:45Z",
"max_size": 50000,
"allowed_direction": "BUY",
"state_flag": "NORMAL",
"quote_type": "FIRM",
"execution_path": "DIRECT",
"fee_breakdown": {
"tier": "MEDIUM",
"fixed_fee": 0.633,
"fixed_fee_currency": "USD",
"fixed_fee_in_dest": 10000,
"fixed_fee_dest_currency": "IDR",
"variable_fee": 10.00,
"variable_fee_bips": 2,
"base_spread_bps": 20,
"total_spread_bps": 25,
"total_fee_usd": 10.633,
"amount_to_convert": 49989.37,
"is_partner_override": false
}
}
execution_path field

When a trade is routed to External RFQ due to size, this field returns EXTERNAL_RFQ instead of DIRECT. The requester is informed transparently that the trade will be filled via an external market maker.

Response Fields

FieldTypeDescription
quote_idstringUnique quote identifier
pairstringCurrency pair
sidestringTrade direction
amountnumberNotional in source currency
bidnumberBid price
asknumberAsk price
adjusted_midnumberOracle mid after skew adjustment
spread_bpsnumberTotal spread in basis points
expiry_timestampstringISO 8601 quote expiry
max_sizenumberMaximum executable size
allowed_directionstringPermitted trade direction
state_flagstringCurrent system state for corridor
quote_typestringFIRM
execution_pathstringDIRECT or EXTERNAL_RFQ
fee_breakdownobjectResolved fee tier and all fee components. See Volume-Tiered Fee Schedule.
fee_breakdown.tierstringTier name applied (e.g., "MICRO", "SMALL", "MEDIUM")
fee_breakdown.fixed_feenumberFixed fee in source currency
fee_breakdown.variable_feenumberVariable fee in source currency
fee_breakdown.variable_fee_bipsnumberVariable fee rate in basis points
fee_breakdown.base_spread_bpsnumberBase spread component from fee tier
fee_breakdown.total_spread_bpsnumberTotal spread including dynamic components
fee_breakdown.total_fee_usdnumberTotal platform fee (fixed + variable) in USD
fee_breakdown.amount_to_convertnumberSource amount after fee deduction
fee_breakdown.is_partner_overridebooleanWhether partner-specific rates were applied

POST /v1/execute — Execute a Firm Quote

Submits a firm quote for on-chain execution. Atomic and irreversible once confirmed.

FieldTypeRequiredDescription
quote_idstringYesQuote ID from firm-quote
amountnumberYesMust be ≤ quote max_size
destination_addressstringYesOn-chain wallet for output stablecoin
client_refstringNoPartner-side reference
// Response
{
"execution_id": "EX-9910-USD-IDR",
"quote_id": "QT-8821-USD-IDR",
"status": "SETTLED",
"filled_rate": 16020.00,
"source_amount": 50000,
"destination_amount": 801000000,
"platform_fee": 52.00,
"batch_id": "BATCH-101",
"tx_hash": "0xKAIA...ABC",
"settled_at": "2026-02-27T10:00:32Z",
"execution_path": "DIRECT",
"state_flag": "NORMAL"
}

GET /v1/system/state — Current System State

{
"system_state": "NORMAL",
"corridors": {
"USD-IDR": { "state": "NORMAL", "allowed_directions": ["BUY","SELL"], "oracle_age_ms": 380 },
"USD-SGD": { "state": "NORMAL", "allowed_directions": ["BUY","SELL"], "oracle_age_ms": 210 },
"MYR-IDR": { "state": "PROTECT", "allowed_directions": ["BUY","SELL"], "oracle_age_ms": 520 }
}
}

Error Codes

For the complete error code reference, see the Unified Error Codes page.