Refunds

Verify a refund transfer against the chain

Did the refund actually happen, and has it settled? Takes the ORIGINAL settlement rather than the prepare token, deliberately: a refund may need reconciling days later - after a crash, or a support ticket - and a fifteen-minute bearer token cannot answer that.

A transaction hash is not a refund. This checks the receipt carries exactly one USDC transfer from the original merchant to the original payer for exactly this amount, matched by event rather than by transaction sender - so a Safe or smart account executing on the merchant's behalf verifies correctly.

post/v1/refunds/verify

Request

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

Request body

intentstring

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.

subscriptionstring

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.

tx_hashstring required

A 32-byte hex value, lowercase. Transaction hashes and references.

period_indexinteger

Recurring only. Refunds are per charge, never per subscription.

refund_amountstring required

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.

refund_tx_hashstring required

A 32-byte hex value, lowercase. Transaction hashes and references.

Example request

{
  "tx_hash": "0x2d6bbc112885a6976289e599f71003f7d310e7152ebd662c6221dffd3e0da708",
  "refund_amount": "2500000",
  "refund_tx_hash": "0x2d6bbc112885a6976289e599f71003f7d310e7152ebd662c6221dffd3e0da708"
}

Response

Settled.

status'REFUNDED'
refund_tx_hashstring

A 32-byte hex value, lowercase. Transaction hashes and references.

refund_amountstring

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.

original_amountstring

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.

payerstring

An EVM address.

merchantstring

An EVM address.

block_numberstring

Example response

{
  "refund_tx_hash": "0x2d6bbc112885a6976289e599f71003f7d310e7152ebd662c6221dffd3e0da708",
  "refund_amount": "2500000",
  "original_amount": "2500000",
  "payer": "0xb4e43f3fBa5Add75395adAD366627E7d74141Fa9",
  "merchant": "0xb4e43f3fBa5Add75395adAD366627E7d74141Fa9"
}

Changes

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