Check warehouse stocks popup

Tilby have an integrated Warehouse Stock Movements, and we suggest to sync it to have a better experience.https://dash.readme.com/project/tilby/v2.0/docs/check-warehouse-stocks-popup

543

For user cases where it is more useful to be able to query an external stock, you can set a URL that the application can retrieve.

🚧

Note

This mode allows only the visualization of the stock in the POPUP, there will be no interaction with the real stock and sales.

Install the popup in the shop environment

To get to the mode you need to set the folowing shop_settings

application.functions.cashregister.check_external_stock: on
application.settings.external_stock.api_url: https://yourhostname/yourpath/stock
application.settings.external_stock.token_url: https://yourhostname/yourpath/token

Authentication (optional)

It is possible for the application to request a token according to the pair of username and password set as follows

application.settings.external_stock.username
application.settings.external_stock.password

In this case the application will make a call to the endpoint with the following request

HOST https://yourhostname/yourpath/
METHOD POST
PAYLOAD
grant_type=password&username=MYUSERNAME&password=MYPASSWORD

and should receive the following reply

{
  "token_type":"bearer",
  "access_token":"yJcszuf0QbRYTry2xXQ",
  "expires_in":5183999,
}

Endpoint structure

You need to expose an endpoint that accepts such a query

HOST https://yourhostname/yourpath/
METHOD GET
HEADER
authorization: yJcszuf0QbRYTry2xXQ

PAYLOAD
Articolo=DSABCDE

And return such a structured JSON response

[
    {
        "Articolo": "WOMAN KNITTED T-SHIRT SHORT SLEEVE",
        "Barcode": "8434101470981",
        "Colore": "2000 BIANCO",
        "Negozio": "ALESSANDRIA",
        "PrezzoVendita": 69.95,
        "Quantita": 0,
        "Taglia": "XS",
        "idArticolo": "DS61T26A2"
    },
    {
        "Articolo": "WOMAN KNITTED T-SHIRT SHORT SLEEVE",
        "Barcode": "8434101499418",
        "Colore": "2000 BIANCO",
        "Negozio": "ALESSANDRIA",
        "PrezzoVendita": 69.95,
        "Quantita": 1,
        "Taglia": "S",
        "idArticolo": "DS61T26A2"
    },
    .....
]