Create Sale

This endpoint is used to send open or closed Sales to Tyro Connect. Please note, all items in a sale must be of an identical currency.

Request
Security:
header Parameters
Authorization
required
string
Default: Bearer {$$.env.access_token}
Request Body schema: application/json

When creating a sale, please try to include all the optional fields that are available.

locationId
required
string

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

required
object

Identifiers and reference numbers that were generated by the partner.

required
object

Information about the source of the sale.

type
required
string
Default: "SALE"

An enum describing what kind of sale took place.

Enum: "SALE" "REFUND" "VOID" "COMBINATION"
status
string
Default: "CLOSED"

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

Enum: "CLOSED" "OPEN" "REOPENED"
openedZonedDateTime
required
string <date-time>

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

closedZonedDateTime
string <date-time>

The time the sale was closed on the partner. 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.

parentSaleId
string

The original sale id referencing the previous sale that was reopened. Only allowed if the status is REOPENED and it must reference an existing sale id.

object
object

Information about which register in the venue was used

required
object

Details about the staff member who performed the transaction

object

The section within the venue where the sale took place.

object

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

bookingId
string

The booking ID defined by Tyro Connect to identify a reservation

Array of objects (Line Item)
Array of objects (Money Positive Amount With Description)
Array of objects (Money Positive Amount With Description)
object

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

Array of objects
object

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

Responses
201

If the Sale was successfully saved on the server you will receive a 201 Created and the created Sale.

409

If a Sale with the supplied origin.saleId, type and locationId already exist, and the incoming sale is different than the saved one, the server will respond with 409 Conflict.

post/sales
Request samples
application/json
{
  • "locationId": "luna-park",
  • "origin": {
    },
  • "source": {
    },
  • "type": "SALE",
  • "status": "CLOSED",
  • "openedZonedDateTime": "2018-05-02T08:28:13+10:00",
  • "closedZonedDateTime": "2018-05-02T08:28:13+10:00",
  • "staff": {
    },
  • "bookingId": "6dca53a9-04c7-46aa-991c-cfdf51a8f652",
  • "items": [
    ],
  • "payments": [
    ],
  • "tax": {
    },
  • "total": {
    }
}
Response samples
application/json
{
  • "id": "string",
  • "version": 0,
  • "locationId": "string",
  • "origin": {
    },
  • "source": {
    },
  • "type": "SALE",
  • "status": "CLOSED",
  • "openedZonedDateTime": "2018-05-02T08:28:13+10:00",
  • "closedZonedDateTime": "2018-05-02T08:28:13+10:00",
  • "parentSaleId": "string",
  • "customer": {
    },
  • "register": {
    },
  • "staff": {
    },
  • "section": {
    },
  • "table": {
    },
  • "bookingId": "string",
  • "items": [
    ],
  • "discounts": [
    ],
  • "surcharges": [
    ],
  • "tax": {
    },
  • "payments": [
    ],
  • "total": {
    },
  • "subtotal": {
    }
}
Copyright © Tyro Payments 2019-2024. All right reserved.