Cancel a pre-order

Stop waiting and get the money for a pre-order back on your balance.

POST/api/v1/preorder/cancel

Pre-orders are charged now, filled oldest-first when stock returns, only inside your delivery hours if you set them; cancel any time before it's filled for a full refund to your balance.

Cancel any of your own pre-orders while it is still waiting, placed through the API or on the website. What has not been delivered goes back to the balance it was paid from, in full, at once. It is the same cancel as the button on the website's order page.

It needs a full key. Ownership is checked as on /order, and an order paid from a balance must have been paid from this key's account, since that is where the refund goes. Send a JSON body; the answer is always JSON.

Request
curl -X POST "https://www.nfa.pub/api/v1/preorder/cancel" \  -H "X-Api-Key: rsk_..." \  -H "Content-Type: application/json" \  -d '{"order":"4b53000e7b4677d2-c69a8e94132d75e8"}'

Body

FieldDescription
orderrequiredThe order_id from the buy. order_id also works.

Response

Response
{  "ok": true,  "order_id": "4b53000e7b4677d2-c69a8e94132d75e8",  "state": "refunded",  "refunded_eur": 0.9}
  • refunded_eur is what went back to your balance. Nothing delivered: the whole price. Partly filled: you keep the accounts you have, the rest is refunded and state is partial.
  • A pre-order is refunded once. A second cancel, or a retry after a timeout, gets E1623 and moves no money, so retrying is safe.
  • It cannot be cancelled in the moment it is being delivered (E1623). Try again a few seconds later.
  • You also get an order.refunded webhook, with refundedCents.

Errors

CodeHTTPMeaning
E1001401The key is missing, malformed, revoked or unknown.
E1002429Too many requests. Wait for the minute to roll over and retry. See Rate limits.
E1101400No JSON body, no order, or fields that do not fit together.
E1602404No order with that id.
E1603403That order was not bought by this key's account, or it was paid from another account's balance.
E1622409That order is not a pre-order.
E1623409That pre-order is not waiting any more: it is being delivered, or it was delivered, cancelled or refunded. Nothing changed.
E1701403This key is read-only. It can look things up, but not buy, replace, change or cancel a pre-order, export logins with include=accounts or change webhooks.
E1702403The request came from an IP that is not on your allowlist.
E1624500The pre-order is cancelled, but the refund needs a person. We credit it by hand. Do not retry.
E1000500Something went wrong on our side. Retry, and contact support if it keeps happening.

Rate limits: 60 requests a minute per IP address, and 20 a minute per account across both pre-order endpoints.

Cancel a pre-order (POST /preorder/cancel) · API reference · nfa.pub