# 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](https://maxy.co/docs/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](https://maxy.co/docs/buy-btc#place-the-order); 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.

| Field | Meaning |
| --- | --- |
| `orderId` | The order id |
| `route` | `evm-btc-escrow`, `evm-btc-gasless`, `evm-btc-bridge`, `btc-evm`, `sol-btc`, `btc-sol` or `cross-evm` |
| `state` | `pending`, `awaiting_deposit`, `in_progress`, `completed`, `refundable`, `refunded`, `cancelled`, `expired` or `failed`: [Order states](https://maxy.co/docs/order-states) |
| `rawStatus` | The solver's own word for where the order is, for support |
| `substatus` | Where 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` |
| `receiving` | The transaction that delivers what the user asked for, `{ chain, txHash, asset, amount }`, with `null` fields until known |
| `isComplete` | `true` 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 |
| `btcTxId` | The 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 |
| `btcConfirmations` | Confirmations of the Bitcoin payment so far. Report a buy as final when it reaches 1, about 10 minutes after `completed` |
| `txs` | Each transaction of the order, with a `label` such as `escrow` or `btc_payout` |
| `failureReason` | Why 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`.

| Parameter | Required | Meaning |
| --- | --- | --- |
| `chainId` | no | The order's chain |
| `route` | no | The order's route, when it is not an EVM to BTC buy: `sol-btc`, `btc-sol`, `cross-evm` |

```sh
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
{
  "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.

| Parameter | Required | Meaning |
| --- | --- | --- |
| `orderId` | one of the two | The order id |
| `txHash` | one of the two | Any transaction of the order: the escrow, the settlement, or the Bitcoin payment |
| `chainId`, `route` | no | As above. `route` defaults to `evm-btc-escrow` |
| `toChainId` | no | Coin to coin only |

```sh
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`.

```sh
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/orders/$ORDER_ID/events"
```

```json
{
  "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.

```sh
curl -sN -H "x-maxy-key: $MAXY_API_KEY" "$BASE/orders/$ORDER_ID/events/stream?chainId=8453"
```

```text
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](https://maxy.co/docs/quote-routes#post-pricesstream-ticket) does, and answers `201`.

```sh
curl -s -X POST -H "x-maxy-key: $MAXY_API_KEY" "$BASE/orders/$ORDER_ID/stream-ticket?chainId=8453"
```

```json
{
  "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.

| Parameter | Meaning |
| --- | --- |
| `from`, `to` | A date or an ISO 8601 time |
| `state`, `wallet`, `externalId`, `externalCustomerId` | Filters |
| `limit` | Up to 100 a page; 1,000 with `format=csv` |
| `cursor` | `nextCursor` of the page before; it is `null` on the last page |
| `format` | `json` (the default) or `csv` |

```sh
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/orders?externalId=inv-1042&limit=2"
```

```json
{
  "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](https://maxy.co/docs/order-states#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.

```sh
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
{ "watching": true, "orderId": "0x53414e44424f580a5f1c09376699fe993c7a6a544b75673b928be0ac6ee1f2ca", "route": "evm-btc-escrow", "sandbox": true }
```

## Errors

| HTTP | `code` | When |
| --- | --- | --- |
| 400 | `invalid_input` | No `orderId` or `txHash`, a malformed id or hash, or a bad date |
| 401 | `auth_required`, `invalid_api_key`, `invalid_ticket` | No key, an unknown key, or a bad stream ticket |
| 403 | `scope_denied` | A publishable key on the events, the list or watch |
| 404 | `not_found` | No order has that id or transaction (a quote never placed); events for an order your key does not track |
| 429 | `rate_limited` | Over your limit |

---
Source: https://maxy.co/docs/status-routes (Maxy Docs › API reference › Routes)
