Authorize a payment session with x402
Customer-initiated. Authorizes a payment session using x402. The payer supplies the payment payload, so this call is unauthenticated. The session must be in created status.
The client sends no request body. You may supply the base64-encoded x402-compliant payment payload in the optional PAYMENT-SIGNATURE header.
On authorization, a hold is placed on the payer’s funds. The authorization is returned in pending status and transitions asynchronously to succeeded or failed.
402 Payment Required may be returned when payment must be supplied before authorization can proceed. The 402 response uses the standard CDP Error JSON body and may include a PAYMENT-REQUIRED header (see the 402 response) describing accepted networks, assets, and amounts.
If autoCapture is enabled on the session, a capture is automatically created after a successful authorization.
Headers
An optional merchant-provided internal identifier for this x402 authorization, from the merchant's own system—not visible to the payer. A merchant-provided internal identifier for a resource from the merchant's own system—not visible to the payer. It must not contain personally identifiable information (PII) or payment credentials.
256"merchant-reference-abc123"
A short customer-facing reference code for this x402 authorization, visible to the payer. Equivalent to customerDisplay.referenceCode on JSON authorization requests. Falls back to the session's orderCode when omitted.
A short customer-facing reference for an operation. It must not contain personally identifiable information (PII) or payment credentials.
128"REF-ABC123"
An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our Idempotency docs for more information on using idempotency keys.
1 - 128Path Parameters
Response
Successfully created x402 authorization. The PAYMENT-RESPONSE header is always included on 200 responses.
A hold placed on the payer's funds. Once authorized, the merchant can capture (collect) the funds. Only one authorization is allowed per session.
Optional metadata as key-value pairs. Use this to store additional structured information on a resource, such as customer IDs, order references, or any application-specific data. Up to 10 key/value pairs may be provided. Keys and values are both strings. Keys must be ≤ 40 characters; values must be ≤ 500 characters.
The payer for this authorization. For wallet authorizations, this is the blockchain address that signed the payloads. For Coinbase authorizations, this is the authenticated Coinbase account. This value is also reflected on the parent payment session's source field after a successful authorization.
- Payment Source Wallet
- Payment Source Coinbase