Payment Flow
The facilitator enables seamless payment processing through a well-defined sequence of interactions between the client, resource server, and facilitator.Client Requests Resource
A client makes a request to a protected API endpoint without a payment header.
Resource Server Calls /accepts
The resource server middleware calls the facilitator’s
/accepts endpoint with the payment requirements for the requested resource (network, token, amount, recipient).The facilitator enriches these requirements with the blockchain-specific details the client needs to construct a valid payment.Server Returns 402 Payment Required
The resource server returns a 402 status with the enriched payment requirements in the response body.
Client Prepares Payment
The client uses the enriched requirements to create a payment proof — a signed authorization that allows the facilitator to settle the payment on-chain.
Resource Server Calls /settle
The middleware calls the facilitator’s
/settle endpoint with the client’s payment proof and the original requirements.The facilitator validates the proof and executes the on-chain transaction, sponsoring any required gas or transaction fees.Facilitator Returns Transaction Hash
On success, the facilitator returns a transaction hash confirming the payment was settled on-chain.
Sequence Diagram
Key Interactions
Resource Server
The resource server makes two API calls to the facilitator:- POST /accepts — Retrieves enriched payment requirements before returning 402 to the client
- POST /settle — Validates and executes payment after receiving the client’s payment proof