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 :
- Return full detail on a single saleitem order
- 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
|
---|
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