Sign x402 payment via end user Solana account
Signs an x402 payment payload using the end user’s given Solana account. Accepts the full x402 payment required response body from a resource server plus an index into the accepts array selecting which payment option to sign. The paymentRequired envelope’s x402Version, resource, and extensions are carried through into the signed payment payload; only the selected accept entry becomes paymentPayload.accepted. Returns a signed payment payload that can be base64-encoded and sent in the PAYMENT-SIGNATURE header of the resource request. If acceptsIndex is out of range for paymentRequired.accepts, or the selected accept is not a Solana network payment option, the request fails with 422.
Authorizations
A JWT signed using the developer's own JWT private key (in the case of JWT authentication), or an end user JWT signed by CDP, encoded in base64. This is used for End User Account APIs.
Headers
A JWT signed using your Wallet Secret, encoded in base64. Refer to the Generate Wallet Token section of our Authentication docs for more details on how to generate your Wallet Token.
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 - 128A JWT signed using your Wallet Secret, encoded in base64. Refer to the Generate Wallet Token section of our Authentication docs for more details on how to generate your Wallet Token.
Path Parameters
The ID of the end user.
^[a-zA-Z0-9-]{1,100}$"e051beeb-7163-4527-a5b6-35e301529ff2"
Query Parameters
The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"8e03978e-40d5-43e8-bc93-6894a57f9324"
Body
The complete x402 payment required response body from the resource server. Top-level fields (x402Version, resource, error, extensions) are preserved in the signed payment payload; acceptsIndex selects which entry from accepts is signed as paymentPayload.accepted.
Zero-based index into paymentRequired.accepts selecting which payment option to sign. Must be less than the length of accepts. The entry at this index must be a Solana network payment option for this endpoint.
x >= 00
The base58 encoded address of the end user's Solana account to sign with.
^[1-9A-HJ-NP-Za-km-z]{32,44}$"HpabPRRCFbBKSuJr5PdkVvQc85FyxyTWkFM2obBRSvHT"
Required when not using delegated signing. The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.
^[a-zA-Z0-9-]{1,100}$"e051beeb-7163-4527-a5b6-35e301529ff2"
Response
Successfully signed x402 payment payload.
The signed x402 payment payload. Base64-encode this and send it in the PAYMENT-SIGNATURE header of the resource request.
- x402V2PaymentPayload
- x402V1PaymentPayload