/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. It is safe to call on every page load, and it is how you renew an expired quote. After a partial payment, the next call returns a new quote for what is left.
Each BTC quote has its own address, and payments to it are detected automatically. USDT quotes use the store's wallet address, so the payer must also submit the transaction hash with Submit a transaction hash.
If what is left is below the smallest amount the crypto can send (546 satoshis for BTC), the quote asks for that minimum instead.
Path Parameters
idstringrequiredID of the payment intent
Request Body
cryptostringrequiredCrypto to pay in. Must be one of the intent's accepted_cryptos. Not case-sensitive.
Responses
idpath · stringrequiredID of the payment intent
cryptobody · stringrequiredCrypto to pay in. Must be one of the intent's `accepted_cryptos`. Not case-sensitive.
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
}
}