Export Branch Inventory

Export Branch Inventory

The branch inventory can be accessed via the url GET http://<server name>:<odata port>/<service tier name>/api/BEterna/Export/v2.0/companies(<company system id>)/branchInventories?$filter=webshopChannelCode eq '<webshop-channel-code>' and no eq '<item-no>'&$expand=branchItemVariants($expand=branchLocations). The filters on the webshop channel code and item no. are mandatory. The response is a JSON with all branch inventories connected to the given webshop channel and item no.

{
    "@odata.context": "http://<server name>:<odata port>/<service tier name>/api/BEterna/Export/v2.0/$metadata#companies(<company system id>)/branchInventories",
    "value": [
        {
            "@odata.etag": "W/\"JzIwOzExMjQ2MDU5MDEwMzY1MDcyNDc0MTswMDsn\"",
            "systemId": "f56de051-86f7-ec11-be4b-ede4b77edebd",
            "webshopChannelCode": "B2B",
            "no": "1896-S",
            "branchItemVariants": [
                {
                    "@odata.etag": "W/\"JzE5OzYwMjY4NzkxNDY4NzI1ODAzNTYxOzAwOyc=\"",
                    "systemId": "5e06e94b-b109-ed11-be58-91ded4264012",
                    "code": "V1",
                    "branchLocations": [
                        {
                            "@odata.etag": "W/\"JzIwOzE0NTM3NzQ5NDgwMzA2MjU1NTcwMTswMDsn\"",
                            "systemId": "6de3714f-45f7-ec11-82ec-6045bd8e59b5",
                            "code": "MAIN",
                            "inventory": 68,
                            "calculationTimeStamp": "2022-07-22T11:33:45.353Z"
                        },
                        {
                            "@odata.etag": "W/\"JzIwOzE0NTM3NzU3OTA4MDIxMTU1MDEzMTswMDsn\"",
                            "systemId": "6fe3714f-45f7-ec11-82ec-6045bd8e59b5",
                            "code": "WEST",
                            "inventory": 89,
                            "calculationTimeStamp": "2022-07-22T11:33:45.357Z"
                        }
                    ]
                },
                {
                    "@odata.etag": "W/\"JzE5OzYwMjY4NzkxNDgzNTM4MDEwMTExOzAwOyc=\"",
                    "systemId": "5f06e94b-b109-ed11-be58-91ded4264012",
                    "code": "V2",
                    "branchLocations": [
                        {
                            "@odata.etag": "W/\"JzIwOzE0NTM3NzQ5NDgwMTQxODAwMDgyMTswMDsn\"",
                            "systemId": "6de3714f-45f7-ec11-82ec-6045bd8e59b5",
                            "code": "MAIN",
                            "inventory": 13,
                            "calculationTimeStamp": "2022-07-22T11:33:45.357Z"
                        },
                        {
                            "@odata.etag": "W/\"JzIwOzE0NTM3NzU3OTA4MDY1MzY3MjM3MTswMDsn\"",
                            "systemId": "6fe3714f-45f7-ec11-82ec-6045bd8e59b5",
                            "code": "WEST",
                            "inventory": 134,
                            "calculationTimeStamp": "2022-07-22T11:33:45.357Z"
                        }
                    ]
                }
            ]
        }
    ]
}

The fields of the branch inventory are documented in the following table.

field data type content
systemId GUID the system id of the item selection record
webshopChannelCode Code[20] the webshop channel code
no Code[20] the item no.

The fields of the branch item variant are documented in the following table.

field data type content
systemId GUID the system id of the item selection record
code Code[10] the variant code

The fields of the branch location are documented in the following table.

field data type content
systemId GUID the system id of the location record
code Code[10] the location code
inventory Decimal the inventory of the location for variant
calculationTimeStamp DateTime the timestamp of the inventory calculation

In this article