Skip to content

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.

POST/public/v1/venues/{venueId}/orders/preview
Authentication

An API key in the X-Api-Key header

Permission
Can send orders
Rate limit
About 120 requests a minute per key

Send 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 parameterrequired

The venue, one of the ids GET /venues lists.

Accept-LanguagestringHeader

The 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.

typestringrequired

How 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 · uuidnullable

The 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.

customerobjectnullable

Who 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
namestringrequirednullable

The customer's name, at most 100 characters. Required.

phonestringrequirednullable

The 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.

addressstringnullable

Where a delivery goes, in the customer's own words, at most 300 characters. Required for Delivery and not allowed for Takeaway.

paymentMethodstringnullable

How 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.
notestringnullable

A note for the kitchen about the whole order, at most 300 characters.

linesobject[]required

The products ordered: 1 to 30 lines.

Fields of Order line request
productIdstring · uuidrequired

The product, one of the ids GET /venues/{venueId}/menu lists. Required.

portionIdstring · uuidrequired

The portion of that product. Required. A portion the venue sells by weight (orderable: false in the menu) cannot be ordered.

quantityintegerrequired

How many of it, 1 to 20.

notestringnullable

A 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

200

The priced basket.

400

PUBLIC_API_ORDER_INVALID or PUBLIC_API_PRODUCT_OPTION_INVALID. The parts that are wrong are in validationErrors, by their path in the body.

401

The X-Api-Key header is missing (PUBLIC_API_KEY_MISSING), or the key is invalid or has been revoked (PUBLIC_API_KEY_INVALID).

403

PUBLIC_API_SCOPE_MISSING: the key was not made with the "Can send orders" permission.

404

PUBLIC_API_VENUE_NOT_FOUND, PUBLIC_API_TABLE_NOT_FOUND or PUBLIC_API_PRODUCT_NOT_FOUND.

409

PUBLIC_API_PRODUCT_UNAVAILABLE: a product cannot be ordered right now.

429

The key's budget of about 120 requests a minute is spent; wait Retry-After seconds.

Retry-After

Seconds 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 · uuid

The product, as the request named it.

portionIdstring · uuid

The portion, as the request named it.

quantityinteger

How many of it.

unitPricenumber

The price of one unit: the portion plus the extras chosen for it.

lineTotalnumber

unitPrice × quantity, before campaigns.

subtotalnumber

The lines at menu price with their extras, before campaigns.

discountnumber

What the venue's campaigns take off. 0 when none apply.

serviceFeenumber

The venue's service fee, charged on the food after campaigns. 0 when the venue charges none.

totalnumber

What the order would come to: subtotal - discount + serviceFee.

currencystring

The currency of every amount, an ISO 4217 code. Always TRY.