Payment Intents
POST
/v2/payment_intents/{intent_id}Auth requiredUpdate a payment intent
Changes the amount or currency of a payment intent. Pass at least one of them.
Only intents with status unpaid can be updated, and not while a quote on the intent is still price-locked or has a payment waiting for confirmation. Quotes whose price lock has run out do not block an update.
Requires Bearer token authentication. Include Authorization: Bearer YOUR_API_KEY in the request header.
Path Parameters
intent_idstringrequiredID of the payment intent
Request Body
amountintegerNew amount, in the smallest unit of the currency
currencystringNew fiat currency code
Responses
intent_idpath · stringrequiredID of the payment intent
amountbody · integerNew amount, in the smallest unit of the currency
currencybody · stringNew fiat currency code
Response will appear here
Request
curl -X POST \
"https://www.blockonomics.co/api/v2/payment_intents/d5e88bd4-2964-4554-9a81-ab64c391d174" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 2500
}'const response = await fetch('https://www.blockonomics.co/api/v2/payment_intents/d5e88bd4-2964-4554-9a81-ab64c391d174', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"amount": 2500
})
})
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",
headers=headers,
json={
"amount": 2500
}
)
print(response.json())Response
{
"data": {
"id": "d5e88bd4-2964-4554-9a81-ab64c391d174",
"store_id": 1243,
"amount": 2500,
"currency": "USD",
"status": "unpaid",
"paid_amount": 0,
"extra_data": "order-1042"
}
}