Orders
Price a basket
Price the order you would place without placing it: the lines, what campaigns take off, the service fee and the total.
/public/v1/venues/{venueId}/orders/previewSend the order you would place, without the Idempotency-Key, and read what it would cost: each line at menu price with its extras, what the venue's automatic campaigns take off, the service fee and the total. Placing the same basket charges that total.
It checks everything placing the order checks about the basket (the shape, the menu and a dine-in table) and refuses with the same errors, but not whether the venue is open or subscribed: a site can show prices while the kitchen is shut.
It prices the basket on its own. When a dine-in round joins a bill that is already open, campaigns that look at the whole bill can price the round differently once it is on it; the placed order's totals are the figures that count.
Parameters
venueIdstring · uuidPath parameterrequiredThe venue, one of the ids GET /venues lists.
Accept-LanguagestringHeaderThe language of userMessage in an error: tr (the default), en, de, fr, it, es, ar or ru. The first language in the header decides, without its region (en-US reads as en) and without weighing q values; a language Cibusy does not offer is answered in Turkish. It does not choose the language of a menu: that is lang on the menu call.
Request body
An order a venue's site sends in, or a basket it wants priced first. It carries no prices: the server prices every line from the venue's menu, applies the venue's campaigns and service fee, and answers with the total.
typestringrequiredHow the order reaches the diner. Required.
DineIn- At a table: the round is added to the table's open bill, or opens one.
Takeaway- Takeaway: the customer collects it at the venue.
Delivery- Delivery: the venue brings it to the customer.
tableIdstring · uuidnullableThe table a dine-in order is for, one of the ids GET /venues/{venueId}/tables lists. Required for DineIn and not allowed for Takeaway or Delivery. An id that is not one of the venue's tables answers 404.
customerobjectnullableWho the order is for. Required for Takeaway (name and phone) and Delivery (name, phone and address) and not allowed for DineIn: a party at a table is served where it sits.
Fields of Customer
namestringrequirednullableThe customer's name, at most 100 characters. Required.
phonestringrequirednullableThe number to ring about the order, in international form or the way it is written locally (+905321112233, 0532 111 22 33). At most 30 characters. Required.
addressstringnullableWhere a delivery goes, in the customer's own words, at most 300 characters. Required for Delivery and not allowed for Takeaway.
paymentMethodstringnullableHow the customer says they will pay, for a takeaway or a delivery. Optional, and not allowed for DineIn, which is settled at the table. A hint for whoever hands the order over: nothing is charged through the API.
Cash- Cash.
Card- Card.
MealCard- Meal card.
notestringnullableA note for the kitchen about the whole order, at most 300 characters.
linesobject[]requiredThe products ordered: 1 to 30 lines.
Fields of Order line request
productIdstring · uuidrequiredThe product, one of the ids GET /venues/{venueId}/menu lists. Required.
portionIdstring · uuidrequiredThe portion of that product. Required. A portion the venue sells by weight (orderable: false in the menu) cannot be ordered.
quantityintegerrequiredHow many of it, 1 to 20.
notestringnullableA note for the kitchen about this line, at most 200 characters.
extraIdsstring[]The extras chosen for each unit of this line: ids from the product's extras in the menu, at most 20, each at most once. An extra that is not the product's own, or a choice that breaks the product's option groups (two sugar levels on one coffee, none where one is required), is refused.
removedIngredientIdsstring[]The ingredients left out of each unit of this line: ids from the product's removableIngredients in the menu, at most 20, each at most once.
Responses
The priced basket.
PUBLIC_API_ORDER_INVALID or PUBLIC_API_PRODUCT_OPTION_INVALID. The parts that are wrong are in validationErrors, by their path in the body.
The X-Api-Key header is missing (PUBLIC_API_KEY_MISSING), or the key is invalid or has been revoked (PUBLIC_API_KEY_INVALID).
PUBLIC_API_SCOPE_MISSING: the key was not made with the "Can send orders" permission.
PUBLIC_API_VENUE_NOT_FOUND, PUBLIC_API_TABLE_NOT_FOUND or PUBLIC_API_PRODUCT_NOT_FOUND.
PUBLIC_API_PRODUCT_UNAVAILABLE: a product cannot be ordered right now.
The key's budget of about 120 requests a minute is spent; wait Retry-After seconds.
Retry-AfterSeconds to wait. The next one-minute window opens within it.
The data of a successful answer
A basket priced by the server before it is ordered: the lines at menu price with their extras, what the venue's campaigns take off, the service fee and the total. Placing the same basket charges exactly this total.
linesobject[]One entry for each line of the request, in the same order.
Fields of Priced line
productIdstring · uuidThe product, as the request named it.
portionIdstring · uuidThe portion, as the request named it.
quantityintegerHow many of it.
unitPricenumberThe price of one unit: the portion plus the extras chosen for it.
lineTotalnumberunitPrice × quantity, before campaigns.
subtotalnumberThe lines at menu price with their extras, before campaigns.
discountnumberWhat the venue's campaigns take off. 0 when none apply.
serviceFeenumberThe venue's service fee, charged on the food after campaigns. 0 when the venue charges none.
totalnumberWhat the order would come to: subtotal - discount + serviceFee.
currencystringThe currency of every amount, an ISO 4217 code. Always TRY.