API reference
Get a payment link
A fresh hosted checkout page for a delivery nobody has paid for yet. Booking already returns one; this is for everything that happens afterwards.
/api/v1/dispatch/deliveries/{id}/payWhen you need it#
Booking hands you a checkout_url already, so most integrations never call this. Call it when:
| Situation | Why |
|---|---|
| The customer left and came back later | Hosted links do not last forever. |
| The first payment attempt failed | A declined card leaves the delivery unpaid; the link may be spent. |
| The booking came back with no checkout_url | Flutterwave was unreachable when you booked. The delivery still exists; only the link was missed. |
| You want to send the link somewhere else | A reminder email, a WhatsApp message, a second device. |
The price does not move underneath the customer
Parameters#
idstringrequiredid or its tracking_code.redirect_urlstringoptionalhttps — anything else is ignored rather than followed, because an open redirect on a payment page is a phishing primitive. Omit it and they land on the RheoChat tracking page for the delivery.Request#
curl -X POST "https://api.rheochat.com/api/v1/dispatch/deliveries/DCAB12CD34/pay" \
-H "Authorization: Bearer rk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "redirect_url": "https://yourshop.com/orders/4821" }'The SDK does not wrap this call yet — it is a plain POST with your bearer token.
Response#
{
"id": "0f9a1c8e-…",
"tracking_code": "DCAB12CD34",
"environment": "live",
"livemode": true,
"currency": "NGN",
"amount": 1840,
"tx_ref": "disp-DCAB12CD34",
"checkout_url": "https://checkout.flutterwave.com/v3/hosted/pay/a1b2c3d4e5f6",
"request_id": "b6d3f7c2-…"
}| Field | Meaning |
|---|---|
checkout_url | The hosted payment page. Redirect the customer here, or send them the link. |
amount | What they will be charged — the grossed-up total, in naira. |
tx_ref | The payment reference this delivery is matched by. Unchanged between attempts. |
Errors#
| Status | Code | When |
|---|---|---|
| 404 | not_found | No such delivery in this environment. |
| 422 | unprocessable | The delivery is cash on delivery, already paid, cancelled, has no online payment to complete, or your company has no payout account connected. details says which. |
| 422 | unprocessable | The key is a test key. Test deliveries are never charged, so a payment link for one would lead to a charge that must not happen. |
| 500 | internal_error | Flutterwave would not mint a link just now. Retry shortly — the delivery is unaffected. |
Why we create the link, not you#
The charge has to live on RheoChat's Flutterwave account: that is what carries the flat split to your subaccount, and what the webhook that marks a delivery paid listens to. A charge created on your own account would be invisible to us — the delivery would sit at unpaid and never reach a rider. So rather than hand out a publishable key, we create the charge with our secret key and give you a URL. See Payments.