# Objects / Sales

# Sales

**Object**
## SaleAction

> <p>The value below corresponds to the type of action that was taken:</p>
> <ul>
> <li>Product / customer scan: the barcode scanned</li>
> <li>Product / customer search: the string searched</li>
> <li>Product / customer key: the key's rules</li>
> <li>Quantity override: the new quantity</li>
> <li>Increment / decrement quantity: the amount incremented / decrement</li>
> <li>Remove product: "keyboard" or "trash"</li>
> <li>Remove customer: an empty string</li>
> <li>Add / remove payment: the index of the payment method</li>
> </ul>

| Fields | Type | Description |
| --- | --- | --- |
| action | [SaleActionEnum!](/documentation/Enums/Sale-Action-Enum#SaleActionEnum) | The action that was performed |
| value | *String!* | The value of the action performed |
| affecting | [SaleActionAffectingInterface!](/documentation/Interfaces/Sale-Action-Affecting-Interface#SaleActionAffectingInterface) | The item this action has affected |
| user | [User!](/documentation/Objects/User#User) | The user who performed the action |
| timestamp | [DateTime!](/documentation/Types/Date-Time#DateTime) | The time the action occurred |



**Object**
## SaleDiscount

| Fields | Type | Description |
| --- | --- | --- |
| amount | *String* | The discount amount |
| reason | *String* | The reason the discount was applied |



**Object**
## SaleItemContained

| Fields | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of this line |
| parentId | [ID](/documentation/Types/UUID#UUID) | The ID of the parent line |
| saleItemId | [ID](/documentation/Types/UUID#UUID) | The ID of the sale line it relates to |
| item | [SellableInterface](/documentation/Interfaces/Sellable-Interface#SellableInterface) | The full item that this is |
| quantity | *Float* | How many of the item was used |
| price | *Float* | The adjustment price for this item |



**Object**
## SaleItem

| Fields | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the line |
| quantity | *Float* | The quantity sold |
| caseQuantity | *Float* | The case quantity of the item at the time of the sale |
| loyaltyValue | *Float* | The loyalty value (in points) |
| cost | *Float* | The cost of the item for the sale |
| note | *String* | An externally visible note relating to the item |
| basePrice | *Float* | The base price for the product (without discounts and savings) |
| discount | [SaleDiscount](/documentation/Objects/Sales#SaleDiscount) | The discount for the item |
| savings | *Float* | The promotional savings for the item |
| tax | *Float* | The total amount of tax paid for the item |
| taxRate | [TaxRate](/documentation/Objects/Tax-Rate#TaxRate) | The tax rate used at the time of the sale |
| totalPrice | *Float* | The total price for the item (what the item was sold for) |
| promotions | [[SalePromotion]](/documentation/Objects/Sales#SalePromotion) | A list of promotions that were applied to the item |
| kitchenReadyAt | [DateTime](/documentation/Types/Date-Time#DateTime) | The time the kitchen marked this item as ready to serve |
| contains | [[SaleItemContained]](/documentation/Objects/Sales#SaleItemContained) | A list of items that were contained within this item (used for basket products and packages) |
| item | [SellableInterface](/documentation/Interfaces/Sellable-Interface#SellableInterface) | The item that was sold |
| metaData | [JSON](/documentation/Types/JSON#JSON) | Any related miscellaneous data |



**Object**
## SalePayment

| Fields | Type | Description |
| --- | --- | --- |
| id | *Int* | The ID of the payment line |
| paymentMethod | [PaymentMethod](/documentation/Objects/Payment-Method#PaymentMethod) | The payment method used |
| subtype | *String* | The "subtype" of the payment made on the sale if originally provided (e.g. VISA / MASTERCARD for EFTPOS) |
| register | [Register](/documentation/Objects/Register#Register) | The register that the payment method was paid at |
| status | [PaymentStatusEnum](/documentation/Enums/Payment-Status-Enum#PaymentStatusEnum) | The status of the payment |
| amount | *Float* | The amount of money spent on the payment method |
| rounding | *Float* | How much rounding was applied to the payment |
| cashout | *Float* | How much money was withdrawn by the customer at the time of the payment |
| processTime | [DateTime](/documentation/Types/Date-Time#DateTime) | The time the payment occurred |
| metaData | [JSON](/documentation/Types/JSON#JSON) | Any related miscellaneous data |
| sale | [Sale](/documentation/Objects/Sales#Sale) | The sale that the payment method was used on |
| customerPayment | [CustomerPayment](/documentation/Objects/Customers#CustomerPayment) | The customer payment that is attached to this payment, if null this payment was paid at the time of the transaction |
| receipt | *String* | The integrated receipt for this payment method |
| cancelledAt | [DateTime](/documentation/Types/Date-Time#DateTime) | The time the payment was cancelled |



**Object**
## SalePromotion

| Fields | Type | Description |
| --- | --- | --- |
| promotion | [Promotion](/documentation/Objects/Promotions#Promotion) | The promotion that was used |
| rebateAmount | *Float* | The total value of the rebate that was applied |
| rebateQuantity | *Float* | The quantity of the rebate |
| savings | *Float* | How much money was saved by using this promotion |
| quantity | *Float* | How many times the promotion was applied to the item |



**Object**
## Sale

### Implements
*List of interfaces this object implements*

- [InventoryLogEventInterface](/documentation/Interfaces/Inventory-Log-Event-Interface#InventoryLogEventInterface)

| Fields | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the sale |
| clientId | *String* | The local ID of the sale |
| linkedSale | [Sale](/documentation/Objects/Sales#Sale) | A sale this is linked to (for a return for example) |
| register | [Register](/documentation/Objects/Register#Register) | The register that the sale was performed at |
| user | [User](/documentation/Objects/User#User) | The user who performed the sale |
| customer | [Customer](/documentation/Objects/Customers#Customer) | The customer who the sale is for |
| status | [SaleStatusEnum!](/documentation/Enums/Sale-Status-Enum#SaleStatusEnum) | The current status of the sale |
| accountSale | *Boolean* | Whether the sale was put on account |
| invoiceId | *String!* | The ID of the invoice (normally numbers, but can contain any string) (typically called "invoice number") |
| note | *String* | A public note for the sale |
| internalNote | *String* | An internal note for the sale |
| orderReference | *String!* | The order reference for this sale, typically used when selling products to other companies, this will mostly be blank |
| discount | [SaleDiscount](/documentation/Objects/Sales#SaleDiscount) | Any discounts that were applied to the sale |
| loyaltyValue | *Float* | The loyalty value (in points) for the sale |
| totalSingles | *Int* | How many singles were sold on the sale |
| totalCases | *Int* | How many cases were sold on the sale |
| totalQuantity | *Int* | The total quantity sold on the sale |
| totalCost | *Float* | The total cost of the sale |
| totalBase | *Float* | The base price for the sale (without discounts and promotions) |
| totalSavings | *Float* | The total promotional savings for the sale |
| totalDiscount | *Float* | The total discount for the sale |
| totalTax | *Float* | The total tax for the sale |
| cashout | *Float* | The total amount of money withdrawn by the customer |
| totalChange | *Float* | The total amount of change provided to the customer |
| totalRounding | *Float* | The total amount of rounding on the sale |
| totalPrice | *Float* | The total price for the sale |
| outstanding | *Float* | The amount of money left unpaid on this sale |
| modifyReason | *String* | The reason the sale was modified |
| refundReason | *String* | The reason this sale was refunded |
| metaData | [JSON!](/documentation/Types/JSON#JSON) | Customisable unstructured meta data related to the sale |
| items | [[SaleItem]!](/documentation/Objects/Sales#SaleItem) | The items that were sold on this sale |
| payments | [[SalePayment]!](/documentation/Objects/Sales#SalePayment) | The payments made on this sale |
| actions | [[SaleAction]!](/documentation/Objects/Sales#SaleAction) | The actions that occurred during the sale |
| createdAt | [DateTime](/documentation/Types/Date-Time#DateTime) | The time the sale was created / processed |
| updatedAt | [DateTime](/documentation/Types/Date-Time#DateTime) | The last time the sale was updated |
| uploadedAt | [DateTime](/documentation/Types/Date-Time#DateTime) | The time the sale was uploaded to the server |
| revisions | [SaleRevisionConnection](#SaleRevisionConnection) | The revisions for the sale |
| isCancellable | *Boolean!* | Whether the sale can be cancelled |

## SaleRevisionConnection
#### Object  —  [ConnectionType](/documentation/General/Connections) of [Revision](/documentation/Objects/Revision#Revision)

### Sortable Fields
*Fields from [Revision](/documentation/Objects/Revision#Revision) that can be used to sort the connection items*

- timestamp



**Object**
## Surcharge

### Implements
*List of interfaces this object implements*

- [SellableInterface](/documentation/Interfaces/Sellable-Interface#SellableInterface)

| Fields | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the surcharge (this is always `04000000000000000000000000000000`) |