Ambit Rail API · v0.1.0-draft
Regulated AUD⇄USDT conversion desk — AUD corridor endpoint for partners.
Spec-first draft — honest status
This documentation is generated from our OpenAPI definition and published ahead of implementation. The sandbox program is opening; endpoints are not yet live in production. Docs are public — production keys are issued only after partner KYB and a signed agreement. The API adds no capability beyond our internal kernel: it can create intents, and the final money-moving step always remains behind an internal maker-checker approval on the Australian side.
Quickstart (sandbox preview)
Deterministic mock rails, self-serve keys, resettable data. Base URL: https://sandbox.api.ambitrail.com/v1
# 1 — create a customer, start hosted KYC
curl -X POST $BASE/customers \
-H "X-Api-Key: $SANDBOX_KEY" -H "Idempotency-Key: demo-1" \
-d '{"type":"individual","legal_name":"Ada Lovelace"}'
# 2 — lock a quote (AUD → USDT)
curl -X POST $BASE/quotes \
-H "X-Api-Key: $SANDBOX_KEY" -H "Idempotency-Key: demo-2" \
-d '{"customer_id":"cus_…","sell":{"currency":"AUD","minor":100000000,"decimal":"10000.00"},"buy_currency":"USDT"}'
# 3 — create the order, then simulate the AUD deposit in sandbox
# (magic amount suffixes trigger compliance paths — see below)
# 4 — fetch the attestation receipt and verify it without auth
curl "$BASE/receipts/rcp_…/verify?content_hash=…"Sandbox scenarios (magic amounts)
Our compliance gates are testable, not hidden. Send a sandbox deposit with the given cents suffix to rehearse each path end-to-end.
- .00happy path — matched → posted → order releasable → receipt issued
- .13payer name mismatch — deposit suspended_name_mismatch, manual-review queue
- .31deposit later reversed — funding_reversed cascades to order/release locks
- .77TR data incomplete — release approval blocked_tr_incomplete (fail-closed)
Compliance gates are first-class states
A regulated desk suspends and blocks by design. These appear in order/deposit states and in Problem.compliance_reason — documented, testable, never a surprise:
blocked_kyc_incompleteblocked_kyc_evidence_missingblocked_tr_incompletesuspended_name_mismatchtrading_frozen_by_reconfunding_reversed
Webhook events
Signed envelopes (domain.resource.event), retried with backoff, delivery log queryable.
customer.kyc.updatedva.assigneddeposit.receiveddeposit.matcheddeposit.suspendeddeposit.reversedquote.lockedquote.declinedorder.state.changedorder.releasedorder.settled
API reference
Generated from openapi.yaml at build time — the spec is the single source of truth. All mutations require an Idempotency-Key header.
customers — verify — customer identity, KYC lifecycle (Sumsub-backed)
- post
/customersCreate a customer (individual or company)
Creates the customer record that all money movement hangs off. KYC ownership model (own-KYC via kyc-session vs reliance on partner KYC) is pending decision Q23 — v0.1 documents the own-KYC flow only.
- Request
- CustomerCreate
- get
/customers/{customerId}Fetch a customer
- patch
/customers/{customerId}Complete or correct a customer's details
Any subset of `legal_name`, `email` and `profile` (profile fields merge). Identity details are locked once the customer's account is open (409 `profile_locked`); the legal name is locked once KYC has started (409 `legal_name_locked`).
- Request
- object
- get
/customers/{customerId}/balanceAUD the customer holds with Ambit
`total` is what the customer holds; `reserved_for_orders` is tied up in funded orders that have not settled; `available` is the rest (e.g. a deposit that arrived after its quote expired). Converting from the balance is not available yet.
- Response
- object· errors: Problem (RFC 7807)
- post
/customers/{customerId}/kyc-sessionStart a hosted KYC session (Sumsub-backed)
Returns a hosted verification link / SDK token for the end customer. Outcome arrives via `customer.kyc.updated` webhook. Until KYC is GREEN with a verifiable evidence source, all money actions for this customer are fail-closed. Safe to repeat: each call issues a fresh link and invalidates the previous one. The response is not stored for idempotent replay because the link is a credential. Company customers: 422 `company_onboarding_not_supported` (KYB is done by Ambit).
- Response
- KycSession· errors: Problem (RFC 7807)
virtual-accounts — settle — named AUD collection accounts (BSB + account + PayID)
- post
/virtual-accountsIssue a named AUD virtual account for a KYC-passed customer
VA is issued in the customer's verified legal name. Deposits from any other payer name will suspend (see Deposit.status). KYC must be GREEN — otherwise 403 `blocked_kyc_incomplete`. Opening an account needs the customer's `profile` (422 `customer_profile_incomplete` lists the missing fields). A VA is also opened automatically when KYC is approved; POST then returns the existing VA with 200.
- Request
- object
- Response
- VirtualAccount· errors: Problem (RFC 7807)
- get
/virtual-accounts/{vaId}Fetch a virtual account
- Response
- VirtualAccount· errors: Problem (RFC 7807)
quotes — quote — locked pricing with expiry
- post
/quotesLock a conversion quote (AUD → USDT)
Locked rate with `expires_at` (15 minutes). Consuming an expired quote fails. When this amount plus the customer's locked-but-unfunded quotes reaches AUD 50,000, a second person is needed: the response is 202 with a QuoteRequest (`pending_confirmation`), so splitting one large amount into smaller quotes does not avoid the check. An Ambit operator prices it, sees the rate, then locks it or declines it within 4 hours; you get `quote.locked` (with `request_id`) or `quote.declined`, or poll GET /quote-requests/{id}. Rates come from a market snapshot checked against exchange prices; when no trustworthy rate is available the request is refused with 503 `no_market_rate` (retry shortly). An amount the market cannot price automatically is refused with 422 `amount_exceeds_market_depth` (use a smaller amount or ask Ambit for a desk quote). When too many locked quotes are waiting for funds, new ones are refused with 409 `open_quote_limit_reached` until existing ones are funded or expire. While daily reconciliation is not balanced, quotes are refused with 409 `trading_frozen_by_recon` (safe to retry with the same Idempotency-Key later). A customer can hold only one open quote per AUD amount, because deposits are matched to orders by exact amount: a second one is refused with 409 `open_quote_exists` (carries the existing `quote_id`).
- Request
- QuoteCreate
- get
/quotes/{quoteId}Fetch a quote
- get
/quote-requests/{requestId}Fetch a large-ticket quote request
- Response
- QuoteRequest· errors: Problem (RFC 7807)
orders — settle — quote consumption through to gated release
- post
/ordersCreate an order from a locked quote
Binds quote → expected deposit → gated release. The USDT release step is NEVER triggered by this API: it requires internal maker-checker approval (AU-side). Travel Rule beneficiary data is required before release can be approved (fail-closed, `blocked_tr_incomplete`). The quote must be locked and unexpired. Pay exactly `sell` into the customer's VA before `pay_before`; the deposit is matched to the order automatically.
- Request
- OrderCreate
- get
/orders/{orderId}Fetch an order
deposits — settle — AUD receipts, name-matching states (read-only)
- get
/depositsList deposits (read-only)
- Response
- object· errors: Problem (RFC 7807)
- get
/deposits/{depositId}Fetch a deposit
receipts — attest — verifiable transaction attestations
- get
/receipts/{receiptId}Fetch an attestation receipt
Machine-verifiable record of a completed conversion: amounts, fee waterfall, rate, on-chain tx hash, content hash (+ signature, GA with U1.3/T46).
- get
/receipts/{receiptId}/verifypublic · no authVerify a receipt by content hash (PUBLIC — no auth)
- Response
- object· errors: Problem (RFC 7807)
webhooks — event subscriptions and delivery
- get
/webhook-endpointsList active webhook endpoints
- Response
- object· errors: Problem (RFC 7807)
- post
/webhook-endpointsRegister a webhook endpoint
The URL must be public https (private, loopback and link-local addresses are refused, redirects are not followed). At most 5 active endpoints per account. The signing secret is returned only in this response. Every delivery is a POST of a WebhookEnvelope with headers `Ambit-Event-Id`, `Ambit-Event-Type` and `Ambit-Signature: t=<unix seconds>,v1=<hex>`, where v1 is HMAC-SHA256(secret, "<t>.<raw body>"). Reject stale timestamps (e.g. > 5 minutes). Delivery is at-least-once: dedupe on the event id. A non-2xx answer is retried after 1 min, 5 min, 15 min, 1 h, 3 h, 6 h and 12 h, then the delivery is marked failed. On the demo sandbox deliveries are recorded but not sent (it makes no outbound calls); inspect them with GET /webhook-endpoints/{id}/deliveries.
- Request
- object
- Response
- WebhookEndpoint· errors: Problem (RFC 7807)
- delete
/webhook-endpoints/{endpointId}Disable a webhook endpoint (pending deliveries to it are dropped)
- Response
- —· errors: Problem (RFC 7807)
- get
/webhook-endpoints/{endpointId}/deliveriesThe 50 most recent deliveries to an endpoint, with payloads and attempt results
- Response
- object· errors: Problem (RFC 7807)
- post
/webhook-endpoints/{endpointId}/testQueue a `webhook.test` event to check your receiver and signature code
- Response
- —· errors: Problem (RFC 7807)
sandbox — simulate bank deposits and KYC outcomes (never available in production)
- post
/sandbox/depositsSimulate an incoming AUD bank transfer (sandbox only)
Runs the same deposit pipeline as a real bank notification (name matching, ledger posting, automatic order matching). The AUD cents select a scenario, see `x-sandbox-scenarios`. `payer_name` defaults to the VA's account name. Not available in production.
- Request
- object
- post
/sandbox/kyc-decisionsDecide a customer's KYC (demo sandbox only)
Applies a KYC result through the same handler as the verification provider's webhook, including automatic VA opening on approval. Demo only; on the staging sandbox, complete the hosted verification flow instead.
- Request
- object
agents — the same API as an MCP server, for AI agents
- post
/mcpThe API as an MCP server for AI agents (Model Context Protocol, Streamable HTTP)
Point an MCP client at `https://<host>/api/v1/mcp` with your API key in `X-Api-Key` or `Authorization: Bearer <key>`. Stateless JSON-RPC 2.0 (`initialize`, `tools/list`, `tools/call`, `ping`); no server-sent stream, so `GET` returns 405. Each tool is one endpoint of this API (`create_customer`, `create_quote`, `create_order`, `get_order`, `sandbox_simulate_deposit`, …) and runs through it unchanged: same key scope, validation, idempotency, rate limit and errors. API errors come back as tool results with `isError: true` and the problem body, so an agent can read and fix them. Mutating tools take an optional `idempotency_key` to make retries safe. Agents cannot release USDT: `create_order` records the order, and every release is approved by Ambit staff (maker-checker). Sandbox keys only, like the rest of `/v1`.
- Request
- object
- Response
- —· errors: Problem (RFC 7807)
Schemas
Problem
RFC 7807. Compliance blocks carry a machine-readable `compliance_reason`.
Field Type Notes type * string title * string status * integer detail string compliance_reason string enum: blocked_kyc_incomplete · blocked_kyc_evidence_missing · blocked_tr_incomplete · suspended_name_mismatch · trading_frozen_by_recon · funding_reversed Money
Field Type Notes currency * string enum: AUD · USDT minor * integer Integer minor units. AUD: e4. USDT: e6. Never floats. decimal * string String decimal mirror for display. MoneyInput
Give `minor` (integer minor units) or `decimal` (string); if both, they must agree. AUD amounts are whole cents between AUD 1.00 and AUD 1,000,000.00. AUD `minor` is 1/10000 AUD, so it must be a multiple of 100 (AUD 100.00 = 1000000).
Field Type Notes currency * string enum: AUD · USDT minor integer decimal string CustomerCreate
Field Type Notes type * string enum: individual · company legal_name * string VA will be issued in this verified name. Letters, digits, spaces and ' ’ . , & ( ) / -. Individuals: a first and last name of letters, spaces, ' or - (each part up to 32 characters), as required by the banking partner. email string external_ref string Partner-side customer reference (unique per partner; 409 `external_ref_exists` on reuse). profile CustomerProfile CustomerProfile
Identity details the banking partner needs to open the customer's VA.
Field Type Notes country string Residence, ISO 3166-1 alpha-2 nationality string ISO 3166-1 alpha-2 date_of_birth string Customer must be 18 or older. address object id_document object Customer
Field Type Notes id * string kyc_status * string enum: none · pending · approved · rejected · frozen kyc_evidence_source string Only webhook/api-verified evidence unlocks money actions (ADR-16). created_at * string KycSession
Field Type Notes session_id * string verification_url * string sdk_token string expires_at * string VirtualAccount
Field Type Notes id * string customer_id * string account_name * string Customer's verified legal name — name-match enforced. bsb * string account_number * string payid string status * string enum: active · inactive QuoteCreate
Field Type Notes customer_id * string sell * Money buy_currency * string enum: USDT Quote
QuoteRequest
Field Type Notes object * string enum: quote_request id * string customer_id * string sell * Money status * string enum: pending_confirmation · locked · declined · expired quote_id stringnull Set once locked; order with this quote. expires_at * string created_at * string TravelRuleBeneficiary
Travel Rule data required before release approval (AUSTRAC, in force 2026-07-01, no de-minimis). Field-level source: research §14. Ownership model pending Q23.
Field Type Notes full_name * string wallet_address * string TRON (TRC-20) address, checksum-verified. USDT is sent on TRON. wallet_type * string enum: custodial_vasp · self_hosted vasp_name string Required when wallet_type is custodial_vasp. country string OrderCreate
Field Type Notes quote_id * string beneficiary * TravelRuleBeneficiary external_ref string Order
Field Type Notes id * string quote_id * string customer_id * string deposit_id string status * string enum: awaiting_funds · funds_received · funds_unmatched · suspended_review · awaiting_manual_release · released · settled · suspended_name_mismatch · blocked_tr_incomplete · funding_reversed · cancelled receipt_id string sell Money buy Money pay_before string While awaiting_funds: the quote's expiry. release objectnull Set once USDT has been sent. external_ref string created_at * string DepositStatus
`suspended_review`: held for manual review for a reason other than payer name.
receivedmatchedpostedsuspended_name_mismatchsuspended_reviewreturnedreversedDeposit
Field Type Notes id * string va_id * string customer_id string amount * Money payer_name * string name_match string enum: pending · matched · mismatch status * DepositStatus received_at * string Receipt
Field Type Notes id * string order_id * string initial_amount * Money fees object[] final_amount * Money rate * string destination_tx_hash string content_hash * string Hash over canonical receipt JSON; verify via GET /receipts/{id}/verify. signature string Detached signature — GA with U1.3/T46. pdf_url string issued_at * string WebhookEventType
customer.kyc.updatedva.assigneddeposit.receiveddeposit.matcheddeposit.suspendeddeposit.reversedquote.lockedquote.declinedorder.state.changedorder.releasedorder.settledWebhookEndpoint
Field Type Notes id * string url * string events * WebhookEventType[] status * string enum: active · disabled secret string Returned once at creation; HMAC-SHA256 event signing. WebhookEnvelope
Delivery envelope for all events. Signed; retried with backoff; delivery log queryable.
Field Type Notes id * string type * WebhookEventType created_at * string data * object