POST
/
v1
/
verify
Verify x402 payment
curl --request POST \
  --url https://api.mrdn.finance/v1/verify \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "paymentPayload": {
    "x402Version": 1,
    "scheme": "exact",
    "network": "base-sepolia",
    "payload": {
      "signature": "<string>",
      "authorization": {
        "from": "<string>",
        "to": "<string>",
        "value": "<string>",
        "validAfter": "<string>",
        "validBefore": "<string>",
        "nonce": "<string>"
      }
    }
  },
  "paymentRequirements": {
    "amount": "<string>",
    "recipient": "<string>",
    "network": "<string>",
    "asset": "<string>",
    "resource": "<string>",
    "description": "<string>",
    "mimeType": "<string>"
  }
}'
{
  "isValid": true,
  "invalidReason": "<string>",
  "payer": "<string>",
  "authContext": {
    "organizationId": "<string>",
    "authMethod": "<string>",
    "timestamp": "<string>"
  }
}
Verify an x402 payment with organization-specific authentication. This endpoint validates payment signatures and authorization data according to the x402 protocol specification.

Features

  • Organization-specific x402 authentication
  • Automatic fallback to default authentication
  • Authentication context in responses
  • Comprehensive error handling

Request Example

{
  "paymentPayload": {
    "x402Version": 1,
    "scheme": "exact",
    "network": "base-sepolia",
    "payload": {
      "signature": "0x...",
      "authorization": {
        "from": "0x742d35Cc6634C0532925a3b8D0c4E5e6C2aE7A3e",
        "to": "0x1234567890123456789012345678901234567890",
        "value": "1000000",
        "validAfter": "1234567890",
        "validBefore": "1234567899",
        "nonce": "0x..."
      }
    }
  },
  "paymentRequirements": {
    "amount": "1000000",
    "recipient": "0x1234567890123456789012345678901234567890",
    "network": "base-sepolia",
    "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
    "resource": "https://example.com/resource",
    "description": "Payment for resource access",
    "mimeType": "application/json"
  }
}

Response Example

{
  "isValid": true,
  "payer": "0x742d35Cc6634C0532925a3b8D0c4E5e6C2aE7A3e",
  "authContext": {
    "organizationId": "org_123",
    "authMethod": "organization_specific",
    "timestamp": "2024-01-01T00:00:00.000Z"
  }
}

Authorizations

Authorization
string
header
required

Body

application/json
paymentPayload
object
required
paymentRequirements
object
required

Response

Payment verification result

isValid
boolean

Whether payment is valid

invalidReason
string

Reason if payment is invalid

payer
string

Payment sender address

authContext
object