SET Crypto API Suite · Cash out to a bank
Cancel an open reference
POST/v1/payment_references/{id}/cancel
Cancels an open payment reference and frees its payable amount for a new reference. Canceling an already canceled reference answers it unchanged.
Path parameters
idstringrequired- The reference's id,
pref_and 32 hex characters.
Headers
Idempotency-Keystring- Any unique string, so a retry runs once. See Idempotency.
Notes
- Needs a key with the
writescope. - Payment references are for platform accounts: a business (merchant) account's key gets 403
payment_references_platform_only. - No body is needed.
- Only an open reference can be canceled; any other state except
canceledanswers 409payment_reference_closed. - A repeat on a canceled reference answers 200 with
state: "canceled". - Event
payment_reference.canceledis written. - Canceling does not stop money: a payment that still arrives at the address is paid to the customer's bank as any other; it just settles no reference.
- The example was made with a sandbox key.
- This example is a recorded run of SET's own code (wallet release
e9b03447) with a sandbox key; ids and times are that run's.
Errors
403 payment_references_platform_only404 payment_reference_unknown409 payment_reference_closed