Skip to content

Payments

Three ways to collect the money for an order, and what each does to the order.

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

  1. Place the order

    Send paymentType: "online" and a returnUrl on one of your storefront’s origins. {orderId} in it is replaced by the order id:

    { "paymentType": "online", "returnUrl": "https://shop.example.com/order/{orderId}" }
  2. Send the shopper to the payment page

    The response has next.type: "payment" and next.url: redirect the shopper’s browser there.

  3. Read the outcome

    After paying, the shopper comes back on returnUrl with ?status=success or ?status=failed (failed or cancelled). The query string is only a hint: read GET /orders/{id} from your server and use isPaid and status. With a webhook you also get order.paid when 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.paid webhook for an external order: order.created already says isPaid: true.

Type to search…

↑↓ navigate↵ selectEsc close