Pre-order delivery hours
Set, change or clear the hours a waiting pre-order may be delivered in.
/api/v1/preorder/hoursPre-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.
This works on any of your own pre-orders while it is still waiting, placed through the API or on the website. It needs a full key, and the order must have been bought by the key's account (and, if it was paid from a balance, from this account's balance). Send a JSON body; the answer is always JSON.
curl -X POST "https://www.nfa.pub/api/v1/preorder/hours" \ -H "X-Api-Key: rsk_..." \ -H "Content-Type: application/json" \ -d '{"order":"4b53000e7b4677d2-c69a8e94132d75e8","from":"09:00","to":"23:00","tz":"Europe/Berlin"}'Body
| Field | Description |
|---|---|
orderrequired | The order_id from the buy (or the order id from /orders). order_id also works. |
from | Start of the hours, HH:MM (24-hour). Send with to and tz. |
to | End of the hours, HH:MM. At least 2 hours after from and not the same time; it may run past midnight. |
tz | An IANA time zone, such as Europe/Berlin. |
clear | true removes the hours, so it is delivered any time. Send it instead of from, to and tz. |
Response
{ "ok": true, "order_id": "4b53000e7b4677d2-c69a8e94132d75e8", "state": "preorder", "deliveryWindow": { "from": "09:00", "to": "23:00", "timezone": "Europe/Berlin" }}After clear, deliveryWindow is null. New hours apply from the next run of the pre-order queue. Outside them the order keeps its place and is filled as soon as they open.
Errors
| Code | HTTP | Meaning |
|---|---|---|
E1001 | 401 | The key is missing, malformed, revoked or unknown. |
E1002 | 429 | Too many requests. Wait for the minute to roll over and retry. See Rate limits. |
E1101 | 400 | No JSON body, no order, or fields that do not fit together. |
E1105 | 400 | The hours are not valid: wrong format, under 2 hours, start equal to end, or not a real time zone. Nothing changed. |
E1602 | 404 | No order with that id. |
E1603 | 403 | That order was not bought by this key's account, or it was paid from another account's balance. |
E1622 | 409 | That order is not a pre-order. |
E1623 | 409 | That pre-order is not waiting any more: it is being delivered, or it was delivered, cancelled or refunded. Nothing changed. |
E1701 | 403 | This 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. |
E1702 | 403 | The request came from an IP that is not on your allowlist. |
E1000 | 500 | Something 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.