Sales
Example Mutation
mutation ChangeSaleItemReadyStatus($sale: ID!, $items: [ID!]!, $ready: Boolean!) {
changeSaleItemReadyStatus(sale: $sale, items: $items, ready: $ready) {
id,
clientId,
status,
accountSale,
invoiceId
}
}
# Example variables
{
"sale": "<SALE>",
"items": [
"<ITEMS>"
],
"ready": "<READY>"
}Mutation
createSale — Returns Sale
Scopes Required: sell
| Arguments | Type | Description |
|---|---|---|
|
sale |
The sale to upload |
|
|
checkDuplicates |
Boolean |
Whether we should check if this is a duplicate sale |
|
deleteLinked |
Boolean |
Whether to delete the linked sale (only if the linked sale was parked), defaults to false |
|
preventCancellation |
Boolean |
Whether to prevent the sale from being voided, default to false |
Example Mutation
mutation CreateSale($sale: SaleInput) {
createSale(sale: $sale) {
id,
clientId,
status,
accountSale,
invoiceId
}
}
# Example variables
{
"sale": {
"register": "<REGISTER>",
"user": "<USER>",
"status": "COMPLETED",
"items": [
{
"total": "<TOTAL>"
}
],
"payments": [
{
"method": "<METHOD>",
"amount": "<AMOUNT>"
}
]
}
}Example Mutation
mutation UnparkSale($id: ID!) {
unparkSale(id: $id) {
id,
clientId,
status,
accountSale,
invoiceId
}
}
# Example variables
{
"id": "<ID>"
}Mutation
updateSale — Returns Sale
No scope required
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the sale to update |
|
|
register |
The register to update the sale to |
|
|
search |
Search criteria to find the sale |
|
|
user |
The user to update the sale to |
|
|
customer |
The customer to assign to the sale |
|
|
saleTime |
The date and time to update the sale to |
|
|
payments |
The payments to adjust on the sale |
|
|
note |
String |
The external note to adjust on the sale |
|
internalNote |
String |
The internal note to adjust on the sale |
|
modifyReason |
String! |
The reason the sale was modified |
Example Mutation
mutation UpdateSale($modifyReason: String!) {
updateSale(modifyReason: $modifyReason) {
id,
clientId,
status,
accountSale,
invoiceId
}
}
# Example variables
{
"modifyReason": "<MODIFY_REASON>"
}Mutation
voidSale — Returns Sale
Scopes Required: history_cancel_sale
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the sale to void |
|
|
voidReason |
String |
The reason the sale is being voided (this will update the sale's modifiedReason) |
Example Mutation
mutation VoidSale($id: ID!) {
voidSale(id: $id) {
id,
clientId,
status,
accountSale,
invoiceId
}
}
# Example variables
{
"id": "<ID>"
}