authorize_x402_ap2
Paid pre-payment trust gate. Use after create_ap2_challenge and after receiving the merchant's real x402 PAYMENT-REQUIRED challenge, but before paying the merchant. Verifies AP2 v0.2 authority and binds approval to the exact merchant challenge and HTTP request. On approval returns authorization_token; next pay the merchant, then call verify_settlement. Machine price: $0.001 via x402. If authorization is denied, the Trust fee is not settled/charged.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"payment_required": "<payment_required>",
"merchant_id": "<merchant_id>",
"category": "<category>",
"payer": "<payer>",
"request": "<request>",
"ap2_authority": "<ap2_authority>"
},
"name": "authorize_x402_ap2"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nonce | No | Optional caller nonce for correlation; do not reuse across distinct purchase attempts. | |
| payer | Yes | Base payer wallet address that will authorize the merchant x402 payment. | |
| request | Yes | Exact HTTP request the agent intends to execute after approval; changing it invalidates the authorization binding. | |
| category | Yes | Service/purchase category evaluated against the AP2 mandate constraints, for example ai-infrastructure. | |
| merchant_id | Yes | Stable identifier for the merchant/resource being authorized. | |
| ap2_authority | Yes | AP2 authority proof for this exact purchase attempt. | |
| payment_required | Yes | Merchant's real x402 PAYMENT-REQUIRED payload, either as the decoded object or the original encoded/string form. |