# Changelog

## Version 1.1 Changes

The following change was introduced.

* Added the `paymentStatus` field to orders so partner Apps can identify whether an order has been paid or not.


### Order entity

| New/updated Field | Description | Change | Change Description |
|  --- | --- | --- | --- |
| paymentStatus | Optional field indicating the payment status of an order. | New | Added to allow App partners to identify whether an order needs to be paid for. Only applicable with orders with fulfilment type of `DINE_IN`. |


### For POS systems

* Orders with a `DINE_IN` fulfilment type can contain the `paymentStatus` when fetching an order. This indicates whether the order needs to be paid or not.


## Version 1.0 Changes

- Endpoint has been moved from `https://api.tyro.cloud/connect/pos/orders` to `https://api.tyro.com/connect/orders`
- The `event.type` for the [Notification Events](/pos/apis/ordering/events) have been renamed:


| 0.6 | 1.0 |
|  --- | --- |
| `ACKNOWLEDGED` | `ORDER_ACCEPTED` |
| `SYSTEM_ERROR` | `ORDER_REJECTED` |
| `READY` | `ORDER_READY` |


- Add an `orderReference` field to the origin object.
- The allowed values of the order status field have been redefined.
  - `ACCEPTED`
  - `BEING_PREPARED` *
  - `REJECTED`
  - `READY`
  - `OUT_FOR_DELIVERY` *
  - `CANCELLED_BY_MERCHANT` *
  - `CANCELLED_BY_CUSTOMER` *
  - `FULFILLED` *
*Fields marked with an * are optional.*
- Orders that are not accepted within 2 minutes of being delivered to the POS will be automatically rejected back to the ordering partner. POS's that try to accept an order after the 2 minutes will receive an error.
- Replace the `modifications` object with a `modifiers` array. This will simplify the structure and remove the concept of additions and subtractions.
- Add `table`.`section` in the `order` object to capture information about a table's section.
- Tyro Connect may in extraordinary scenarios send event notifications more than once. It was always expected that a POS will be idempotent but it was never explicitly documented that this could happen.


# Draft 6 Changes

- Added instructions for device code authentication flow
- Added instructions for websockets events


# Draft 5 Changes

- Rename tcOrderId to id
- Replace Origin field (string) with object
  - The value previously stored in origin is now origin.name
  - Replace storeId with origin.locationId
  - Replace externalId with origin.orderId
- Order Item Object:
  - Added quantity field
- Updated Webhook Event object:
  - Removed locationId field
- Added list of Allergens to modifications object


# Draft 4 Changes

- Added Money object
- Added Customer object
- Added Discount object
- Added Surcharge object
- Added EventData object
- Added ModificationMap to represent different types of modifications
- Defined an enum for OrderStatus
- Updated Webhook Event object:
  - Removed resource
  - Removed id
  - Removed uri
  - Added type which represents event type
  - Added data of type EventData which contains a payload of the event details
- Updated Order object:
  - Added customers to represent an array of Customer objects o Removed guest field
  - Removed itemGroups
  - Updated discounts to be an array of Discount objects
  - Updated surcharges to be an array of Surcharge objects  - Updated Table object:
  - Renamed number to id
  - Added section to represent section table belongs to  - Updated Item object:
  - Updated discounts to be an array of Discount objects
  - Updated modifications to be a ModificationMap object


# Draft 3 Changes

- New orders are now delivered via webhooks. This is a replacement to long polling.
- Order Object:
  - Added locationId
  - Removed eventType. This is not needed since we moved away from long polling.
  - Removed subtotal
  - Removed payments
  - Added itemGroups
  - Discount is now a money object that also contains a detailed breakdown o Surcharge is now a money object that also contains a detailed breakdown
- Order Item Object:
  - Renamed posId to sku
  - Removed quantity
  - Removed surcharge
  - Discount is now a money object that also contains a detailed breakdown o Removed total
- Order Item Modification
  - Added a field modification that can either be: ADDITION, REMOVAL or INSTRUCTION
- Changed discount, surcharge and total fields on the order from numbers to a money object
- Changed unitPrice on the order item from numbers to a money object
- Changed update order status to be a json merge patch. (switch to PATCH http verb and specific Content-Type)
- Changed Item descriptions from per order to per item


# Draft 2 Changes

- Added Item Description (max 60 characters) to the API so that it can be communicated to the kitchen with unmatched items.
- Added externalId so that:
  1. The merchant can add this as a unique identifier to the docket if there is a chance 2 people with the same name might order around the same time.
  2. Merchants have a unique reference number for each order so that they can cross reference the order in the food order app or report provided by the app.
- The discount and surcharge fields were on an item level. They have been moved to the order object level.