1
Client Requests Resource
A client makes a request to a protected API endpoint without a payment header.
2
Resource Server Calls /accepts
The resource server middleware calls the facilitator’s
/accepts endpoint with partial payment requirements:- Scheme (e.g.,
exact) - Network (e.g.,
solana-devnet,base-sepolia) - Asset (token mint/contract address)
- Amount, recipient, resource URL
- Solana: Fee payer address, token decimals, recent blockhash
- EVM: EIP-712 domain parameters (name, version, chainId, verifyingContract)
3
Server Returns 402 Payment Required
The resource server returns a 402 status with the enriched payment requirements in the response body.
4
Client Prepares Payment
The client creates a payment proof based on the requirements:
- Solana: Creates and partially signs a transaction that transfers tokens to the merchant
- EVM: Signs an EIP-3009 authorization using EIP-712 typed data
5
Client Retries with Payment Header
The client retries the request with an
X-PAYMENT header containing the base64-encoded payment payload.6
Resource Server Calls /settle
The middleware calls the facilitator’s
/settle endpoint with:- The payment header from the client
- The original payment requirements
- Solana: Verifies the transaction, co-signs as fee payer, submits to blockchain
- EVM: Verifies the authorization signature, calls the token contract, pays gas
7
Facilitator Returns Transaction Hash
On success, the facilitator returns:
success: truetxHash: The blockchain transaction hashnetworkId: The network identifier
8
Resource Delivered
The resource server allows the request through and returns the protected resource to the client.