The goal of the API is to separate, isolate and outsource the concern of handling specifics of external order sources (including but not restricting to portals) to the external parties called External Orders Proxies.
Restaumatic External Orders API is bidirectional API between Restaumatic and External Orders Proxies. Restaumatic system running in the cloud exposes endpoint hooks and calls the endpoints hooks of an External Orders Proxy according to the messaging flow specified below.
Use case:
- Order is created in one of many food online ordering parties for the restaurant that is powered by Restaumatic system
- External Orders Proxy fetches incoming orders from ordering party for Restaumatic restaurants and places the order in Restaumatic via
Order Placed(see the details in sections below) event - Restaumatic responds to External Order Proxy with
Order AcceptedorOrder Rejectedevents when applicable - External Orders Proxy updated the order in external ordering party accordingly
- Restaumatic updates the progress of the order with
Order in DeliveryorOrder Closedevent - External Orders Proxy updated the order in external ordering party accordingly
The allowed messaging are determined by the following conversation state diagram:

POST
[restaumatic base URL]/api/v1/external/orderplaced
'Content-type': 'application/json''authorization': 'Token token="[API_TOKEN]"'whereAPI_TOKENis External Order API client-specific credential, provided by Restaumatic when enabling the client
{
"externalOrderId": "89a3bb4a-9257-11eb-a8b3-0242ac130100",
"externalOrderSourceReferenceName": "yyummyy.comm",
"externalOrderReferenceId": "100100",
"shortExternalOrderReferenceId": "YYU100",
"restaurantId": 466,
"orderedAt": "2021-03-31T16:10:03Z",
"subjectToReject": true,
"subjectToAcceptBefore": "2021-03-31T16:20:03Z",
"subjectToCancel": false,
"fullfillmentMethod": {
"tag": "Delivery",
"deliveryFee" : 5.00,
"address": {
"street": "High Street",
"streetNumber": "12",
"apartmentNumber": "10",
"floor": "2",
"postCode": "12-345",
"city": "London",
"country": "GB",
"formattedAddress": "High St. 12/10 second floor",
"coordinates": {
"lon": 20.02341,
"lat": 50.46789
}
}
},
"requestedFullfillmentTime": "2021-03-31T17:30:00Z",
"subjectToOverwriteFullfillmentTime": true,
"paymentMethod": "Cash",
"customer": {
"fullName": "John Doe",
"email": "[email protected]",
"phone": "+48123123123",
"locale": "PL"
},
"customerOrderNote": "Please be on time",
"vatId": "1234567890",
"products": [
{
"name": "Chopped Pork + Potatos + Cabbage, XXL",
"quantity": 2,
"grossUnitPrice": 15.00,
"vatRate": "B",
"specifications": [
{
"name": "Replace potatoes with rice",
"quantity": 1,
"grossUnitPrice": 2.00,
"vatRate": {
"tag": "IncludedInProduct"
}
},
{
"name": "Extra fuzzy drink",
"quantity": 1,
"grossUnitPrice": 3.00,
"vatRate": {
"tag": "Separate",
"contents": "A"
}
}
],
"note": "without salt, please"
}
],
"discounts": [
{
"name": "Cheap Mondays",
"description": "All 15% off",
"value": 10.00
}
],
"additions": [
{
"name": "Charity",
"description": "Thanks for your kindness",
"value": 4.00
}
],
"tip": 2.00,
"totalGrossPrice": 31.00
}
Idempotent operation, based on externalOrderId parameter.
The event is rejected if and only if not valid in terms of format, regardless of the state of the system. Repeated events with the same externalOrderReferenceId, restaurantId and externalSourceReferenceName are considered duplicates and ignored. It is then safe to re-send the same events multiple times and therefore duplicates will be accepted on http transport layer and ignored within logic of Restaumatic API. Consequently, a medium with at-least-once delivery guarantee can be used.
externalOrderId- required UUID, unique id of an order generated by the integrator.externalOrderSourceReferenceName- required non-empty text. Name of the order source (e.g. portal) the order originates from. Allowed values should be agreed upon when setting up integration between the external order proxy and Restaumatic.externalOrderReferenceId- required non-empty text, unique (locally forexternalSourceReferenceName) order id given by the source of the order (e.g. unique id of an order on portal).shortExternalOrderReferenceId, - optional non-empty text, unique (locally forexternalOrderReferenceIdand vaguagly for current time frame). Short id given by the source of an order, used for e.g. correlating order between restaurants, couriers and customers. Display only.restaurantId- required integer (64 bit), id of the restaurant in the system, most probably other than restaurant id in external order sourceorderedAt- required zulu (UTC) time in ISO 8601 format e.g.2019-05-14T15:44:54.723Z, what time the order was placed by a customer, if not known, the time the order was placed in External Order ProxysubjectToReject- required boolean. Tells if the order can be rejected.currently supporting only
truevaluesubjectToAcceptBefore- optional zulu (UTC) time in ISO 8601 format e.g2019-05-14T15:44:54.723Z, till what time the order should be accepted. If not present, the order is assumed to be implicitly accepted.currently required
fullfillmentMethod- required object with required discriminator fieldtagtaking valueTakeawayorDeliveryorDineIn. Tells how the restaurant is supposed to fulfill the order:Takeaway- an order must only be prepared in a restaurant, it will be taken away by customerpickupCode- optional non-empty text
CourierPickUp- an order must only be prepared in a restaurant, it will be taken away by external courierpickupCode- optional non-empty textdeliveryFee- optional, delivery fee
Delivery- an order must only be prepared and delivered by a restaurantdeliveryFee- optional, delivery feeaddress- required field:street- required non-empty textstreetNumber- required text, however can be emptyapartmentNumber- optional non-empty textfloor- optional non-empty textpostCode- optional non-empty textcity- required non-empty textcountry- required, one of PL, GB, RU, RO, CZ, HR, SK, DE, NL, ES (potentially extended in the future)formattedAddress- optional non-empty text, the address in the way it's supposed to be displayed, should be in accordance to other fieldscoordinates- optional object- lat - required number, latitude
- lon - required number, longitude
DineIn- an order must only be prepared and delivered to a restaurant table, could potentially include table number (e.g. via scanning qr code)
requestedFullfillmentTime- optinal zulu (UTC) time in ISO 8601 format e.g "2019-05-14T15:44:54.723Z", when the restaurant is suppossed to fullfill the order, which is: either getting the order ready to be picked up by the external courier or customer (fullfillmentMethod==Takeaway) or getting the order delivered by the restaurant's courier (fullfillmentMethod==Delivery) or serving the order at the restaurant's table (fullfillmentMethod==DineIn). If not provided it's assumed to be as soon as possible.subjectToOverwriteFullfillmentTime- required boolean - if fullfilment time can be overwritten upon order acceptancecurrently supporting only
truevaluepaymentMethod- required one ofCashorOnlineorCardorPrepaid.customer- required objectemail- optional not-empty emailfullName- text, as full as provided by external order sourcephone- optional textlocale- optional, locale as defined by ISO/IEC 15897, falls back toenif not provided
customerOrderNote- optional non-empty text up to 512 characters, a note a customer can place on the ordervatId- optional non-empty text, vat tax payer identifier to be used for fiscalizationproducts- required non empty array of objectsname- required, not-empty textproductId- optional UUID, should match a product id from restaurants' menu in the systemquantity" - required positive integergrossUnitPrice- required positive number, should includegrossUnitPrices of specifications (see below)vatRate- optional text, letter ranging from A to G (as defined in regulation https://www.gov.pl/web/finanse/do-31-lipca-zmien-oznaczenia-w-kasach-rejestrujacych), if provided then the restaurant can print fiscal receipt for the orderspecifications- optional list of modifications of ordered productname- required, not-empty text, max 256 characters longspecificationId- optional UUID, should match a modifier item id from restaurants' menu in the systemquantity" - required positive integergrossUnitPrice- required non-negative numberspecificationVatRate- optional value with required discrimator fieldtagtaking valueIncludedInProductorSeparate. Whentagis set toSeparate, fieldcontentis also required and takes value being letter from A to G (SeevatRatein product)
note- optional, non-empty text, max 2064 characters, a note to this particular product
discounts- optional, non-empty array of objects containing:name- required text, max 256 characters longdescription- required text, max 256 characters longvalue- required positive value
additions- optional, non-empty array of objects containing:name- required text, max 256 characters longdescription- required text, max 256 characters longvalue- required positive value
tip- optional, positive valueexternalServiceFee- optional, positive value, some portals require the restaurateur to collect a portal service fee when using self-delivery and the order is paid by cashtotalGrossPrice- required non-negative number, should be the sum ofproducts' grossPrices plusdeliveryFeeplustipplusexternalServiceFeeminusdiscounts' values
HTTP 400 if invalid body, HTTP 401 if the External Orders Proxy not authorized to place the order, HTTP 200 otherwise.
POST
[external orders proxy base URL]/orderAccepted
'Content-type': 'application/json''authorization': 'Token token="[API_TOKEN]"'whereAPI_TOKENis Restaumatic credential, provided by External Orders Proxy when enabling integration
{
"externalOrderUUID": "89a3bb4a-9257-11eb-a8b3-0242ac130100",
"externalOrderId": {
"source": "yyummyy.comm",
"externalId": "100100"
"displayId": "YYU100",
}
"overwrittenDeliveryTime": "2020-06-10T13:20:00Z",
"restaumaticOrderId": 4617289,
"restaurantId": 12345,
}
externalOrderId- required UUID, external order id as provided in Order Placed eventrestaumaticOrderId- required text, order id in RestaumaticoverwrittenFullfillmentTime- optional zulu (UTC) time in ISO 8601 format e.g "2019-05-14T15:44:54.723Z", present if and only if the mentioned order wassubjectToOverwriteFullfillmentTime.
HTTP 400 if invalid body, HTTP 401 if Restaumatic not authorized to accept the order, HTTP 200 otherwise.
POST
[external orders proxy base URL]/orderRejected
'Content-type': 'application/json''authorization': 'Token token="[API_TOKEN]"'whereAPI_TOKENis Restaumatic credential, provided by External Orders Proxy when enabling integration
{
"externalOrderUUID": "89a3bb4a-9257-11eb-a8b3-0242ac130100",
"externalOrderId": {
"source": "yyummyy.comm",
"externalId": "100100"
"displayId": "YYU100",
}
"restaurantId": 12345,
}
externalOrderId:: required UUID, external order id as provided in Order Placed event
HTTP 400 if invalid body, HTTP 401 if Restaumatic not authorized to reject the order, HTTP 200 otherwise.
POST
[external order proxy base URL]/orderindelivery
'Content-type': 'application/json''authorization': 'Token token="[API_TOKEN]"'whereAPI_TOKENis Restaumatic credential, provided by External Orders Proxy when enabling integration
{
"restaumaticOrderId": "362718"
}
restaumaticOrderId- required text, order id in Restaumatic
HTTP 400 if invalid body, HTTP 401 if Restaumatic not authorized to update the order, HTTP 200 otherwise.
POST
[external orders proxy base URL]/orderClosed
{
"restaumaticOrderId": "362718"
}
restaumaticOrderId- required text, order id in Restaumatic
HTTP 400 if invalid body, HTTP 401 if Restaumatic not authorized to close the order, HTTP 200 otherwise.