instant, key and manual variants. Only the waiting time differs.
1
Buy
POST /products/purchase/{variantId} with quantity and any input_fields. Save the returned order_ids in your database before doing anything else.2
Poll
POST /products/orders/retrieve with your saved IDs. Orders in processing are not done yet.3
Deliver
When
has_key is true, send key to your customer and mark the order done. If the status is failed, refunded or canceled, the amount is back in your wallet: tell the customer and refund them on your side.Example (Node.js)
Good habits
- Never retry a purchase blindly. If the request timed out, look at
GET /ordersfirst to see whether it went through. - Stop polling a manual order after your own deadline and check again later. Manual orders can take a while.
- Log the order ID next to your own order reference so support can find it quickly.