Find something... ⌘K

API reference / Routes

Status routes

The routes that say where an order is: one read, its history, a live stream, and your list of orders. Poll or stream while a user watches; use webhooks for your records. The reads take a secret or a publishable key; the history, your list and POST /orders/watch take the secret key. The samples use TX_HASH and ORDER_ID from Buy BTC; answers are real sandbox answers, trimmed.

The status object

Every read answers the same object. Branch on state, or map substatus; rawStatus is for support.

FieldMeaning
orderIdThe order id
routeevm-btc-escrow, evm-btc-gasless, evm-btc-bridge, btc-evm, sol-btc, btc-sol or cross-evm
statepending, awaiting_deposit, in_progress, completed, refundable, refunded, cancelled, expired or failed: Order states
rawStatusThe solver's own word for where the order is, for support
substatusWhere the order is within its state, in a router's terms: WAITING_FOR_COMMIT or BITCOIN_SENT (pending), CONFIRMED (done), REFUND_AVAILABLE, REFUNDED or FAILED
receivingThe transaction that delivers what the user asked for, { chain, txHash, asset, amount }, with null fields until known
isCompletetrue once the order has ended for good: a buy at its Bitcoin payment's first confirmation (btcConfirmations 1; state reads completed from the broadcast), a sale once its payout is on chain, or a refund, cancel, expiry or failure
btcTxIdThe Bitcoin payment. Buying BTC, the payment has been sent when it is set. A solver that speeds up the payment after completed changes it and sends order.payment_replaced: show the latest
btcConfirmationsConfirmations of the Bitcoin payment so far. Report a buy as final when it reaches 1, about 10 minutes after completed
txsEach transaction of the order, with a label such as escrow or btc_payout
failureReasonWhy it failed, in a sentence, or null

GET /orders/{id}

One order. While open, it also says when the deposit can be taken back (refundAt, refundAtIso, and refundAfterBlock once a solver commits), and carries your externalId and externalCustomerId.

ParameterRequiredMeaning
chainIdnoThe order's chain
routenoThe order's route, when it is not an EVM to BTC buy: sol-btc, btc-sol, cross-evm
curl Copy
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/orders/$ORDER_ID?chainId=8453"

A completed sandbox order (x-request-id 7e3df7fd-1ab5-4884-845a-83bff64b761d):

json Copy
{ "orderId": "0x53414e44424f587cd5a69277e53f49de23e39cf4824bdb1111dc19f9b373caf1", "route": "evm-btc-escrow", "state": "completed", "rawStatus": "SANDBOX_COMPLETED", "substatus": "CONFIRMED", "receiving": { "chain": "bitcoin", "txHash": "53414e44424f58dbfc5229f0e9b8587e5d81dd14a4cf19e2781a379855153d49", "asset": "BTC", "amount": null }, "isComplete": true, "btcTxId": "53414e44424f58dbfc5229f0e9b8587e5d81dd14a4cf19e2781a379855153d49", "btcConfirmations": 0, "txs": [ { "label": "escrow", "hash": "0x53414e44424f5848edce6412ebac0e01eee87fdadc3aa4ea7664fc57f9731b77" }, { "label": "btc_payout", "hash": "53414e44424f58dbfc5229f0e9b8587e5d81dd14a4cf19e2781a379855153d49" } ], "failureReason": null, "externalId": null, "externalCustomerId": null, "sandbox": true }

An order POST /orders accepted reads pending from that moment, never 404. An id no order has (a quote never placed) answers 404 not_found, so stop polling it.

GET /status

The same read by query; it also finds an order from any of its transactions.

ParameterRequiredMeaning
orderIdone of the twoThe order id
txHashone of the twoAny transaction of the order: the escrow, the settlement, or the Bitcoin payment
chainId, routenoAs above. route defaults to evm-btc-escrow
toChainIdnoCoin to coin only
curl Copy
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/status?txHash=$TX_HASH"

A hash no order has answers 404 not_found: a transaction seconds old may not be recorded yet, so ask again.

GET /orders/{id}/events

The order's states so far, with times, oldest first, from when the API first saw it. For orders placed with your key or followed with POST /orders/watch.

curl Copy
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/orders/$ORDER_ID/events"
json Copy
{ "orderId": "0x53414e44424f58000084175d1e6668de99f7310124ba5f11ce3c2a04cbb79bf5", "events": [ { "state": "pending", "previousState": null, "rawStatus": "SANDBOX_PENDING", "btcTxId": null, "txs": ["…"], "at": "2026-11-20T01:11:15.000Z" }, { "state": "in_progress", "previousState": "pending", "rawStatus": "SANDBOX_FILLING", "btcTxId": null, "txs": ["…"], "at": "2026-11-20T01:11:23.000Z" } ], "nextCursor": null, "sandbox": true }

GET /orders/{id}/events/stream

The order as server-sent events, one order.updated (the status object) for each change of state or btcTxId, then end when it is over. A connection lasts at most two minutes: reconnect to go on. Takes chainId and route as above.

curl Copy
curl -sN -H "x-maxy-key: $MAXY_API_KEY" "$BASE/orders/$ORDER_ID/events/stream?chainId=8453"
text Copy
retry: 5000 event: order.updated data: {"orderId":"0x53414e44424f580a5f1c…","route":"evm-btc-escrow","state":"pending","rawStatus":"SANDBOX_PENDING","isComplete":false,"btcTxId":null,…} event: order.updated data: {"orderId":"0x53414e44424f580a5f1c…","route":"evm-btc-escrow","state":"in_progress","rawStatus":"SANDBOX_FILLING",…}

POST /orders/{id}/stream-ticket

A ticket that opens this order's stream from a browser for 10 minutes, with no key: pass stream to EventSource. It works as the price stream ticket does, and answers 201.

curl Copy
curl -s -X POST -H "x-maxy-key: $MAXY_API_KEY" "$BASE/orders/$ORDER_ID/stream-ticket?chainId=8453"
json Copy
{ "ticket": "mst1.eyJrIjoibyIsInQ…", "expiresAt": 1795137738, "expiresAtIso": "2026-11-20T01:22:18.000Z", "stream": "https://openapi.maxy.co/v1/orders/0x53414e44424f580a5f1c…/events/stream?chainId=8453&ticket=mst1.…", "sandbox": true }

GET /orders

Your orders, newest first: those placed with your key, and those you follow.

ParameterMeaning
from, toA date or an ISO 8601 time
state, wallet, externalId, externalCustomerIdFilters
limitUp to 100 a page; 1,000 with format=csv
cursornextCursor of the page before; it is null on the last page
formatjson (the default) or csv
curl Copy
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/orders?externalId=inv-1042&limit=2"
json Copy
{ "orders": [ { "orderId": "0x53414e44424f58000084175d…", "route": "evm-btc-escrow", "chainId": 8453, "state": "in_progress", "btcTxId": null, "createdAt": "2026-11-20T01:11:15.21997+00:00", "doneAt": null, "externalId": "inv-1042", "externalCustomerId": null, "wallet": "0x2D6d2AB709A687f765B24F9193CF2ab0d773DA58" }, "…" ], "nextCursor": "MjAyNi0xMS0yMFQwMToxMToxNC4xMjcwMzUr…", "sandbox": true }

Month-end matching: Reconcile.

POST /orders/watch

Follow an order placed another way, so it reaches your webhooks, your list and its events. Body: orderId, and chainId, route and toChainId as above.

curl Copy
curl -s -X POST "$BASE/orders/watch" -H "x-maxy-key: $MAXY_API_KEY" -H "content-type: application/json" \ -d '{ "orderId": "'"$ORDER_ID"'", "chainId": 8453 }'
json Copy
{ "watching": true, "orderId": "0x53414e44424f580a5f1c09376699fe993c7a6a544b75673b928be0ac6ee1f2ca", "route": "evm-btc-escrow", "sandbox": true }

Errors

HTTPcodeWhen
400invalid_inputNo orderId or txHash, a malformed id or hash, or a bad date
401auth_required, invalid_api_key, invalid_ticketNo key, an unknown key, or a bad stream ticket
403scope_deniedA publishable key on the events, the list or watch
404not_foundNo order has that id or transaction (a quote never placed); events for an order your key does not track
429rate_limitedOver your limit