Settle an agent's payment (paywall)
Pass the agent's PAYMENT-SIGNATURE header unread, with the seller's own wallet and price. The API rebuilds the requirement from those - nothing the agent sends decides what is owed or to whom - and settles it through the facilitator. A payment is reported paid ONCE: the same header again is refused with invalid_transaction_state. A settlement still being mined is waited for once; if it is still pending the answer names the transaction and the agent's next request with the same header is paid. Refusals are 200 with paid: false; every settlement carries the P2Flux fee, max(1%, 0.003 USDC). Batch payments (batch-settlement) are verified and counted without a transaction; receipt identifies the paid request and, on refusal, payment_required is the 402 header to answer with - it carries the channel state the agent resynchronises to. Usage pricing: for an upto payment send amount, what the request cost - at least 0.01 and at most price; the fee is taken on amount. An upto payment redeemed without amount is refused (unsupported_scheme). An agent's request to take back its unused prepaid balance answers paid: false, refunded: true with payment_response: answer the agent 200 with that header and no content.
Request
- Base URL: https://api.p2flux.com
- URL: https://api.p2flux.com/x402/paywall/redeem
- Auth: none required
Request body
Example request
{
"recipient": "0xb4e43f3fBa5Add75395adAD366627E7d74141Fa9",
"price": "0.05",
"amount": "0.02"
}Response
Paid, or why not
Changes
No recorded changes to this operation across all 1 revision of this API.