Webhook after payment
The phone can call an address of your choice after every successful payment, so your own system learns about it. It is not Stripe's webhook: the call comes from the phone.
Call it after each payment |
The on/off switch. |
|---|---|
Address |
The HTTPS address of your receiver, as in the first example. Variables such as {reference} may be used after the host. |
Method |
GET, POST or PUT. The default is POST. |
Body format |
JSON, FORM or TEXT. The default is JSON. |
Headers |
One Name: value per line, for example for an API key or a token. |
Body (template) |
The body with variables. The default is the JSON in the second example, with the payment id, reference, amount, currency and time. |
Signing secret (optional) |
When set, every call carries X-QR2Stripe-Timestamp and X-QR2Stripe-Signature (HMAC-SHA256). |
When it is called: once after every successful payment, in every mode, from the phone while the app is open. If the network is down the app tries again, keeps the call in a queue and delivers it at the next start of the app or when you tap Deliver them now. A call is given up after 10 attempts.
Set it up in the app: Merchant settings → Webhook after payment → Set up the webhook. Switch Call it after each payment on, enter the address, tap Send test call and Save. The test call sends a made-up payment, so you see at once whether the receiver accepts it.
The receiver can be your own server or a no-code tool (n8n, Make, Zapier) with a webhook trigger. Answer quickly with a 2xx status; the same payment can arrive twice, so recognise it by payment_id.
Variables such as {reference}, {amount}, {amount_decimal}, {currency} and {payment_id} fill in the details of the payment (the full list is in the specification). The default body is the JSON in the second example.
Set a signing secret so your system can check the signature of each call, and do not publish the address. Without it anyone who knows the address could send you a forged call.
The call comes from the phone, not from Stripe. In inline mode amount_from_qr is true, which means no server verified the amount. Before you hand over valuable goods, look the payment up in the Stripe Dashboard.
https://example.com/hook
{
"event": "payment.succeeded",
"payment_id": "{payment_id}",
"reference": "{reference}",
"description": "{description}",
"amount": {amount},
"currency": "{currency}",
"merchant": "{merchant}",
"site": "{site}",
"paid_at": "{paid_at}",
"amount_from_qr": {amount_from_qr}
}