One-time payments

Verify a payment against the chain

The trust boundary. The browser saying it paid is a claim; this makes it a fact by re-reading the receipt and checking every field against the signed intent. Never grant access on a browser message alone.

A rejected payment is HTTP 200 with valid: false and a code, not an error status - so check valid explicitly.

PAYMENT_CONFIRMING means the customer has probably paid. The transaction is on chain and not yet settled to the required depth. Poll the same hash; never ask for a second payment.

Expiry does not apply here. An intent whose expires_at has passed still verifies: expiry stops a payment being started, not one that already happened. An integration that discards expired intents loses the ability to verify - or refund - a real payment, permanently.

post/v1/payments/verify

Request

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

Request body

intentstring 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.

tx_hashstring required

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

settlement_receiptstring

Optional. The sealed settlement receipt a previous CONFIRMED verify of this same payment returned. Presenting a valid one answers immediately without re-reading the chain; presenting a missing, expired, malformed or mismatched one silently falls back to the full verification. It is only ever honoured together with the exact intent and tx_hash it was issued for.

Example request

{
  "tx_hash": "0x2d6bbc112885a6976289e599f71003f7d310e7152ebd662c6221dffd3e0da708"
}

Response

A verdict. valid: true settles the order; valid: false carries the reason.

OR

Example response

{
  "tx_hash": "0x2d6bbc112885a6976289e599f71003f7d310e7152ebd662c6221dffd3e0da708",
  "reference": "0x2d6bbc112885a6976289e599f71003f7d310e7152ebd662c6221dffd3e0da708",
  "amount": "10.00",
  "block_hash": "0x2d6bbc112885a6976289e599f71003f7d310e7152ebd662c6221dffd3e0da708"
}

Changes

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