Verify a payment credential
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
credential: '<string>',
price: '0.01',
walletId: 'byw_abc123',
resource: '/analyse',
currency: 'USD',
description: '<string>',
network: 'eip155:8453'
})
};
fetch('https://api.prudra.dev/payments/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.prudra.dev/payments/verify"
payload = {
"credential": "<string>",
"price": "0.01",
"walletId": "byw_abc123",
"resource": "/analyse",
"currency": "USD",
"description": "<string>",
"network": "eip155:8453"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.prudra.dev/payments/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credential": "<string>",
"price": "0.01",
"walletId": "byw_abc123",
"resource": "/analyse",
"currency": "USD",
"description": "<string>",
"network": "eip155:8453"
}
'{
"valid": true,
"paymentId": "pay_abc123",
"txHash": "0xabc...",
"amount": "0.01",
"coin": "USDC",
"protocol": "x402",
"settledAt": "2023-11-07T05:31:56Z",
"settlementPending": true,
"settlementToken": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>"
}{
"type": "https://api.prudra.dev/problems/payment-limit-reached",
"title": "Plan Limit Reached",
"status": 429,
"detail": "Your plan includes 100 payments per month. You have used 100.",
"limit": 100,
"current": 100,
"upgradeUrl": "https://dashboard.prudra.com/settings/billing"
}Payments
Verify a payment credential
Verifies an x402 or MPP payment credential in the request body. Creates a Payment record on success. For x402, returns a settlementToken for use with POST /payments/settle after work is completed.
POST
/
payments
/
verify
Verify a payment credential
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
credential: '<string>',
price: '0.01',
walletId: 'byw_abc123',
resource: '/analyse',
currency: 'USD',
description: '<string>',
network: 'eip155:8453'
})
};
fetch('https://api.prudra.dev/payments/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.prudra.dev/payments/verify"
payload = {
"credential": "<string>",
"price": "0.01",
"walletId": "byw_abc123",
"resource": "/analyse",
"currency": "USD",
"description": "<string>",
"network": "eip155:8453"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.prudra.dev/payments/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credential": "<string>",
"price": "0.01",
"walletId": "byw_abc123",
"resource": "/analyse",
"currency": "USD",
"description": "<string>",
"network": "eip155:8453"
}
'{
"valid": true,
"paymentId": "pay_abc123",
"txHash": "0xabc...",
"amount": "0.01",
"coin": "USDC",
"protocol": "x402",
"settledAt": "2023-11-07T05:31:56Z",
"settlementPending": true,
"settlementToken": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>"
}{
"type": "https://api.prudra.dev/problems/payment-limit-reached",
"title": "Plan Limit Reached",
"status": 429,
"detail": "Your plan includes 100 payments per month. You have used 100.",
"limit": 100,
"current": 100,
"upgradeUrl": "https://dashboard.prudra.com/settings/billing"
}Authorizations
Your Prudra API key. Get one at dashboard.prudra.com/settings/api-keys
Body
application/json
Available options:
x402, mpp Raw payment credential (x402 X-PAYMENT payload or MPP proof)
Example:
"0.01"
Example:
"byw_abc123"
Example:
"/analyse"
Example:
"eip155:8453"

