Orders

Fetch one order by id. Orders are tenant-isolated: another tenant's id (or an unknown/malformed id) returns 404 — never leaking its existence.

Reading an awaiting_payment order also looks for its payment on chain, so a payment that has landed shows as paid without waiting for the background scan. If that look fails, you get the stored order rather than an error. See OrderStatus for what each status means and which ones are final.

get/v1/orders/{id}

Request

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

Path parameters

idstring uuid required

The order id (UUID, also used as the on-chain payment memo).

Response

The order.

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

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.

type'stars' | 'premium' required
recipient_usernamestring required
quantityinteger nullable
monthsinteger nullable
amount_tonstring nullable

The order's price in GRAM (decimal string), fixed at creation; null when unknown. It is the amount due only on a ton order. A usdt_ton order is paid in USDT — read payment.amount (in payment.asset) there; this GRAM figure is not what you send. The field name amount_ton is frozen for wire compatibility.

payment_currency'ton' | 'usdt_ton' required

The asset the order is paid in. ton = the native coin GRAM (ex TON), sent as a plain transfer — it is not USDT on TON. usdt_ton = USDT (TON), sent as a jetton transfer. Required on every create and pricing request: a request without it is rejected with 400 bad_request.

payment_txstring nullable
purchase_txstring nullable
failure_reasonstring nullable

Why the order ended where it did, or where it is stuck. Null otherwise.

TERMINAL — underpaid / overpaid / wrong_currency (→ failed, your funds reversed to you), undeliverable (→ reversed, your funds reversed to you — the goods could not be delivered, so you have your money back), or expired (no payment arrived within the window). A payment that still arrives once the order reads expired is reversed to the sender (unless it is below the dust threshold); the order stays expired and reversal_tx carries the reference of the first such reversal.

no_memo / wrong_memo: no longer set. A payment with a missing or unrecognised memo names no order, so it is reversed to its sender and no order changes because of it; an order is never matched to it by amount. Orders failed earlier may still carry these values.

wrong_currency: the payment named this order but arrived in the other asset than payment_currency — for example USDT sent to a ton order. It is not converted: it is reversed to the sender in the asset received (reference in reversal_tx). The order is normally marked failed with wrong_currency once the payment has been returned. If that step cannot complete, the order expires and the payment is still returned (reference in the expired order's reversal_tx).

IN PROGRESS, on a held order — the order has not finished and no action is needed from you unless a value says otherwise:

fulfilment_retrying: delivery did not succeed on the first attempt and we are still working on it.

recipient_unreachable: the recipient could not be reached, and we are retrying. This is the one worth checking on your side — confirm the username is right and can receive the item.

reversal_pending: the goods could not be delivered and we are still returning your funds; the order reaches reversed when that lands.

reversal_unsettled: the return could NOT be delivered to you (your address kept refusing it), so you do NOT have your money back and a person is settling it by hand.

Note the direction on the last one: undeliverable is about the GOODS and ends with you made whole; reversal_unsettled is about the RETURN and does not. See Reversals & delivery.

reversal_txstring nullable

The reference (transaction hash) of a reversal that returned a payment for this order to its sender; null while there is none, or when a reversal was confirmed without a reference we can show (contact support); never a placeholder (since 2.1.3). On a failed or reversed order it is the reversal of your payment. On an expired or cancelled order it is the first payment that arrived after the order closed and was returned to its sender (cancelled since 2.1.3); the status does not change and no webhook is sent for it. See Reversals & delivery.

telegram_messagestring nullable

Fragment's verbatim text of the last refusal it gave for this order, present only on failed or reversed orders; null when Fragment never refused it (since 2.3.0). For example "You can buy a minimum of 12,500 stars". null on every other status. It is the same text as the order webhook telegram_message.

created_atstring date-time
updated_atstring date-time
expires_atstring date-time nullable

Non-null only while awaiting_payment.

Example response

{
  "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