Payment Intents
POST
/v2/payment_intentsAuth requiredCreate a payment intent
Creates a payment intent to collect a fiat amount on one of your stores. Share the intent id with the payer, who pays it through the Payer API in crypto.
Requires Bearer token authentication. Include Authorization: Bearer YOUR_API_KEY in the request header.
Request Body
amountstringrequiredAmount to collect in currency, with at most 2 decimals.
currencystringrequiredFiat currency code.
match_callbackstringPart of the store's callback URL. Required if you have multiple stores.
extra_datastringCustom data to associate with this intent.
Responses
amountbody · stringrequiredAmount to collect in `currency`, with at most 2 decimals.
currencybody · stringrequiredFiat currency code.
match_callbackbody · stringPart of the store's callback URL. Required if you have multiple stores.
extra_databody · stringCustom data to associate with this intent.
Response will appear here
Request
curl -X POST \
"https://www.blockonomics.co/api/v2/payment_intents" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": "10.00",
"currency": "USD",
"match_callback": "example.com",
"extra_data": "userid_912102"
}'const response = await fetch('https://www.blockonomics.co/api/v2/payment_intents', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"amount": "10.00",
"currency": "USD",
"match_callback": "example.com",
"extra_data": "userid_912102"
})
})
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",
headers=headers,
json={
"amount": "10.00",
"currency": "USD",
"match_callback": "example.com",
"extra_data": "userid_912102"
}
)
print(response.json())Response
{
"data": {
"id": "pi_5GfD5m1b8khzFSLza91VR6",
"store_id": 1243,
"amount": "10.00",
"currency": "USD",
"status": "unpaid",
"due_amount": "10.00",
"extra_data": "order-1234",
"created_at": 1793615164,
"payments": []
}
}