PAYMENT-SIGNATURE header. Use it for machine-to-machine payments and API monetization.
You create the payment session and give its x402Url to the agent. The agent gets the payment requirements and submits a signed payment. You track the authorization until it succeeds or fails.
1. Create a payment session
Create a payment session with a wallet target. The response includes anx402Url, which is the session’s POST .../payment-sessions/{id}/authorizations/x402 endpoint. Give this URL to an x402-enabled agent. The agent gets the payment requirements and submits the payment. The examples below use $X402_URL for this URL.
2. Get the payment requirements
The agent sends the request without aPAYMENT-SIGNATURE header. The response is 402 Payment Required:
PAYMENT-REQUIRED header lists the accepted networks, assets, amounts, and payment addresses.
3. Submit the payment
The agent signs a payment that meets one of the requirements, then retries the request with the base64-encoded payload in thePAYMENT-SIGNATURE header:
PAYMENT-SIGNATURE also returns 402 Payment Required.
4. Track the authorization
The agent receives200 with a PAYMENT-RESPONSE header and the authorization, which starts as pending:
succeeded or failed. You track it with webhooks or by fetching the payment session with your API key. Don’t rely on the agent’s copy of the response.
What to read next
Payment Sessions
Session lifecycle, authorization outcomes, and idempotency
x402 with Payment Acceptance
How x402 agents use Payment Acceptance sessions
Webhooks
Get notified when authorization succeeds or fails