/v2/payment_intents/{intent_id}/payment_quotesAuth requiredCreate a payment quote
Prices the amount still due on a payment intent in one cryptocurrency and returns the address to pay. The price is locked for 5 minutes (expires_in seconds). After that, refresh the quote to lock a new price.
Safe to call again. If the intent already has a quote in the same crypto with time left on its price lock, that quote is returned instead of a new one, with the same address. If a payment has come in on another quote since it was priced, it is first re-priced for the amount still due, with a new price lock. Call this whenever your checkout loads, without creating extra addresses, and always show the amount and expires_in from the latest response.
Underpayments. If the customer pays less than the quote, the intent becomes underpaid once the payment confirms. Create another quote to collect the rest: it is priced for the remaining amount_due only. You don't have to wait for the first payment to confirm, but you do have to wait until Blockonomics has seen it.
USDT. All USDT quotes on a store share the store's wallet address, so a payment is matched to its quote by transaction hash. Once the customer has paid, the hash has to be submitted to POST /api/v2/checkout/{intent_id}/quotes/{quote_id}/monitor_tx. The Blockonomics checkout does this for you. Monitor USDT Transaction does not link a transaction to a quote.
The store needs a wallet for the chosen crypto attached.
Requires Bearer token authentication. Include Authorization: Bearer YOUR_API_KEY in the request header.
Path Parameters
intent_idstringrequiredID of the payment intent
Request Body
cryptostringrequiredCryptocurrency to quote in. Case-insensitive.
Responses
intent_idpath · stringrequiredID of the payment intent
cryptobody · stringrequiredCryptocurrency to quote in. Case-insensitive.
Response will appear here
Request
curl -X POST \
"https://www.blockonomics.co/api/v2/payment_intents/d5e88bd4-2964-4554-9a81-ab64c391d174/payment_quotes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"crypto": "BTC"
}'const response = await fetch('https://www.blockonomics.co/api/v2/payment_intents/d5e88bd4-2964-4554-9a81-ab64c391d174/payment_quotes', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"crypto": "BTC"
})
})
const data = await response.json()
console.log(data)import requests
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.post(
"https://www.blockonomics.co/api/v2/payment_intents/d5e88bd4-2964-4554-9a81-ab64c391d174/payment_quotes",
headers=headers,
json={
"crypto": "BTC"
}
)
print(response.json())Response
{
"data": {
"id": "d81111b2-0165-4831-bd12-7a09011d4aa6",
"payment_intent_id": "d5e88bd4-2964-4554-9a81-ab64c391d174",
"amount": 11982,
"paid_amount": 0,
"crypto": "BTC",
"address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"status": "pending",
"txid": null,
"paid_timestamp": null,
"expires_in": 299
}
}