Skip to main content
POST
/
api
/
v1
/
x402
/
verify
Verify x402 payment authorization
curl --request POST \
  --url https://api.paratro.com/api/v1/x402/verify \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "x402Version": 1,
  "paymentPayload": {
    "scheme": "exact",
    "network": "base-sepolia",
    "payload": {
      "signature": "0xabc123...",
      "authorization": {
        "from": "0xaaaa...",
        "to": "0xbbbb...",
        "value": "1500000",
        "validAfter": "0",
        "validBefore": "1774601102",
        "nonce": "0xdef456..."
      }
    }
  },
  "paymentRequirements": {
    "scheme": "exact",
    "network": "base-sepolia",
    "maxAmountRequired": "1500000",
    "resource": "https://example.com/api/resource",
    "description": "API access",
    "mimeType": "application/json",
    "payTo": "0xbbbb...",
    "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
    "maxTimeoutSeconds": 900
  }
}
'
{
  "isValid": true,
  "invalidReason": null,
  "payer": "0xaaaa..."
}

Authorizations

Authorization
string
header
required

JWT access token obtained from the /api/v1/auth/token endpoint.

Body

application/json

x402 payment verification or settlement request.

x402Version
enum<integer>
required

The version of the x402 protocol.

Available options:
1,
2
Example:

1

paymentPayload
object
required

The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header.

paymentRequirements
object

The x402 protocol payment requirements that the resource server expects the client's payment payload to meet.

Response

Verification result.

Result of verifying an x402 payment authorization.

isValid
boolean
required

Whether the payment authorization is valid.

invalidReason
string | null
required

Machine-readable reason why the authorization is invalid, or null if valid.

payer
string

Address of the payer extracted from the authorization.