API referenceCheckout sessions
Cancel a checkout session
POST methodhttps://api.anyshop.io/v1/checkout_sessions/{id}/cancel
The payment waiting on the buyer is cancelled and the keys go back to stock. A paid session cannot be cancelled: refund its order. A bank debit already on its way cannot be stopped: if it clears after all, the order is paid late, the session turns paid and order.paid arrives (the buyer gets fresh keys, or waits for stock).
Path parameters
idstring required
Headers
Idempotency-Keystring Up to 255 characters. A retry with the same key and request gets the first answer, without running twice (24 hours).
Returns
The checkout_session object.
Errors
Status and error.type400invalid_requestThe request is not valid;error.paramnames the field401authenticationNo API key, or it is not valid403permissionThe key does not have the scope this needs, or the store is suspended (store_suspended)404not_foundNot found in the key's store and mode409conflictConflicts with the object's state (type conflict), or an Idempotency-Key reused for another request (type idempotency, code idempotency_key_reused)429rate_limitedToo many requests; see Retry-After