paymentType on POST /orders decides who
collects the money.
paymentType |
Who collects the money | The order after POST /orders |
next.type |
|---|---|---|---|
online |
Unipage, with the restaurant’s own payment provider | PENDING_PAYMENT, unpaid |
payment |
offline |
the restaurant, at pickup or on delivery | PLACED, unpaid |
confirmation |
external |
you, with your own payment provider | PLACED, paid |
confirmation |
online and offline are only accepted when the restaurant offers them: read
payment.methods from GET /store.
external is always accepted and is not listed there.
Online: the restaurant’s payment provider
Place the order
Send
paymentType: "online"and areturnUrlon one of your storefront’s origins.{orderId}in it is replaced by the order id:{ "paymentType": "online", "returnUrl": "https://shop.example.com/order/{orderId}" }Send the shopper to the payment page
The response has
next.type: "payment"andnext.url: redirect the shopper’s browser there.Read the outcome
After paying, the shopper comes back on
returnUrlwith?status=successor?status=failed(failed or cancelled). The query string is only a hint: readGET /orders/{id}from your server and useisPaidandstatus. With a webhook you also getorder.paidwhen the provider confirms.
Without returnUrl the shopper ends on the restaurant’s own Unipage thank-you page.
Offline: pay at the restaurant
The order is placed at once (PLACED), unpaid. The restaurant collects the money
at pickup or on delivery. Only possible when payment.methods contains
offline.
External: you collect the money
Take the payment with your own provider first, then place the order with
paymentType: "external". The order arrives PLACED and paid
(isPaid: true): the restaurant’s till books it as a paid online order, like an
order from a delivery platform. Optionally tell Unipage where you took the
payment, for reconciliation:
{
"paymentType": "external",
"payment": { "provider": "stripe", "reference": "pi_3Q8xYz" }
}- Place the order after the payment succeeded. If the order is then refused
(
SLOT_UNAVAILABLE,PRODUCT_UNAVAILABLE, …), refund the shopper. - Refunds are yours: the money never passes through the restaurant’s Unipage payouts, so Unipage cannot refund it.
- There is no
order.paidwebhook for anexternalorder:order.createdalready saysisPaid: true.