Payer API
POST
/v2/pay/{id}Create a payment quote
Prices the intent's due_amount in the chosen crypto and returns the address to pay and the exact amount, at a price locked for 5 minutes. No API key needed. Calling it again for the same crypto while due_amount is unchanged returns the same quote and address, repriced, with a fresh 5-minute lock.
Path Parameters
idstringrequiredID of the payment intent
Request Body
cryptostringrequiredCrypto to pay in, from the intent's accepted_cryptos.
Responses
idpath · stringrequiredID of the payment intent
cryptobody · stringrequiredCrypto to pay in, from the intent's `accepted_cryptos`.
Response will appear here
Request
curl -X POST \
"https://www.blockonomics.co/api/v2/pay/pi_5GfD5m1b8khzFSLza91VR6" \
-H "Content-Type: application/json" \
-d '{
"crypto": "BTC"
}'const response = await fetch('https://www.blockonomics.co/api/v2/pay/pi_5GfD5m1b8khzFSLza91VR6', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"crypto": "BTC"
})
})
const data = await response.json()
console.log(data)import requests
headers = {}
response = requests.post(
"https://www.blockonomics.co/api/v2/pay/pi_5GfD5m1b8khzFSLza91VR6",
headers=headers,
json={
"crypto": "BTC"
}
)
print(response.json())Response
{
"data": {
"id": "pq_8GgAyuReWzLbJtEQrTNaT5",
"amount": "10.00",
"crypto_amount": "12966",
"paid_crypto_amount": "0",
"crypto": "BTC",
"address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"status": "pending",
"txid": null,
"expires_timestamp": 1793615475,
"paid_timestamp": null
}
}