Dexter
Dexter
Docs

POST /verify

Checks whether a payment payload is valid without submitting it on-chain. Use during development and testing to debug payment issues before calling /settle.

curl -X POST https://x402.dexter.cash/verify \
  -H "Content-Type: application/json" \
  -d '{
    "paymentPayload": { ... },
    "paymentRequirements": { ... }
  }'

Request

{
  "paymentPayload": {
    "x402Version": 2,
    "resource": {
      "url": "https://api.example.com/paid-route",
      "description": "Premium resource",
      "mimeType": "application/json"
    },
    "accepted": {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "amount": "10000",
      "payTo": "SELLER_WALLET",
      "maxTimeoutSeconds": 60
    },
    "payload": {
      "transaction": "BASE64_VERSIONED_TRANSACTION"
    }
  },
  "paymentRequirements": {
    "scheme": "exact",
    "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
    "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "amount": "10000",
    "payTo": "SELLER_WALLET",
    "maxTimeoutSeconds": 60
  }
}

Success Response

{
  "isValid": true,
  "payer": "BUYER_WALLET_ADDRESS"
}

Failure Response

{
  "isValid": false,
  "invalidReason": "Amount below minimum",
  "invalidCode": "policy:amount_below_min",
  "payer": "BUYER_WALLET_ADDRESS"
}

The invalidCode maps to the Facilitator Error Codes reference. Log it for debugging.

When to Use

  • Development: validate your payment construction before going live
  • Debugging: get specific invalidCode and invalidReason instead of a generic settlement failure
  • Integration testing: confirm policy compliance without spending USDC

On this page