Documentación API integración

Documentación API integración

Getting an order

GlobalFood offers two integration methods for getting new orders:

  • Push (Cloud system)
  • Poll (Local system)

Push (Cloud system)

This type of integration is recommended for systems with a centralized architecture. In this scenario, an endpoint is notified via webhook that one or more orders have been accepted for one or more of the system's client restaurants.

You need to provide us with:

  1. A public HTTPS endpoint that interprets our calls over the POST method eg: https://www.your-domain.com/integration/orderingsystem

  2. Tell us which format you like (XML or JSON)

Map orders to correct restaurants:

You need to identify which restaurant you need to assign an order to. Every order that we push to you contains the <restaurant_key> parameter which is unique to each restaurant location. To get your own key, navigate to the integrations section and add an integration using the "Push Accepted Order" template. You should see the key in the integrations listing after adding it. You can see in the XML & JSON example below that the example key is 8yCPCvb3dDo1k.

Add optional security:

By default we send a master key alongside each request in the "Authorization" (example: e6fIguVkyG5xtT3BYGMI4rfm9iVt24YJ) header of the request. This key can be used by you to verify that the sender is us. Otherwise any third party that knows your URL https://www.your-domain.com/integration/orderingsystem could try to push a "fake" order.

WARNINGS:

  1. The endpoint called by our system MUST reply within a maximum of 15 seconds.

  2. In some rare cases, it is possible to receive two notifications for the same order. This means that the notifications contain the same order id and pos_system_id. You MUST implement a protection against this special case.

Example using JSON

We will call

with the payload found in examples

Example using XML

We will call

with the payload found in examples

Poll (Local system)

This type of integration is recommended for systems with a decentralized architecture. In this scenario the restaurant devices does not communicate with a central endpoint for notifications. The devices poll our server every minute to check for new confirmed order notifications. An example for "Polling" is when the device is behind a firewall inside the restaurant location and does not have a connection with a server in the cloud. When using polling, the orders will be available for an unlimited amount of time until being requested by the device.

We need to provide you:

A secret key to allow you to poll our system. This key must be sent in the "Authorization" header of the request. This key is unique for every restaurant location. (Example: 8yCPCvb3dDo1k). To get your own key, navigate to the integrations section and add an integration using the "Poll Accepted Order v2" template. You should see the key in the integrations listing after adding it

Polling:

  1. The endpoint for polling is: https://pos.globalfoodsoft.com/pos/order/pop
  2. Method is POST
  3. API version must be set to: 2
  4. You can select the format (xml or json) by setting the "Accept" header to either "application/xml" or "application/json". Default is JSON.

Example using JSON

curl "https://pos.globalfoodsoft.com/pos/order/pop" \
   -X POST \
   -H "Authorization: 8yCPCvb3dDo1k" \
   -H "Accept: application/json" \
   -H "Glf-Api-Version: 2"

See examples for response payload

Example using XML

curl "https://pos.globalfoodsoft.com/pos/order/pop" \
   -X POST \
   -H "Authorization: 8yCPCvb3dDo1k" \
   -H "Accept: application/xml"  \
   -H "Glf-Api-Version: 2"

See examples for response payload

Order fields

DISCLAIMER: Results may contain some fields which are not documented here. This means that they are deprecated or only used internally. They are in the process of being removed from the Accepted Orders API. The last section includes a list of relevant fields so please expect and store only those.

NOTES:

  • all rates are decimals, meaning that 20% will be stored as 0.2 and 0.725% will be stored as 0.00725
  • some fields can contain null; in JSON null is treated as a separate type, in XML it's a self-closing element; the meaning of null is "field has not been used"

Order Collections

The fields of an order collection are:

FieldTypeDescription
countintegernumber of orders to be fetched by the system
ordersarray of orderslist of the orders

Orders

The fields of an order are:

FieldTypeDescription
idintegerorder id
api_versionintegerversion of the accepted orders api
typestring'pickup' or 'delivery' or 'table_reservation' or 'order_ahead' or 'dine_in'
statusstring'accepted' or 'rejected' or 'timed_out' or 'pending'
missed_reasonstring or nullnull - in case the status is any other than missed
'NO_CONNECTION' - in case the order could not be pushed to the order taking app
'TIMED_OUT' -the order was pushed to the order taking app within due time but was not accepted by the staff of the restaurant
personsintegernumber of people at table for a table reservation or order ahead; always 0 in case of pickup or delivery
sourcestringsource of the order; can be:
'website' - restaurant website on desktop browser
'mobile_web' - restaurant website on a mobile browser
'facebook' - facebook app
'website_facebook' - facebook share page on a desktop browser
'mobile_web_facebook' - facebook share page on a mobile browser
'android' - android portal app
'android_branded' - android whitelabel app
'ios' - ios portal app
'ios_branded' - ios whitelabel app
'admin' - menu editor preview
paymentstringpayment method used; can be:
'CASH' - cash at the register
'ONLINE' - online payment with card / PayPal / iDEAL / ApplePay / G-Pay
'CARD' - card at the register
'CARD_PHONE' - card details by phone
'Bit' - popular in Israel (restaurant is responsible to facilitate payment)
'Cartão refeição/alimentação' - popular in Brasil (restaurant is responsible to facilitate payment)
'PayLah' - popular in Singapore (restaurant is responsible to facilitate payment)
'Paynow' - popular in Singapore (restaurant is responsible to facilitate payment)
'Picpay' - popular in Brasil (restaurant is responsible to facilitate payment)
'SnapScan' - popular in South Africa (restaurant is responsible to facilitate payment)
'Zapper' - popular in South Africa (restaurant is responsible to facilitate payment)
gateway_typestringIn case payment is 'ONLINE' this field contains the payment gateway name (e.g. 'stripe', 'braintree', 'paypal'.
gateway_transaction_idstringIn case payment is 'ONLINE' this field contains the payment transaction ID assigned by the payment gateway.
accepted_atstringUTC date string of when the order was accepted. Example 2019-11-20T10:41:49.000Z (Timestamp is always UTC regardless of winter/summertime)
fulfill_atstringUTC date string of when the order will be delivered or picked up. Example 2019-11-20T10:41:49.000Z (Timestamp is always UTC regardless of winter/summertime)
updated_atstringUTC date string of when the order was last modified before sending it. Example 2019-11-20T10:41:49.000Z (Timestamp is always UTC regardless of winter/summertime)
for_laterbooleanFlag to signal if the order is for a future specific time(true) or on demand, to be delivered or picked up as soon as possible(false)
instructionsstring or nullorder instructions
restaurant_idintegerrestaurant ID
company_account_idintegercompany account ID - A multi-chain restaurant may have different locations but all managed under one unique company account login. Restaurant ID is unique per location. This company account ID is unique for the entire chain.
restaurant_namestringname of the restaurant
restaurant_phonestringphone of the restaurant
restaurant_countrystringcountry of the restaurant
restaurant_statestringstate of the restaurant
restaurant_citystringcity of the restaurant
restaurant_zipcodestringzipcode of the restaurant
restaurant_streetstringstreet of the restaurant
restaurant_latitudestringlatitude of the restaurant
restaurant_longitudestringlongitude of the restaurant
restaurant_timezonestringtimezone of restaurant; this is set automatically when you set the exact location in the Admin panel
restaurant_keystringauthorization key of the restaurant
restaurant_tokenstringtoken or id of the corresponding restaurant in your system; this is set by adding it to the integration in the Admin panel
currencystringthree letter currency code
e.g. 'USD'
client_idintegerclient id
client_first_namestringclient first name
client_last_namestringclient last name
client_emailstringclient email
client_phonestringclient phone
client_addressstring or nullclient delivery address; it's null when order is pickup
client_address_partsobject or nullclient delivery address components; it's null when order is pickup; can contain the following components:
- street
- bloc
- floor
- apartment
- intercom
- more_address (in case extended address is not enabled)
- zipcode
- city
- full_address (legacy orders)
client_marketing_consentbooleanfalse - this means the food-client did not give consent to receive marketing related communication from this restaurant regarding similar products
true - this means the food-client gave consent to receive marketing related communication from this restaurant regarding similar products
fulfillment_optionstring or null'in_person'
'meet_rider'
'no_contact'
'at_counter'
'outside_venue'
'curbside_pickup'
null - in case the option is not being used
table_numberstring or nullUsed for Dine-in orders
readybooleanfalse - the order was accepted but was not marked as ready in the New OTA
true - the order was marked as ready
client_languagestringLanguage the food client used when placing this order. (ISO 639-1 format)
integration_payment_providerstring or nullOnly used when an "Payment tab API" integration is enabled. Acronym field is passed along here, which was added in the restaurant admin panel when setting up the integration.
integration_payment_amountfloatAmount used when an "Payment tab API" integration is enabled. Default is 0 even when there is no integration set.
used_payment_methodsarray of stringsAll payment methods used for this order. In most cases this has the value of the "payment" field. In case this order was paid with 2 payment methods (split-payment) then this array contains 2 entries. Array has min 1 and max 2 entries.
card_typestring or nullOnly used when food clients pay by card (Excluding PayPal / iDEAL / ApplePay / G-Pay). Only used when field payment is ONLINE. Possible values (but not limited to):
- visa
- mastercard
- discover
- american_express
- diners_club
- maestro
- switch
- dankort
- jcb
- carnet
- elo
- cabal
- unionpay
- naranja
- alelo
- alia
billing_detailsobject'person_name' - First and last name (Person)
'person_doc_number' - Document number (Person)
'company_name' - Company name (Company)
'company_doc_number' - Document number (Company)
'fiscal_address' - Address (Person or company)

'type' = 'doctype_person_cc' - Citizenship card (Person)
'type' = 'doctype_person_ce' - Foreign citizenship card (Person)
'type' = 'doctype_person_ti' - Identity Card (Person)
'type' = 'doctype_person_pp' - Passport (Person)
'type' = 'doctype_company_nit' - Tax identification number (Company)

'type_prefix' - Depends on the country

ARGENTINA: Ticket / DNI (Person) / CUIT (Company)
BOLIVIA: Ticket / CI (Person) / NIT (Company)
BRAZIL: Boleta / CI (Person) / CNPJ (Company)
CHILE: Boleta / CI (Person) / RUT (Company)
COLOMBIA: Boleta / CC (Person) / CE (Person) / NIT (Company)
COSTA RICA: Boleta / CI (Person) / NITE (Company)
DOMINICA: Receipt / CI (Person) / RNC (Company)
DOMINICAN REPUBLIC: Factura de Consumo / CIE (Person) / RNC (Company)
ECUADOR: Nota de venta / CI (Person) / RUC (Company)
EL SALVADOR: Boleta / DUI (Person) / NIT (Company)
GUATEMALA: Ticket / DPI (Person) / RTU (Company)
HONDURAS: Ticket / TI (Person) / RTN (Company)
MEXICO: Ticket / CURP (Person) / RFC (Company)
NICARAGUA: Ticket / CI (Person) / RUC (Company)
PANAMA: Boleta / CIP (Person) / NIT (Company)
PARAGUAY: Ticket / CI (Person) / RUC (Company)
PERU: Boleta / CEXT (Person) / DNI (Person) / PASS (Person) / RUC (Company)
URUGUAY: Boleta / CI (Person) / RUT (Company)
VENEZUELA: Boleta / CI (Person) / RIF (Company)
pin_skippedbooleanpin_skipped can be:
false - inserted address was translated into latitude & longitude using using Google API. The food client fine-tuned the pin on the map manually to achieve high accuracy.
true - inserted address was translated into latitude & longitude using using Google API. The food client however skipped fine-tuning the pin on the map thus latitude & longitude values may not be accurate
latitudestring or nulllatitude of the client delivery address; null when order type is pickup
longitudestring or nulllongitude of the client delivery address; null when order type is pickup
total_pricefloattotal including taxes
sub_total_pricefloatsub-total, not including tip, delivery fee and, only in 'NET' tax calculations, taxes on items
tax_typestringhow taxation is applied, can be either 'NET' or 'GROSS' (NOTE: the tip is always taxed as GROSS)
tax_valuefloattotal value of all the taxes
tax_namestringname of default tax
e.g. 'VAT', 'Sales Tax'
tax_listarray of aggregated taxeslist of aggregated taxes (by type and by rate) for order items
couponsarray of integerslist of promotion ids corresponding to coupon codes used during the ordering process (including those which were not applied in the end)
itemsarray of order itemslist of order items
referencestringreference string that was used when opening ordering

Aggregated taxes

The fields of an aggregated tax are:

FieldTypeDescription
typestringtype of aggregated tax; can be:
- 'item' - taxes for menu items
- 'delivery_fee' - taxes for the delivery fee
- 'tip' - taxes for the tip
- 'fees_discounts_subtotal' - taxes for the sum of service fees and cash discounts applied to the shopping cart value (sub-total)
- 'service_fee_total' - taxes for the sum of service fees applied to the total order value
valuefloatvalue of the taxes
ratefloatrate used to calculate taxes

Order Items

The fields of an order item are:

FieldTypeDescription
idintegerorder item id
namestringorder item name
instructionsstring or nullorder item instructions
typestringtype of order item; can be:
- 'item' - item on the menu
- 'delivery_fee' - the delivery fee
- 'tip' - the tip
- 'promo_cart' - cart promotion (which applies to the entire cart, like discount on the cart total)
- 'promo_item' - item promotion (which applies to child items, that have parent_id equal to the id of this item)
- 'promo_cart_item' - item promotion depending on cart value (which applies to items, when certain card conditions are met, like a minimum cart value)
- 'service_fee_subtotal' - a service fee that is applied to the shopping cart value (sub-total)
- 'service_fee_total' - a service fee that is applied to the total value of the order placed
- 'cash_discount' - a cash discount offered for a service fee due to cash payment
type_idinteger or nullid of the original menu item or promotion used to create the order item; can be:
- 'tip' - null
- promo 'specialty_fee' / 'surcharge' - null
- 'delivery_fee' - id of the delivery_zone or null for orders outside the delivery zones
- 'service_fee' - id of the service_fee_* in the system
- 'cash_discount' - id of the service_fee_subtotal item that it discounts
parent_idinteger or nullusually null except if the id of the parent order item has the following two conditions: item is of type 'item' and it belongs to another item of type 'promo_item'
total_item_pricefloattotal price of the item taking into account quantity and options. In case type is 'promo_item' then it uses the child order items. In any case it does not include discounts
tax_typestring(DEPRECATED: use order.tax_list) how taxation is applied, can be either 'NET' or 'GROSS'
tax_valuefloat(DEPRECATED: use order.tax_list) value of the taxes; not calculated on items of type 'item' if they are children of type 'promo_item'; it's not calculated if type is 'promo_cart'
tax_ratefloat(DEPRECATED: use order.tax_list) rate used to calculate taxes; can be different for any item
pricefloatbase price of the item, no quantity and no options; if tax_type is 'GROSS' then it also includes the tax_value
quantityintegerquantity of the item
item_discountfloatdiscount applied to the item as a result of item promotions OR the total discount of an item of type 'promo_cart'
cart_discountfloatdiscount applied to the item as a result of cart promotions
cart_discount_ratefloatrate used to apply all of the cart promotions; if you have multiple cart promotions (type is 'promo_cart) then their rates are added up here
optionsarray of item optionslist of item options like sizes, toppings or addons
couponstringin case item is 'promo_cart' or 'promo_item' this is the coupon code of the promotion

Item Options

The fields of an item option are:

FieldTypeDescription
idintegeritem option id
namestringitem option name
group_namestringname of the option group
e.g. name of option is Ketchup, group_name is Sauces
typestringitem option type; can be either 'option' or 'size'
type_idintegerid of the original option or size used to create the order option
quantityintegerquantity of the item option
pricefloatbase price of the item option, does not use quantity

NOTE: We no longer update the version 1 documentation. To make use of newer features please upgrade to Version 2. For the deprecated Version 1 documentation, you can go here. From time to time we add new fields. We recommend you ignore unknown fields.

    • Related Articles

    • Desactivar api aqui llevo

      Proceso Desactivar api aquí llevo 1. Ingresar a la cuenta de la sede del restaurante que se va a desactivar 2. ir a la sección de los 3 puntos 3. seleccionar integraciones de terceros 4. Seleccionar integraciones habilitadas 5. Buscar la api que ...