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.
API Best Practices
print icon
 
When designing your application you will need to take in to account these three important factors :
  1. A bearer token lasts two hours. So we suggest that when you get a successful token, record the date and time and then get a new token just before the time is up.
  2. You can only have 250 tokens in a day. A day is based on UTC time where it resets at midnight. This is to prevent DoS attacks and also means that access rights can be changed as needed.
  3. The fair practice limits mean that if your design calls for reading the entire products or customers table again and again you will be blocked. Use the last edit date filters described to get just the rows that have changed.

Process of sending orders to MYPOS

When an order is taken on the web site you should follow this sequence :

1. Add the customer to MYPOS Connect. See Sending customer information in the Customers API Section. This will return a customerid

2. Check the products on the order are in MYPOS Connect. See Reading products from MYPOS in the Products API Section . If needed this will return a productid for each product.

3. Send the sales order, See Sending sales information in the SaleItems API Section. The order needs to include the payment method, all lines must balance so that the sum of itemvalue is zero or you will receive an error NOT_ZERO_BALANCE

Reading products from MYPOS

Unless agreed with MYPOS Connect, all Products (including Products, SKUs, Service items, Items) are controlled and added within MYPOS Connect. The web site can obtain a list of products that can then be added to the website.

Where the website does not have a GUID then the Products API call can be run to return the productid guid. This is needed when sending the sales of items to MYPOS Connect.

Example Call: 

https://api.myposconnect.com/api/v2/products?liPage=1&liPageSize=99999&sSortKey=LastEditDateUTCDESC&filt_LastEditDateUTC_dt_min=2000-jan-01%2009%3a00&filt_LastEditDateUTC_dt_max=2020-dec-09

This will look for the first 99999 products sorted by the last edit date added to MYPOS since 1st Jan 2000. It might be that you only want to look for the latest products and you would use this filter to get the latest products and also those products that had changed.

Some things to consider when integrating products:

Not all products might be for sale on the website, there might be items that are in MYPOS Connect that are not for sale via the web or just not for sale via the web yet. There is a column in the Products table called Weborders that if used is either true or false. If it is null then the user is not currently using that column in MYPOS Connect.

The product code column (productcode) and the barcode can change in MYPOS Connect. In an ideal world they do not change but users do tend to change them or the barcodes. If at all possible use the column Productid for linking.

There are several price columns available in the product (Price01, Price02... Price10). It may be that one price should be used for web prices if different from in store, for example Price10

Sending customer information

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


Testing the development

Once you have had an opportunity to add anew customer and add some sales to the test database let us know by emailing [email protected] and we can look at the database and make suggestions.

We do suggest keeping samples of the JSON that you sent so we can make suggestions based upon that.

EEK HELP!

If there are any further questions please email us at [email protected] with your design plans. When you email us let us know what endpoints you are calling and how often you are calling them, we can help with advice to stop you having issues.

 

Reminder: If your design calls for reading the entire products or customers table again and again you will be blocked automatically by the API controller. Use Last edit date filters to get the changed rows instead.

 

Feedback
0 out of 0 found this helpful

scroll to top icon