Sales

Query

sale — Returns Sale

Scopes Required: see_history

Arguments Type Description

id

ID!

The ID of the sale to retrieve

Example Query
query GetSale($id: ID!) {
    sale(id: $id) {
        id,
        clientId,
        status,
        accountSale,
        invoiceId
    }
}

# Example variables
{
    "id": "<ID>"
}

Query

sales — Returns ConnectionType of Sale

Scopes Required: see_history

Get the sales for the Vendor optionally filtering them, if startDate is not specified it defaults to three months ago, to retrieve all sales for the vendor, explicitly pass null to startDate

Sortable Fields

Fields from Sale that can be used to sort the connection items

  • createdAt
  • updatedAt
Arguments Type Description

startDate

DateTime

The date and time to get sales from (inclusive), defaults to three months ago

endDate

DateTime

The date and time to get sales to (inclusive)

invoiceId

String

The invoice ID (commonly called invoice number) of the invoices to retrieve, this could produce multiple sales as there is no guarantee that each invoice has a unique invoice id

orderReference

String

The order reference of the invoice to retrieve, this field is typically used by stores that sell to other businesses

paymentMethod

ID

Get sales that used the provided payment method

user

ID

Get sales that were completed by the provided user

register

ID

The register the sale occurred on

outlets

[ID]

The outlets to get sales from

status

[SaleStatusEnum]

Get the sales that have the provided statuses

discounted

Boolean

Whether to get only discounted sales (true is only discounted, false is all sales including discounted)

moreAmount

Float

Get sales which have a total price of more than this amount (inclusive)

lessAmount

Float

Get sales which have a total price of less than this amount (inclusive)

customer

ID

Get sales from the provided customer

product

ID

The sales which contain the provided product

returned

Boolean

Get sales that have returned products on (true is only sales that have returned items, false is all sales including returns)

id

ID

The UUID of the sale

ids

[ID!]

A list of IDs of the sales to retrieve, if id is also specified, it'll be appended to this list

giftCardCode

String

Get sales that involved the provided gift card code (either sold or paid for with)

clientId

String

The client ID of the sale

Example Query
query GetSales($startDate: DateTime) {
    sales(startDate: $startDate) {
        edges {
            node {
                id,
                clientId,
                status,
                accountSale,
                invoiceId
            }
        },
        pageInfo {
            hasNextPage,
            endCursor
        }
    }
}

# Example variables
{
    "startDate": "<START_DATE>"
}