Pay: refunds

Prepare a refund

POST/v1/refunds

Returns the token transfer the merchant signs and sends from their own wallet; Aicscan never moves funds. to_address is the address provided by the payer, on the invoice chain: the sender address of a payment is never offered by default (it is often an exchange hot wallet). Warnings: origin_address (the address sent a payment of this invoice), exchange_address (labelled as an exchange). The amount is capped at the amount received minus refunds already prepared (refund_exceeds_received). The platform fee is not refunded.

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

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

Request body#

  • invoice_idstring · uuidrequired
  • to_addressstringrequired

    Refund address provided by the payer (0x…, or T… on TRON).

  • amountstringrequired

    Native units of the invoice token.

Responses#

201Refund prepared, with the transaction to sign.
Object fields
  • amountstring

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

  • amount_formattedstring
  • decimalsinteger
  • idstring · uuid
  • objectstring
    Values refund
  • environmentstring
    Values test live
  • invoice_idstring · uuidnullable
  • chain_idinteger
  • tokenstringnullable
  • to_addressstring
  • statusstring
    Values prepared pending succeeded failed canceled
  • tx_hashstringnullable
  • warningsarray of string
    Values origin_address exchange_address
  • created_atstring · date-time
  • updated_atstring · date-time
  • exchange_labelstringnullable
  • noticestring
  • transactionobject

    ERC-20 / TRC-20 transfer(to, amount) to sign from the merchant's wallet.

    Object fields
    • chain_idinteger
    • tostring

      Token contract.

    • valuestring
      Values 0
    • datastring

      Calldata, 0xa9059cbb….

    • function_selectorstring

      TRON only (TronWeb triggerSmartContract).

    • parameterstring

      TRON only: ABI-encoded parameters, hex without selector.

4xx · 5xxError.

Standard error format: see Errors.