Create an order
Unipage creates the customer, validates everything again (slot and
capacity, products orderable and in stock, option rules, delivery zone
and minimum, coupon) and places the order. An invalid coupon is a 422
COUPON_INVALID, never silently dropped.
paymentType picks who collects the money (see
Payments):
online: Unipage, with the restaurant's payment provider. The order isPENDING_PAYMENTandnext.typeispayment: send the shopper's browser tonext.url. After the payment they are sent toreturnUrlwith?status=success(or?status=failedfor a failed or cancelled payment). Read the outcome fromGET /orders/{id}(isPaid,status), never from the query string.offline: the restaurant, at pickup or on delivery. The order isPLACEDand unpaid.external: you, with your own payment provider, before you place the order. The order isPLACEDand paid at once.
With customerNotifications: false, Unipage sends the customer no
mail, SMS or push message for this order, now or later: you send your
own. See Customer messages.
https://api.unipage.eu/storefront/v1/ordersAuthorization
Request body JSON required
- paymentTypeonlineorofflineorexternalrequired
onlineoroffline: one of the restaurant'spayment.methods.external: you took the payment yourself; always accepted. See Payments. - customerNotificationsoptionalboolean
false: Unipage sends the customer nothing for this order (no confirmation, status or review message, by mail, SMS or push), now or later. The restaurant's own notifications are not affected. See Customer messages.default: true - returnUrloptionalstring
Where the shopper lands after an online payment, with
?status=successor?status=failedadded.{orderId}is replaced by the order id. It must be on one of the origins of your storefront's public key or on a local origin (localhost,127.0.0.1,[::1]), otherwise 422VALIDATION(fields.returnUrl). Without it, the shopper lands on the restaurant's own Unipage thank-you page.maxLength: 2000