Skip to content

Sales Data API (1.1)

This is the API for Apps looking to implement sales data on Tyro Connect

Overview
Languages
Servers
Production
https://api.tyro.com/connect

List Sales

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.

Filtering

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.

Pagination

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.

Security
JWT
Query
locationIdstringrequired

The Tyro Connect Location Id of the sales to be retrieved. This parameter is required.

Example: locationId=luna-park
saleStatusstring

Returns results based on the status of a sale.

Enum"OPEN""CLOSED""REOPENED"
saleTypestring

Returns results based on the type of a sale.

Can be a single string or multi string value.

Enum"COMBINATION""SALE""REFUND""VOID"
fromDatestring(date)

Returns results that have a "startTime" later than or equal to the provided value.

Format: YYYY-MM-DD

Example: fromDate=2023-04-29
toDatestring

Returns results that have a "startTime" before than or equal to the provided value.

Format: YYYY-MM-DD

Example: toDate=2023-04-28
dateTypestring

Specifies the date type of the 'fromDate' and 'toDate' parameters.

Default "CREATED"
Enum"CREATED""UPDATED""OPENED""CLOSED"
limitnumber[ 1 .. 50 ]

Specifies the amount of results to be retrieved.

A maximum of 50 results are returned if this value is not provided.

Example: limit=10
pagenumber>= 1

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.

Example: page=2
Headers
Authorizationstringrequired
Default Bearer {$$.env.access_token}
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>'

Responses

The sales list

Bodyapplication/json
resultsArray of objects(Sale)required

The results for the location that satisfy the filtering criteria

results[].​idstringrequired

The sale id provided by Tyro

results[].​versionnumberrequired

The current version of the Sale. The most update to date version needs to be provided when making updates.

results[].​locationIdstringrequired

This is the Tyro Connect defined location Id. It is a globally unique identifier that is used to identify a merchants individual site

results[].​originobjectrequired

Identifiers and reference numbers that were generated by the partner.

results[].​origin.​saleIdstringrequired

The Id of the sale generated by the partner. This value should allow for partner systems to reconcile this sale.

results[].​origin.​locationIdstringrequired

The Id of the store according to the partner.

results[].​sourceobjectrequired

Information about the source of the sale.

results[].​source.​typestringrequired

An enum describing the source type of the sale.

Enum"DELIVEROO""DOORDASH""GOOGLE""HEYYOU""HUNGRYHUNGRY""MEANDU""MENULOG""MRYUM""ORDERUP""OTHER"
results[].​source.​otherstring

The source of the sale if the source type is OTHER.

results[].​typestringrequired

An enum describing what kind of sale took place.

Default "SALE"
Enum"SALE""REFUND""VOID""COMBINATION"
results[].​statusstring

An enum describing the status of the sale. A closed sale cannot be opened.

Default "CLOSED"
Enum"CLOSED""OPEN""REOPENED"
results[].​openedZonedDateTimestring(date-time)required

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

Example: "2018-05-02T08:28:13+10:00"
results[].​closedZonedDateTimestring(date-time)

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

Example: "2018-05-02T08:28:13+10:00"
results[].​parentSaleIdstring

The original sale id referencing the previous sale that was reopened.

results[].​customerobject
results[].​registerobject

Information about which register in the venue was used

results[].​staffobjectrequired

Details about the staff member who performed the transaction

results[].​staff.​idstringrequired

The id of the staff member in the POS system. Please do not put the staff members name here

results[].​sectionobject

The section within the venue where the sale took place.

results[].​tableobject

Optional information about the table where in the venue the sale took place.

results[].​bookingIdstring

The booking ID defined by Tyro Connect to identify a reservation

results[].​itemsArray of objects(Line Item)
results[].​discountsArray of objects(Money Positive Amount)
results[].​surchargesArray of objects(Money Positive Amount)
results[].​taxobject(Money Positive Amount)

The total amount (in cents) of tax collected for this sale by the merchant.

results[].​paymentsArray of objects
results[].​totalobject(Money Positive Amount)

The total (in cents) of this sale after tax, discounts, modifiers and rounding have been applied.

results[].​subtotalobject(Money Positive Amount)

The subtotal (in cents) of this sale.

paginationobjectrequired
pagination.​pageinteger>= 1required
pagination.​sizeintegerrequired
pagination.​limitintegerrequired
pagination.​totalintegerrequired
Response
application/json
{ "pagination": { "page": 1, "size": 2, "limit": 10, "total": 2 }, "results": [ {}, {} ] }

Get Sales Data by SalesId

Request

This endpoint is for fetching the details of a sale.

Security
JWT
Path
saleIdstringrequired
Headers
Authorizationstringrequired
Default Bearer {$$.env.access_token}
curl -i -X GET \
  'https://api.tyro.com/connect/sales/{saleId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

The sales response

Bodyapplication/json
idstringrequired

The sale id provided by Tyro

versionnumberrequired

The current version of the Sale. The most update to date version needs to be provided when making updates.

locationIdstringrequired

This is the Tyro Connect defined location Id. It is a globally unique identifier that is used to identify a merchants individual site

originobjectrequired

Identifiers and reference numbers that were generated by the partner.

origin.​saleIdstringrequired

The Id of the sale generated by the partner. This value should allow for partner systems to reconcile this sale.

origin.​locationIdstringrequired

The Id of the store according to the partner.

sourceobjectrequired

Information about the source of the sale.

source.​typestringrequired

An enum describing the source type of the sale.

Enum"DELIVEROO""DOORDASH""GOOGLE""HEYYOU""HUNGRYHUNGRY""MEANDU""MENULOG""MRYUM""ORDERUP""OTHER"
source.​otherstring

The source of the sale if the source type is OTHER.

typestringrequired

An enum describing what kind of sale took place.

Default "SALE"
Enum"SALE""REFUND""VOID""COMBINATION"
statusstring

An enum describing the status of the sale. A closed sale cannot be opened.

Default "CLOSED"
Enum"CLOSED""OPEN""REOPENED"
openedZonedDateTimestring(date-time)required

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

Example: "2018-05-02T08:28:13+10:00"
closedZonedDateTimestring(date-time)

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

Example: "2018-05-02T08:28:13+10:00"
parentSaleIdstring

The original sale id referencing the previous sale that was reopened.

customerobject
registerobject

Information about which register in the venue was used

staffobjectrequired

Details about the staff member who performed the transaction

staff.​idstringrequired

The id of the staff member in the POS system. Please do not put the staff members name here

sectionobject

The section within the venue where the sale took place.

tableobject

Optional information about the table where in the venue the sale took place.

bookingIdstring

The booking ID defined by Tyro Connect to identify a reservation

itemsArray of objects(Line Item)
discountsArray of objects(Money Positive Amount)
surchargesArray of objects(Money Positive Amount)
taxobject(Money Positive Amount)

The total amount (in cents) of tax collected for this sale by the merchant.

paymentsArray of objects
totalobject(Money Positive Amount)

The total (in cents) of this sale after tax, discounts, modifiers and rounding have been applied.

subtotalobject(Money Positive Amount)

The subtotal (in cents) of this sale.

Response
application/json
{ "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" } }

Update Sale

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.

Security
JWT
Headers
Authorizationstringrequired
Default Bearer {$$.env.access_token}
Bodyapplication/json
versionnumberrequired

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.

statusstring

An enum describing the status of the sale. Once the sale has been closed, it cannot be reopened.

Default "CLOSED"
Enum"CLOSED""OPEN"
closedZonedDateTimestring(date-time)

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.

Example: "2018-05-02T08:28:13+10:00"
itemsArray of objects(Line Item)

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.

discountsArray of objects(Money Positive Amount)

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.

surchargesArray of objects(Money Positive Amount)

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.

taxobject(Money Positive Amount)

The total amount (in cents) of tax collected for this sale by the merchant. This must be updated when the total changes.

paymentsArray of objects

Provide all existing & new payments to be applied to the sale. Existing payments cannot be removed.

totalobject(Money Positive Amount)

The total (in cents) of this sale. This must be updated when items, discounts or surcharges are added. It is expected to calculate to: sum(items[].total) - discounts + surcharges

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"
    }
  }'

Responses

If the Sale was successfully updated on the server you will receive a 200 OK and the updated Sale with a new version.

Bodyapplication/json
idstringrequired

The sale id provided by Tyro

versionnumberrequired

The current version of the Sale. The most update to date version needs to be provided when making updates.

locationIdstringrequired

This is the Tyro Connect defined location Id. It is a globally unique identifier that is used to identify a merchants individual site

originobjectrequired

Identifiers and reference numbers that were generated by the partner.

origin.​saleIdstringrequired

The Id of the sale generated by the partner. This value should allow for partner systems to reconcile this sale.

origin.​locationIdstringrequired

The Id of the store according to the partner.

sourceobjectrequired

Information about the source of the sale.

source.​typestringrequired

An enum describing the source type of the sale.

Enum"DELIVEROO""DOORDASH""GOOGLE""HEYYOU""HUNGRYHUNGRY""MEANDU""MENULOG""MRYUM""ORDERUP""OTHER"
source.​otherstring

The source of the sale if the source type is OTHER.

typestringrequired

An enum describing what kind of sale took place.

Default "SALE"
Enum"SALE""REFUND""VOID""COMBINATION"
statusstring

An enum describing the status of the sale. A closed sale cannot be opened.

Default "CLOSED"
Enum"CLOSED""OPEN""REOPENED"
openedZonedDateTimestring(date-time)required

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

Example: "2018-05-02T08:28:13+10:00"
closedZonedDateTimestring(date-time)

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

Example: "2018-05-02T08:28:13+10:00"
parentSaleIdstring

The original sale id referencing the previous sale that was reopened.

customerobject
registerobject

Information about which register in the venue was used

staffobjectrequired

Details about the staff member who performed the transaction

staff.​idstringrequired

The id of the staff member in the POS system. Please do not put the staff members name here

sectionobject

The section within the venue where the sale took place.

tableobject

Optional information about the table where in the venue the sale took place.

bookingIdstring

The booking ID defined by Tyro Connect to identify a reservation

itemsArray of objects(Line Item)
discountsArray of objects(Money Positive Amount)
surchargesArray of objects(Money Positive Amount)
taxobject(Money Positive Amount)

The total amount (in cents) of tax collected for this sale by the merchant.

paymentsArray of objects
totalobject(Money Positive Amount)

The total (in cents) of this sale after tax, discounts, modifiers and rounding have been applied.

subtotalobject(Money Positive Amount)

The subtotal (in cents) of this sale.

Response
application/json
{ "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" } }