---
updatedAt: 2025-09-11T07:17:48.000Z
agentTools:
  projectIndex: https://developer.tilby.com/llms.txt
---

# Check warehouse stocks popup

Tilby have an integrated [Warehouse Stock Movements](https://developer.tilby.com/reference/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](https://files.readme.io/c6d7d92-Schermata_2022-04-13_alle_11.31.05.png "Schermata 2022-04-13 alle 11.31.05.png")

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

```text
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

```text
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

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

and should receive the following reply

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

## Endpoint structure

You need to expose an endpoint that accepts such a query

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

PAYLOAD
Articolo=DSABCDE
```

And return such a structured JSON response

```json
[
    {
        "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"
    },
    .....
]
```