Pay: invoices

Cancel a waiting invoice

POST/v1/invoices/{id}/cancel

Only a waiting invoice without any counted payment can be canceled (409 invoice_not_cancelable). A payment received afterwards is treated as paid_late.

Authentication
API key (Authorization: Bearer)
Required scope
pay:write
  • Safe to retry with the Idempotency-Key header: see Idempotency.

Path parameters#

  • idstring · uuidrequired

Headers#

  • Idempotency-Keystringrequired

    Required on every Pay POST; makes it safe to retry for 24 hours. Scoped to the key's environment.

    1 to 255 characters

Responses#

200Canceled invoice.
Object fields
  • idstring · uuid
  • objectstring
    Values invoice
  • statusstring
    Values waiting confirming paid underpaid overpaid expired paid_late canceled held
  • environmentstring
    Values test live
  • external_refstringnullable
  • variantstring
    Values A B
  • chain_idintegernullable

    Chain of the payment (set at creation when one chain is offered).

  • tokenstringnullable
  • decimalsintegernullable
  • amount_dueany
  • amount_receivedany
  • amount_pendingany
  • differencestringnullable

    Signed difference to the amount due, native units.

  • priceobjectnullable
    Object fields
    • currencystring
    • price_e6string
    • fx_rate_e6string

      Units of the currency for 1 USDT, in millionths, frozen at creation.

    • fx_sourcestring
    • fx_as_ofstring · date-time
  • chainsarray of object
    Fields of each item
    • amountstring

      Native units, e.g. 12500000 for 12.5 USDT with 6 decimals.

    • amount_formattedstring
    • decimalsinteger
    • chain_idinteger
    • tokenstring
    • deposit_addressstring

      Base58 T… on TRON.

    • payment_uristringnullable

      EIP-681 URI for a QR code (EVM chains).

  • expires_atstring · date-time
  • paid_atstring · date-timenullable
  • created_atstring · date-time
  • metadataobject
4xx · 5xxError.

Standard error format: see Errors.