Buys the configured upsell or downsell as its own order, through a fresh payment session, never the original order's. Bound to the order named in the path by its status token; the buyer's contact details are copied from that order rather than asked again.
Idempotency-Key makes the call safe to retry, and accepting more
than once for the same originating order always answers with the
order the first accept created rather than a second charge.
publishableKeyX-Sorai-Key<token>A store's publishable key, spk_….
id*stringThe originating (paid) order.
uuidIdempotency-Key*stringlength <= 255application/jsontoken*stringThe status token returned from checkout for the order this offer was shown on.
selection*stringWhich configured offer the buyer accepted.
"upsell""downsell"The second order and the instrument the buyer must pay with.
application/jsonorder_id*stringuuidorder_number*stringstatus*OrderStatuspending means the order is still being set up and
will move on shortly; the buyer can already pay. Only Sorai moves an
order from one status to another.
"pending""awaiting_payment""paid""fulfilled""expired""cancelled""refunded"currency*string3 <= length <= 3total_minor*integerint64service_fee_minor?integerThe service fee the buyer pays on top of total_minor for the chosen method, before tax. 0 when the shop pays it.
int64payment*status_url*stringThe absolute URL of this order's status endpoint on the API, token
included: {api_base}/v1/public/orders/{id}/status?token=…. The
checkout page polls it directly; it is not a page on the checkout
origin.
uritoken*stringThe signed capability for this order's status endpoint.
curl -X POST 'https://api.sorai.ai/v1/public/orders/497f6eca-6276-4993-bfeb-53cbbbba6f08/offer' \ -H 'Idempotency-Key: string' \ -H 'Content-Type: application/json' \ -d '{ "token": "string", "selection": "upsell"}'{ "order_id": "93101167-9065-4b9c-b98b-5d789a3ed9fe", "order_number": "string", "status": "pending", "currency": "str", "total_minor": 0, "service_fee_minor": 0, "payment": { "method": "string", "status": "pending", "conflict_reason": "product_not_active", "instrument": { "kind": "qr", "qr_string": "string", "bank": "string", "account_number": "string", "account_name": "string", "redirect_url": "http://example.com", "client_secret": "string", "instructions": { "locale": "string", "sections": [ { "title": "string", "steps": [ "string" ] } ] } }, "amount_minor": 0, "expires_at": "2019-08-24T14:15:22Z" }, "status_url": "http://example.com", "token": "string"}