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

The 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

StatusMeaning
400The purchase can't be canceled, for example because it's no longer reserved.
401The API key is missing or invalid.
403The request is forbidden for your account.
404No purchase has this ID.

On this page

POST/v2/purchases/{id}/cancel

Run this request against the sandbox with your test key.

Open in API reference