getInventoryProductsData
The method allows you to retrieve detailed data for selected products from the BaseLinker catalogue.
Input parameters
Output data:
A sample request in PHP:
inventory_id | int | Catalog ID. The list of identifiers can be retrieved using the method getInventories. |
products | array | An array of product ID numbers to download |
include_erp_units | bool | (optional) Include ERP units in the response. Only available for inventories with purchase cost calculations system different than AVCO. |
Output data
The method returns the data in JSON format.
status | varchar(30) | SUCCESS - request executed correctly ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code |
products | array | A list of products where the key is the product id and the value is an array of fields listed below. |
| - is_bundle | bool | Indicates whether a product is a bundle. |
| - ean | varchar(32) | Product EAN number. |
| - sku | varchar(32) | Product SKU number. It can be filled with e.g. an external system product number. This will later allow you to rebuild the list of product associations in case of loss. |
| - tax_rate | float | VAT tax rate e.g. "23", (value from range 0-100, EXCEPTION values: "-1" for "EXPT"/"ZW" exempt from VAT, "-0.02" for "NP" annotation, "-0.03" for "OO" VAT reverse charge) |
| - weight | float | Weight in kilograms |
| - height | float | Height in centimeters |
| - width | float | Width in centimeters |
| - length | float | Length in centimeters |
| - star | float | A type of star assigned to product |
| - category_id | int | Product category ID (the category must be created earlier with the addCategories method) |
| - manufacturer_id | int | Product manufacturer ID. IDs can be retrieved with getInventoryManufacturers method. |
| - prices | array | A list containg product gross prices, where the key is the price group ID and value is a product gross price for a given price group. The list of price groups can be retrieved with getInventoryPriceGroups method. |
| - stock | array | A list containing products stock, where the key is the warehouse ID and value is a product stock for a given warehouse. Warehouse ID should have the following format: "[type:bl|shop|warehouse]_[id:int]" (e.g. "bl_123").The list of warehouse IDs can be retrieved with getInventoryWarehouses method. |
| - locations | array | A list containing product locations where the key is the warehouse ID and value is a product location for a given warehouse, eg. "A-5-2". Warehouse ID should have the following format: "[type:bl|shop|warehouse]_[id:int]" (eg. "bl_123"). The list of warehouse IDs can be retrieved with getInventoryWarehouses method. |
| - text_fields | array | A list containing field text values (names, descriptions, etc.) of a product, where the key is the field text ID and value is the field value. The field text ID consists of the following components separated with the "|" character:
In the case of the name and short additional fields, a list is returned, where the key is the name of the parameter (e.g. "Colour") and the value is the value of that parameter (e.g. "White"). In case of file the following format is returned as value: { "title": "file.pdf" (varchar(40) - the file name) "url": "https://upload.cdn.baselinker.com/product_extra_fields/23/caa37889b042cb92b4fed8677423893f.pdf" (url - the file url) } |
| - average_cost | float | Average cost in the main currency of the account |
| - average_landed_cost | float | Average landed cost in the main currency of the account |
| - images | array | A list of product images. Each element of the list is a separate photo (given as an URL) where the key is the photo position in the gallery (numbering from 0 to 15). |
| - links | array | A list containing product links with external warehouses (e.g. shops, wholesalers), where the key is the external warehouse identifier in the format "[type:shop|warehouse]_[id:int]". (e.g. "shop_2445"). The magazine identifiers can be retrieved using getStoragesList method. The value is an array containing the fields listed below. product_id (varchar) - Product ID from the external warehouse. variant_id (varchar) - Product variant identifier in the external warehouse. When linked to the main product, the value 0 is returned. |
| - variants | array | A list containing available product variants, where the key is the variant identifier. The value is an array containing the fields listed below: name (varchar) - full variant name sku (varchar) - SKU number of the variant ean (varchar) - EAN number of the variant prices (array) - a list containing gross prices for the product, where the key is the price group identifier and the value is the product gross price in the price group. The list of price groups can be retrieved using the getInventoryPriceGroups method. stock (array) - a list containing product stocks, where the key is the warehouse ID and value is a product stock for a given warehouse. Warehouse ID should have the following format: "[type:bl|shop|warehouse]_[id:int]" (e.g. "bl_123").The list of warehouse IDs can be retrieved with getInventoryWarehouses method. locations (array) - a list containing product locations where the key is the warehouse ID and value is a product location for a given warehouse, eg. "A-5-2". Warehouse ID should have the following format: "[type:bl|shop|warehouse]_[id:int]" (eg. "bl_123"). The list of warehouse IDs can be retrieved with getInventoryWarehouses method. |
| - stock_erp_units | array | A list containing products stock erp units, where the key is the warehouse ID and value is a list of units in given warehouse. Warehouse ID should have the following format: "[type:bl|shop|warehouse]_[id:int]" (e.g. "bl_123").The list of warehouse IDs can be retrieved with getInventoryWarehouses method. Each unit data is an array containing the fields listed below: quantity (int) - quantity of given ERP unit purchase_cost (float) - purchase cost of given EPR unit expiry_date (varchar) - expiry date of given ERP unit |
Sample
Input data:Output data:
A sample request in PHP: