Example webhook for bitcart API for different languages
This is a demonstration about how bitcart webhook works.
Simply include notification_url to receive your notifications.
const result = await axios.post('https://api.bitcart.ai/invoices', {
"store_id": process.env.BITCART_STORE_ID,
"notification_url": "https://your-site.com/callback",
"price": 15
}, {
headers: {
'Authorization': `Bearer ${process.env.BITCART_API_KEY}`
}
});
As of now bitcart are not providing a signature to verify webhooks.
It is highly recommended to use callback.id
to query an invoice and continue execution of code from that invoice.
See provided examples.
Alternatively, you can only accept requests from 5.75.174.52 used by bitcart.ai
status | description |
---|---|
expired | Invoice is expired because no payment detected in provided time frame. |
confirmed | Passed a confirmation. |
paid | Transaction detected but not yet confirmed. |
complete | Fully confirmed. Transaction has full confirmations. |
It's better to set 'transaction speed' to 2 or 3 in order to receive 'complete' status earlier. Transactions that have more than one confirmation is considered as irreservible, thus no security issues. After hitting provided number, you will receive 'complete' status.
Feel free to create issue or PR for another languages.