This is the API for Apps looking to implement sales data on Tyro Connect
Sales Data API (1.1)
Request
This endpoint returns all the sales of a given location. The list of sales is paginated and it is possible to apply filters to the sales being fetched.
The filtering options use an "OR" clause within the same filter criteria and an "AND" clause between criteria.
This means that a request with saleStatus=OPEN&saleType=SALE will return the sales that were OPEN and that of type SALE.
A request with saleType=SALE&saleType=REFUND will return the sales that have either sale type SALE or REFUND.
The paginated results are ordered using the sequence they were created in the Tyro Connect. For example results[0] on page 1 is the first matching sale that was created in the Tyro Connect system.
The Tyro Connect Location Id of the sales to be retrieved. This parameter is required.
Returns results based on the type of a sale.
Can be a single string or multi string value.
Returns results that have a "startTime" later than or equal to the provided value.
Format: YYYY-MM-DD
Returns results that have a "startTime" before than or equal to the provided value.
Format: YYYY-MM-DD
Specifies the date type of the 'fromDate' and 'toDate' parameters.
Specifies the amount of results to be retrieved.
A maximum of 50 results are returned if this value is not provided.
Specify the page to retrieve.
You will need to use this setting if you wish to retrieve specific pages.
Page-numbering is based on the value of "limit". If limit=5, then page=1 will display the hits from 1 to 5, page=3 will display the hits from 11 to 15.
Page numbers start at 1.
A request for a non-existing page will yield 0 results.
- Productionhttps://api.tyro.com/connect/sales
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api.tyro.com/connect/sales?locationId=luna-park&saleStatus=OPEN&saleType=COMBINATION&fromDate=2023-04-29&toDate=2023-04-28&dateType=CREATED&limit=10&page=2' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'The sales list
The results for the location that satisfy the filtering criteria
The current version of the Sale. The most update to date version needs to be provided when making updates.
This is the Tyro Connect defined location Id. It is a globally unique identifier that is used to identify a merchants individual site
Identifiers and reference numbers that were generated by the partner.
Information about the source of the sale.
An enum describing what kind of sale took place.
An enum describing the status of the sale. A closed sale cannot be opened.
The time the sale was opened on the partner. The format of the date time is the notation as defined by RFC 3339, section 5.6
The time the sale was closed on the partner. The format of the date time is the notation as defined by RFC 3339, section 5.6
Details about the staff member who performed the transaction
The total amount (in cents) of tax collected for this sale by the merchant.
The total (in cents) of this sale after tax, discounts, modifiers and rounding have been applied.
{ "pagination": { "page": 1, "size": 2, "limit": 10, "total": 2 }, "results": [ { … }, { … } ] }
- Productionhttps://api.tyro.com/connect/sales/{saleId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api.tyro.com/connect/sales/{saleId}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'The sales response
The current version of the Sale. The most update to date version needs to be provided when making updates.
This is the Tyro Connect defined location Id. It is a globally unique identifier that is used to identify a merchants individual site
Identifiers and reference numbers that were generated by the partner.
Information about the source of the sale.
An enum describing what kind of sale took place.
An enum describing the status of the sale. A closed sale cannot be opened.
The time the sale was opened on the partner. The format of the date time is the notation as defined by RFC 3339, section 5.6
The time the sale was closed on the partner. The format of the date time is the notation as defined by RFC 3339, section 5.6
Details about the staff member who performed the transaction
The total amount (in cents) of tax collected for this sale by the merchant.
The total (in cents) of this sale after tax, discounts, modifiers and rounding have been applied.
- Example Sale
- Combination Sale
{ "version": 69, "locationId": "luna-park", "origin": { "saleId": "SaleId" }, "source": { "type": "MEANDU" }, "type": "SALE", "status": "CLOSED", "openedZonedDateTime": "2018-05-02T08:28:13+10:00", "closedZonedDateTime": "2018-05-02T08:28:13+10:00", "staff": { "id": "8675309" }, "bookingId": "6dca53a9-04c7-46aa-991c-cfdf51a8f652", "items": [ { … } ], "payments": [ { … } ], "tax": { "amount": 123, "currency": "AUD" }, "total": { "amount": 369, "currency": "AUD" }, "table": { "seats": 1, "number": "11" }, "subtotal": { "amount": 369, "currency": "AUD" } }
Request
This endpoint is used to updates Sales. Please note, updates with the same contents are ignored and all items in a sale must be of an identical currency.
Represents the last read version of the sale returned by the GET request. If this version is out of date, the request will fail with a 412. Get the latest sale and merge it with the values from this request, then retry with the latest version.
An enum describing the status of the sale. Once the sale has been closed, it cannot be reopened.
The time the sale was closed on the POS. closedZonedDateTime is required when the status is CLOSED otherwise optional. The format of the date time is the notation as defined by RFC 3339, section 5.6.
Provide only the existing items for the sale, including all the fields that have not been modified. You can only modify discounts, surcharges, total and tax for each existing item.
Provide existing & new discounts to be applied to the sale. The update will do a complete array replacement so any discounts not provided in this request will be removed.
Provide existing & new surcharges to be applied to the sale. The update will do a complete array replacement so any surcharges not provided in this request will be removed.
The total amount (in cents) of tax collected for this sale by the merchant. This must be updated when the total changes.
Provide all existing & new payments to be applied to the sale. Existing payments cannot be removed.
- Productionhttps://api.tyro.com/connect/sales/{saleId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PATCH \
'https://api.tyro.com/connect/sales/{saleId}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"version": 0,
"status": "CLOSED",
"closedZonedDateTime": "2018-05-02T08:28:13+10:00",
"items": [
{
"id": "string",
"name": "string",
"category": "string",
"description": "string",
"sku": "string",
"barcode": "string",
"modifiers": [
{}
],
"unitPrice": {
"amount": 12520,
"currency": "AUD"
},
"unitPriceTax": {
"amount": 12520,
"currency": "AUD"
},
"unitCost": {
"amount": 12520,
"currency": "AUD"
},
"unitCostTax": {
"amount": 12520,
"currency": "AUD"
},
"discounts": [
{
"amount": 12520,
"currency": "AUD",
"description": "Tuesday Happy Hour Discount"
}
],
"sale": {
"type": "SALE"
},
"surcharges": [
{
"amount": 12520,
"currency": "AUD",
"description": "Tuesday Happy Hour Discount"
}
],
"quantity": 0,
"tax": {
"amount": 12520,
"currency": "AUD"
},
"total": {
"amount": 12520,
"currency": "AUD"
},
"hidden": true
}
],
"discounts": [
{
"amount": 12520,
"currency": "AUD",
"description": "Tuesday Happy Hour Discount"
}
],
"surcharges": [
{
"amount": 12520,
"currency": "AUD",
"description": "Tuesday Happy Hour Discount"
}
],
"tax": {
"amount": 12520,
"currency": "AUD"
},
"payments": [
{
"acquirer": {
"name": "TYRO",
"transactionReference": "string",
"terminalId": "string"
},
"method": "EFTPOS",
"type": "SALE",
"goodsAndServicesAmount": {
"amount": 12520,
"currency": "AUD"
},
"tipAmount": {
"amount": 12520,
"currency": "AUD"
},
"cashoutAmount": {
"amount": 12520,
"currency": "AUD"
},
"surchargeAmount": {
"amount": 12520,
"currency": "AUD"
},
"items": [
{
"itemId": "string",
"total": {
"amount": 12520,
"currency": "AUD"
}
}
]
}
],
"total": {
"amount": 12520,
"currency": "AUD"
}
}'If the Sale was successfully updated on the server you will receive a 200 OK and the updated Sale with a new version.
The current version of the Sale. The most update to date version needs to be provided when making updates.
This is the Tyro Connect defined location Id. It is a globally unique identifier that is used to identify a merchants individual site
Identifiers and reference numbers that were generated by the partner.
Information about the source of the sale.
An enum describing what kind of sale took place.
An enum describing the status of the sale. A closed sale cannot be opened.
The time the sale was opened on the partner. The format of the date time is the notation as defined by RFC 3339, section 5.6
The time the sale was closed on the partner. The format of the date time is the notation as defined by RFC 3339, section 5.6
Details about the staff member who performed the transaction
The total amount (in cents) of tax collected for this sale by the merchant.
The total (in cents) of this sale after tax, discounts, modifiers and rounding have been applied.
{ "id": "string", "version": 0, "locationId": "string", "origin": { "saleId": "string", "locationId": "string" }, "source": { "type": "DELIVEROO", "other": "string" }, "type": "SALE", "status": "CLOSED", "openedZonedDateTime": "2018-05-02T08:28:13+10:00", "closedZonedDateTime": "2018-05-02T08:28:13+10:00", "parentSaleId": "string", "customer": { "id": "string" }, "register": { "id": "string", "name": "string" }, "staff": { "id": "string" }, "section": { "id": "string", "name": "string" }, "table": { "number": "MAIN-33", "seats": 0 }, "bookingId": "string", "items": [ { … } ], "discounts": [ { … } ], "surcharges": [ { … } ], "tax": { "amount": 12520, "currency": "AUD" }, "payments": [ { … } ], "total": { "amount": 12520, "currency": "AUD" }, "subtotal": { "amount": 12520, "currency": "AUD" } }