Cancel a purchase
Cancel a purchase while it's still reserved, within 14 days of making it.
Cancels a purchase made through the API. A purchase can only be canceled while its state is reserved, which lasts 14 days, until cancellable_until. After that, it moves to confirmed and goes into the batch settlement, and the API can no longer cancel it.
Request
POST /v2/purchases/{id}/cancel
idstringrequiredThe purchase ID.
POST /v2/purchases/{id}/cancel in the API referenceThe request has no body.
curl --request POST "https://api.sandbox.squake.earth/v2/purchases/purchase_sd234asdfl23/cancel" \
--header "Authorization: Bearer $SQUAKE_API_KEY"Response
The response is the purchase, in the same shape as Create a purchase. A canceled purchase has the state canceled, which is final.
Errors
| Status | Meaning |
|---|---|
400 | The purchase can't be canceled, for example because it's no longer reserved. |
401 | The API key is missing or invalid. |
403 | The request is forbidden for your account. |
404 | No purchase has this ID. |
Related
- Purchase states
- Cancel a Purchase in the API reference