Generate a dual payment challenge
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
walletId: '<string>',
hostname: '<string>',
price: '<string>',
description: '<string>',
intent: 'charge',
acceptX402: true,
acceptMPP: true
})
};
fetch('https://api.prudra.dev/payments/challenge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.prudra.dev/payments/challenge"
payload = {
"walletId": "<string>",
"hostname": "<string>",
"price": "<string>",
"description": "<string>",
"intent": "charge",
"acceptX402": True,
"acceptMPP": True
}
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/challenge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"walletId": "<string>",
"hostname": "<string>",
"price": "<string>",
"description": "<string>",
"intent": "charge",
"acceptX402": true,
"acceptMPP": true
}
'{
"mpp": "<string>",
"x402": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>"
}Payments
Generate a dual payment challenge
Generates both an MPP (WWW-Authenticate) and x402 (PAYMENT-REQUIRED) challenge for a pay-walled endpoint. Called internally by the Prudra Express SDK’s payMiddleware — developers do not call this directly.
Rate limited to 20 requests per IP per 60 seconds.
POST
/
payments
/
challenge
Generate a dual payment challenge
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
walletId: '<string>',
hostname: '<string>',
price: '<string>',
description: '<string>',
intent: 'charge',
acceptX402: true,
acceptMPP: true
})
};
fetch('https://api.prudra.dev/payments/challenge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.prudra.dev/payments/challenge"
payload = {
"walletId": "<string>",
"hostname": "<string>",
"price": "<string>",
"description": "<string>",
"intent": "charge",
"acceptX402": True,
"acceptMPP": True
}
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/challenge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"walletId": "<string>",
"hostname": "<string>",
"price": "<string>",
"description": "<string>",
"intent": "charge",
"acceptX402": true,
"acceptMPP": true
}
'{
"mpp": "<string>",
"x402": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>"
}Authorizations
Your Prudra API key. Get one at dashboard.prudra.com/settings/api-keys
Body
application/json

