Skip to main content
POST
JavaScript

Authorizations

x-api-key
string
header
required

Body

application/json
refId
string
required

The order's reference ID, as returned by Cart Purchase

Pattern: ^[a-zA-Z]{3}-ref_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}$
Example:

"ckp-ref_3fa85f64-5717-4562-b3fc"

reason
string

Why the purchase is being cancelled. Returned as result.reason on the cancelled order and on the order.purchase.cancelled webhook.

Maximum string length: 500
Example:

"The buyer chose to complete the purchase themselves"

Response

The order, now cancelled

refId
string
required
Pattern: ^[a-zA-Z]{3}-ref_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}$
status
enum<string>
required

pending / processing while the purchase runs. It then settles: complete (every item bought), partially_complete (some items bought — see products[].status), failed (nothing bought — see error), or cancelled (stopped by Cart Purchase Cancel before anything was bought). After a failed attempt an order can stay processing for up to an hour before it settles; purchase says what is happening meanwhile.

Available options:
pending,
processing,
complete,
partially_complete,
failed,
cancelled
purchase
object
required

What is happening with the purchase while status is pending / processing: which attempt is running, whether it is a retry, whether the purchase needs action, and why the last attempt failed.

products
object[]
required
details
object
required
result
object
error
object

Why items failed, once the order has settled as failed or partially_complete. Absent while the purchase runs and when every item was bought.