Sales
Query
sale — Returns Sale
Scopes Required: see_history
| Arguments | Type | Description |
|---|---|---|
|
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 |
The date and time to get sales from (inclusive), defaults to three months ago |
|
|
endDate |
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 |
Get sales that used the provided payment method |
|
|
user |
Get sales that were completed by the provided user |
|
|
register |
The register the sale occurred on |
|
|
outlets |
The outlets to get sales from |
|
|
status |
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 |
Get sales from the provided customer |
|
|
product |
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 |
The UUID of the sale |
|
|
ids |
A list of IDs of the sales to retrieve, if |
|
|
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>"
}