question

robert910122 avatar image
robert910122 asked robert910122 answered

Inventory Api

Hi, anyone can help me I need to sync the inventory stock quantity of clover going to our DB but I am really confused about which API endpoints I need to choose. Hssaz client


Get the stock of all inventory items


or

Get all inventory items


Thank you

Inventory
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

robert910122 avatar image
robert910122 answered

Hello, any updates on this? thank you

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

aprmitch avatar image
aprmitch answered

Also looking for resolutions.


10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jacob Abrams avatar image
Jacob Abrams answered

Have you tried invoking any of the endpoints to see what they return?

If you only need to know the item stock count then /v3/merchants/{mId}/item_stocks will give you that information.

Output will look like:

{
    "elements": [
        {
            "item": {
                "id": "8HDDYA66T9932"
            },
            "stockCount": 997,
            "quantity": 997.0,
            "modifiedTime": 1609960757000
        },
        {
            "item": {
                "id": "Y8G4WCBEQ60VJ"
            },
            "stockCount": 51,
            "quantity": 51.0,
            "modifiedTime": 1578605937000
        },
...
}

As you can see the output includes only the UUID of the item and the API reference shows that expanding the item is not supported on this endpoint so it's likely you will need to also invoke v3/merchants/{mId}/items/{itemId} to get details about each inventory item or v3/merchants/{mId}/items to get details on every inventory item. Ideally you will cache the results of the items since they are less likely to change as often as the item stock.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

robert910122 avatar image
robert910122 answered

thank you appreciated.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community