Passer au contenu principal
POST
/
api
/
v1
/
x402
/
sessions
/
{id}
/
pay
Pay with x402 Session
curl --request POST \
  --url https://api.agentwallex.com/api/v1/x402/sessions/{id}/pay \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "target_url": "https://paid-api.example.com/v1/data"
}
'
{
  "ledger_id": "<string>",
  "amount": "<string>",
  "fee_amount": "<string>",
  "fee_rate": "<string>",
  "token": "<string>",
  "chain": "<string>",
  "status": "completed",
  "payment_signature": "<string>"
}

Paramètres de chemin

id
string
requis
ID de la session pour le paiement (par exemple, sess_xyz789).

Corps de la requête

target_url
string
requis
L’URL compatible x402 à payer.

Exemple

curl -X POST https://api.agentwallex.com/api/v1/x402/sessions/sess_xyz789/pay \
  -H "X-API-Key: awx_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "target_url": "https://paid-api.example.com/v1/data"
  }'

Autorisations

X-API-Key
string
header
requis

API key authentication. Keys are prefixed with awx_.

Paramètres de chemin

id
string
requis

The session ID to pay from (e.g., sess_xyz789).

Corps

application/json
target_url
string<uri>
requis

The x402-enabled URL to pay for.

Réponse

Session payment completed successfully.

Result of an x402 payment negotiation.

ledger_id
string

Internal ledger entry ID for this payment.

amount
string

Payment amount.

fee_amount
string

Platform fee deducted.

fee_rate
string

Fee percentage applied (based on tiered pricing).

token
string

Token used for payment (e.g., USDC).

chain
string

Chain used for settlement.

status
enum<string>

Payment status.

Options disponibles:
completed,
pending,
failed
payment_signature
string

The PAYMENT-SIGNATURE value to include in the retry request to the target URL.