# Sales Data API

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


Version: 1.1

## Servers

Production
```
https://api.tyro.com/connect
```

## Security

### JWT

Type: openIdConnect
OpenID Connect URL: https://auth.connect.tyro.com/.well-known/openid-configuration

## Download OpenAPI description

[Sales Data API](https://docs.connect.tyro.com/_bundle/app/apis/sales/1.1/index.yaml)

## Other

### List Sales

 - [GET /sales](https://docs.connect.tyro.com/app/apis/sales/1.1/other/list-sales-1.1.md): 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.

### Get Sales Data by SalesId

 - [GET /sales/{saleId}](https://docs.connect.tyro.com/app/apis/sales/1.1/other/get-sale-1.1.md): This endpoint is for fetching the details of a sale.

### Update Sale

 - [PATCH /sales/{saleId}](https://docs.connect.tyro.com/app/apis/sales/1.1/other/update-sale-1.1.md): 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.

