Skip to main content
POST
/
api
/
v1
/
wallets
/
{wallet_uuid}
/
payment
Create payment
import requests

url = "https://api.example.com/api/v1/wallets/{wallet_uuid}/payment"

payload = {
    "protocol": "x402",
    "request_id": "<string>",
    "x402_payment_required": "<string>",
    "mpp_www_authenticate": "<string>",
    "mpp_session": {
        "action": "open",
        "salt": "<string>",
        "deposit": "<string>",
        "channel_id": "<string>",
        "cumulative_amount": "<string>",
        "payer_address": "<string>",
        "challenge_cache": {
            "id": "<string>",
            "realm": "<string>",
            "method": "<string>",
            "intent": "<string>",
            "request": {},
            "request_b64": "<string>",
            "expires": "",
            "description": ""
        }
    }
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "result": {
    "protocol": "x402",
    "status": "<string>",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "idempotent": false,
    "request_id": "<string>",
    "retry_headers": {},
    "mpp_session_info": {
      "payer_address": "<string>",
      "chain_id": "<string>",
      "channel_id": "<string>"
    },
    "tx_hash": "<string>"
  },
  "success": true,
  "suggestion": "",
  "message": "",
  "meta": {
    "total": 123,
    "offset": 123,
    "limit": 123,
    "has_more": true,
    "after": "<string>",
    "before": "<string>"
  }
}

Headers

X-API-Key
string | null

Path Parameters

wallet_uuid
string<uuid>
required

UUID of the wallet to sign and submit the payment from. Obtain this value from the wallet creation or list-wallets response. The wallet must be active (not archived).

Body

application/json

Unified payment request.

Protocol-specific fields are prefixed with protocol name (x402_ / mpp_).

protocol
enum<string>
required

Payment protocol: 'x402' or 'mpp'

Available options:
x402,
mpp
request_id
string | null

Idempotency key

Maximum string length: 255
x402_payment_required
string | null

Base64-encoded JSON from Payment-Required header

mpp_www_authenticate
string | null

WWW-Authenticate header raw value

mpp_session
MppSessionParams · object

Session parameters for MPP session actions (open/voucher/close)

Response

Successful Response

result
PaymentResult · object
required

Unified payment result.

CLI uses retry_headers to retry the original request.

success
boolean
default:true
suggestion
string
default:""
message
string
default:""
meta
PaginationMeta · object

Pagination metadata for list responses.

Supports both legacy offset-based and cursor-based pagination. Cursor fields (has_more, after, before) are populated for cursor-paginated endpoints. Legacy fields (offset, limit) are populated when the caller uses the deprecated offset parameter.