Skip to content
SETSimple Easy Transactions
SET DocsSET Crypto API Suite and SET API referenceCurrent as of 2026-11-21 · wallet release 7d8a79fb
Browse: SET API

SET Crypto API Suite · Cash out to a bank

Cancel an open reference

POST/v1/payment_references/{id}/cancel

Key scope: write · Platform accounts · Success: 200

Cancels an open payment reference and frees its payable amount for a new reference. Canceling an already canceled reference answers it unchanged.

Path parameters

id stringrequired
The reference's id, pref_ and 32 hex characters.

Headers

Idempotency-Key string
Any unique string, so a retry runs once. See Idempotency.

Notes

  • Needs a key with the write scope.
  • 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 canceled answers 409 payment_reference_closed.
  • A repeat on a canceled reference answers 200 with state: "canceled".
  • Event payment_reference.canceled is 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_only
  • 404 payment_reference_unknown
  • 409 payment_reference_closed

All codes: Errors.