You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
You are viewing the article in preview mode. It is not live at the moment.
SaleItems API
print icon
SaleItems API
 

Saleitems is the main sales table holding receipt information. You can add and view SaleItems only, never edit or delete them. SaleItems are Receipts that have happened. If you want to look at sales in progress look at TableSaleitems instead.

If you are retrieving SaleItems you should use Receipts API first to get the latest receipts. Please see receipts-api

There are two methods available for saleitems :

  1. Return full detail on a single saleitem order
  2. Add a saleitem
List all saleitems

End Point: https://api.myposconnect.com/api/v2/saleitems/{identifier}

Verb: GET

Example Call 1: https://api.myposconnect.com/api/v2/saleitems/0001234?isCodeLookup=true

Example Call 2: https://api.myposconnect.com/api/v2/saleitems/3f162966-20d9-40b5-a945-21555f4b4e7d

Return Codes: 200 for success, with the body containing the JSON for the sale items. For other possible (more general) return codes please see API Build Basics

Important: Replace the “{identifier}” marker in the given endpoint URL with a valid “receiptId” or “receiptCode” – nb if you supply a “receiptCode” then you must append a querystring argument to the URL called “isCodeLookup” and set it to “true”, you do not need to add this if you are retrieving by “receiptId”. The JSON you receive back from this method is a SaleItems wrapper object containing full SaleItem objects as shown in the appendices of this document

Example JSON Object
Single line item sales order

   { 
       "items": [ 
         { 
       "effectiveDate": "2022-03-08T00:00:00", 
       "receiptId": "f349b36f-26b9-4a78-903c-f4297ad5122f", 
       "receiptCode": "88123456", 
       "sessionId": "f349b36f-26b9-4a78-903c-f4297ad5122f", 
       "sessionCode": "888510012", 
       "productId": "aaa47831-24d0-4506-947c-d32918a10f9f", 
       "itemCode": "98265247234696", 
       "itemDescription": "Baby Chair", 
       "itemShortDescription": "Baby Chair", 
       "quantity": 1.00000, 
       "itemPrice": 200.00000, 
       "itemValue": 200.0000, 
       "itemCurValue": 200.0000, 
       "overrideValue": null, 
       "currencyCode": "GBP", 
       "taxCode": "20%", 
       "taxRate": 20.00000, 
       "taxValue": 40.00000, 
       "promotionCode": "", 
       "posted": "X", 
       "printed": 1, 
       "itemType": "P", 
       "customerId": "3b2ebefc-5b81-483f-8b4e-74f411195ad4", 
       "rewardPoints": null, 
       "inserted": "2022-03-08T16:47:19.75", 
       "bacsId": null, 
       "isTransferred": true, 
       "transferDate": null, 
       "reasonCodeType": "", 
       "paymentAttempts": null, 
       "stockQuantity": null, 
       "isTaxable": true, 
       "commissionType": null, 
       "commissionValue": 0.00000, 
       "stockAdjustmentId": null, 
       "modifierGroup": "", 
       "printSort": 0, 
       "cardTransactionInfo01": null, 
       "cardTransactionInfo02": null, 
       "linkedSaleItemId": "00000000-0000-0000-0000-000000000000", 
       "linkedPurchaseOrderItemId": null, 
       "itemSubType": null, 
       "lastEditUser": "WEB1001", 
       "creationUser": "WEB1001", 
       "lastEditDevice": "WEB1001", 
       "creationDevice": "WEB1001", 
       "lastEditDate": "2022-03-08T16:47:19.75", 
       "creationDate": "2022-03-08T16:47:19.39" 
       } 
       , 
       >{ 
       "effectiveDate": "2022-03-08T00:00:00", 
       "receiptId": "f349b36f-26b9-4a78-903c-f4297ad5122f", 
       "receiptCode": "88123456", 
       "sessionId": "f349b36f-26b9-4a78-903c-f4297ad5122f", 
       "sessionCode": "888510012", 
       "itemCode": "Website", 
       "itemDescription": "Payment made on website", 
       "itemShortDescription": "Payment website", 
       "quantity": 1.00000, 
       "itemPrice": -200.00000, 
       "itemValue": -200.0000, 
       "itemCurValue": -200.0000, 
       "overrideValue": null, 
       "currencyCode": "GBP", 
       "taxCode": "NONE", 
       "taxRate": 0.00000, 
       "taxValue": 0.00000, 
       "promotionCode": "", 
       "posted": "X", 
       "printed": 1, 
       "itemType": "E", 
       "customerId": "3b2ebefc-5b81-483f-8b4e-74f411195ad4", 
       "rewardPoints": null, 
       "inserted": "2022-03-08T16:47:19.75", 
       "bacsId": null, 
       "isTransferred": true, 
       "transferDate": null, 
       "reasonCodeType": "", 
       "paymentAttempts": null, 
       "stockQuantity": null, 
       "isTaxable": true, 
       "commissionType": null, 
       "commissionValue": 0.00000, 
       "stockAdjustmentId": null, 
       "modifierGroup": "", 
       "printSort": 0, 
       "cardTransactionInfo01": null, 
       "cardTransactionInfo02": null, 
       "linkedSaleItemId": "00000000-0000-0000-0000-000000000000", 
       "linkedPurchaseOrderItemId": null, 
       "itemSubType": null, 
       "lastEditUser": "WEB1001", 
       "creationUser": "WEB1001", 
       "lastEditDevice": "WEB1001", 
       "creationDevice": "WEB1001", 
       "lastEditDate": "2022-03-08T16:47:19.75", 
       "creationDate": "2022-03-08T16:47:19.39" 
       } 
       ] 
   }

Add a Sales Receipt

End Point: https://api.myposconnect.com/api/v2/saleitems

Verb: POST

Return Codes: 202 (Accepted) for success. 400 (BadRequest) for failure, see the body for more details. For other possible (more general) return codes please see API Build Basics

Important: Post a valid “SaleItems” wrapper object containing “SaleItem” objects as shown in the appendices of this document. The system creates the “saleItemId” and “inserted” field values so there is no need to supply them.

Troubleshooting Ideas

As with all API connections, you will need to have acquired a bearer token and the user that acquired the token will need to be assigned access permission to this table. If you are not receiving any results send the full endpoint together with any filters and the API user to us from a valid email address and we can advise if permissions have been authorised. You might be able to see data with one table and not another if specific permissions are not applied. Check your filter dates if collecting all rows.

If you are adding Sales then ask us for a sample

A Sale must balance to zero, there must be a minimum of one product row and a minimum of one payment row

Whilst a customer does not have to be added to a sale that is sent to MYPOS Connect, you will then not have the ability in the POS system to look up and find an order. In an Omni-channel setting it is ideal that the customer is added first and then the customerid sent with the sales line items.

Sending sales information

Once you have added the customer and have the relevant customerid and you have available all of the relevant productid guids for the products you can add the sale.

A Sale must balance

Both the lines items and the payment rows must be sent. For example

Product A  €123.00

Product B €200.00

Payment €-323.00

So the three rows above will balance to €0

 

Feedback
0 out of 0 found this helpful

scroll to top icon