# Retrieve an order

`GET /api/orders/{id}` · Optional key

The order in the same shape as when it was created; each call while it's open also checks the chain.

While an order is open, each call also checks the chain for its payment and delivery (at most once every 3 seconds per order), so polling every 2 to 3 seconds sees progress within seconds. Orders nobody polls are processed by a background job.

Watch `stage` for progress and `status` for detail, both in the [order lifecycle](https://feebolt.com/developers/order-lifecycle/). `payments` lists every transfer into the deposit address with how it was matched (`kind`: `counted`, `extra` or `foreign`), and `refunds` every amount sent back.

## Request

Base URL: `https://feebolt.com`. Works without a key (per-IP limits). With an API key the limits are per key and higher.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The order id: `ord_` and 8 to 32 lowercase letters or digits. |

## Examples

```bash
# Optional: add -H "Authorization: Bearer $FEEBOLT_API_KEY" for per-key limits
curl https://feebolt.com/api/orders/ord_3k9x2m7q1v8b4n6c0z5w
```

```js
const res = await fetch("https://feebolt.com/api/orders/ord_3k9x2m7q1v8b4n6c0z5w", {
  headers: {
    // optional: Authorization: `Bearer ${process.env.FEEBOLT_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(data.message);
```

```python
import requests

r = requests.get(
    "https://feebolt.com/api/orders/ord_3k9x2m7q1v8b4n6c0z5w",
)
r.raise_for_status()
data = r.json()
```

## Response: 200 OK

The order.

```json
{
  "id": "ord_3k9x2m7q1v8b4n6c0z5w",
  "status": "delivered",
  "stage": "ready",
  "address": "TKHuVq1oKVruCGLvqVexFs6dawKv6fQgFs",
  "packageId": "1tx",
  "energy": 64285,
  "durationSec": 3600,
  "currency": "TRX",
  "amount": "1.82",
  "payTo": "TSeJkUh4Qv67VNFwY8LaAxERygNdy6NQZK",
  "uri": "tron:TSeJkUh4Qv67VNFwY8LaAxERygNdy6NQZK?amount=1.82",
  "quote": {
    "packageId": "1tx",
    "priceTrx": 1.82,
    "…": "as in the quote"
  },
  "createdAt": 1795895286725,
  "expiresAt": 1795896186725,
  "paidAt": 1795895327725,
  "deliveredAt": 1795895332725,
  "failReason": null,
  "payments": [
    {
      "txId": "9c1e…a47f",
      "currency": "TRX",
      "amount": "1.82",
      "from": "TKHuVq1oKVruCGLvqVexFs6dawKv6fQgFs",
      "at": 1795895325725,
      "kind": "counted"
    }
  ],
  "delivery": {
    "status": "delivered",
    "txId": "5b02…e19c",
    "energy": 64285
  },
  "refunds": []
}
```

## Errors

| HTTP | error | When |
| --- | --- | --- |
| 404 | `not_found` | No order (or transaction) with that id. |
| 429 | `rate_limited` | Too many calls (per IP, or per key with a key). Wait for Retry-After seconds. |

## Rate limits

- Without a key: 120 at once, then 1 per second, per IP.
- With an API key: 600 at once, then 5 per second, per key.

---

HTML: https://feebolt.com/developers/retrieve-order/ · OpenAPI: https://feebolt.com/developers/openapi.json · All docs as one Markdown file: https://feebolt.com/developers/full.md
