Refunds

Read a refund token back (browser)

The terms behind a prepare token, for the browser holding it. Reading is all it does - the token is already signed, so nothing here can change where a refund goes.

Consumed by the hosted checkout, not usually by a server integration: the merchant page must not be able to tell the checkout who the recipient is, or a shop that could name it could redirect a refund.

post/v1/refunds/resolve

Request

  • Base URL: https://api.p2flux.com
  • URL: https://api.p2flux.com/v1/refunds/resolve
  • Auth: none required

Request body

refund_tokenstring required

A signed P2Flux capability: payment intent (p2f1.), setup token (p2setup2.), subscription capability (p2s2.), cancel token (p2cancel1.) or refund token (p2refund1.). Opaque to the caller and unforgeable - the signature is what authorises the call. Treat it as a bearer secret: keep it server-side, never in a URL query or a log.

Response

Exactly what P2Flux signed.

chain_idinteger
tokenstring

An EVM address.

merchantstring

An EVM address.

payerstring

An EVM address.

amountstring

A USDC amount as a decimal string, up to 6 decimal places. Never a JSON number: binary floating point cannot represent most decimal prices exactly, and this is money.

amount_unitsstring

An integer count of micro-USDC (6 decimals), as a string. 2500000 is 2.50 USDC. Used wherever a decimal would invite a rounding error - notably refund amounts.

expires_atinteger

Example response

{
  "token": "0xb4e43f3fBa5Add75395adAD366627E7d74141Fa9",
  "merchant": "0xb4e43f3fBa5Add75395adAD366627E7d74141Fa9",
  "payer": "0xb4e43f3fBa5Add75395adAD366627E7d74141Fa9",
  "amount": "10.00",
  "amount_units": "2500000",
  "original": {
    "tx_hash": "0x2d6bbc112885a6976289e599f71003f7d310e7152ebd662c6221dffd3e0da708",
    "contract": "0xb4e43f3fBa5Add75395adAD366627E7d74141Fa9",
    "reference": "0x2d6bbc112885a6976289e599f71003f7d310e7152ebd662c6221dffd3e0da708",
    "amount_units": "2500000",
    "subscription_id": "0x2d6bbc112885a6976289e599f71003f7d310e7152ebd662c6221dffd3e0da708"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.