Orders

List your orders

Changed on

Tenant-scoped list, newest first, keyset-paginated. Pass the returned next_cursor back as ?cursor= to page; a null next_cursor is the last page. The cursor does not remember your filter: send the same status on every page, or the next page is unfiltered.

Direct orders only. The orders a campaign creates for its recipients are not listed here; read them through the campaign (GET /v1/campaigns/{id}/recipients). GET /v1/orders/{id} still returns one by its id.

This list is metered by your general per-minute budget, not by the order-lifecycle bucket.

get/v1/orders

Request

  • Base URL
    https://api.mystars.tg
  • Auth
    API key in header X-Api-Key

Query parameters

status'received' | 'awaiting_payment' | 'paid' | 'reserved' | 'swapping' | 'funding' | 'purchasing' | 'fulfilling' | 'completed' | 'delivered' | 'failed' | 'reversed' | 'expired' | 'held' | 'cancelled'

Lifecycle status. A new order starts in awaiting_payment. The normal path is awaiting_payment → paid → reserved → funding → purchasing → delivered.

Terminal (nothing moves the order on; stop polling). The callback named on each goes to the order's callback_url, when you set one:

  • delivered — the item was delivered to the recipient. Callback order.delivered.
  • completed — the same as delivered, on older orders. No callback.
  • reversed — the item could not be delivered and your payment was reversed to you (failure_reason: undeliverable). Callback order.reversed.
  • failed — the payment named this order but could not be applied: an amount outside the tolerance, or the other asset; it is reversed to the sender. Only an awaiting_payment order can end here. Callback order.failed.
  • expired — no payment arrived before expires_at. Callback order.expired.
  • cancelled — you cancelled it with POST /v1/orders/{id}/cancel while it was awaiting_payment. No callback: the cancel answer is the confirmation.

In progress (no action needed; keep polling or wait for the callback):

  • awaiting_payment — waiting for your payment, until expires_at. The only cancellable status.
  • paid — the payment was matched; delivery is about to start.
  • reserved, funding, purchasing — delivery steps. An order may step back to paid or an earlier step and run again; that is a retry, not a failure.
  • held — delivery or a reversal is being retried, or is under manual review; failure_reason says which. Do not re-create the order. It ends delivered or reversed.
  • received, swapping, fulfilling — kept for older orders; no new order enters them.

Branch on the terminal set above, and treat any status you do not recognise as in progress.

Filter by exact order status. An unknown value is 400. delivered does not include the older completed orders.

limitinteger

Page size, plain decimal digits. A value above 100 is served as 100.

cursorstring

Opaque cursor from a previous page's next_cursor, passed back unchanged. A malformed one is 400.

Response

A page of orders.

next_cursorstring nullable required

Pass back as ?cursor=; null on the last page.

Example response

{
  "orders": [
    {
      "payment": {
        "chain": "ton",
        "amount": "5.757",
        "amount_smallest_unit": "5757000000",
        "fee": {
          "subtotal": "13.18",
          "processing_fee": "0.92",
          "total": "14.1",
          "description": "1% swap + 0.5 GRAM gas",
          "kind": "swap"
        }
      }
    }
  ]
}

Changes

    • warning

      added the new antibot_enforce_unavailable enum value to the error/code response property for the response status

    • warning

      added the new antibot_enforce_unavailable enum value to the error/code response property for the response status

    • warning

      added the new antibot_enforce_unavailable enum value to the error/code response property for the response status

    124 more changes in this revision