跳轉到主要內容
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>"
}

路徑參數

id
string
必填
用於支付的工作階段 ID(例如 sess_xyz789)。

請求內容

target_url
string
必填
要支付的 x402 啟用 URL。

範例

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"
  }'

授權

X-API-Key
string
header
必填

API key authentication. Keys are prefixed with awx_.

路徑參數

id
string
必填

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

主體

application/json
target_url
string<uri>
必填

The x402-enabled URL to pay for.

回應

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.

可用選項:
completed,
pending,
failed
payment_signature
string

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