API documentation
Method list
Test your request
Changelog


getInventoryProductsData
The method allows you to retrieve detailed data for selected products from the BaseLinker catalogue.


Input parameters
inventory_idintCatalog ID. The list of identifiers can be retrieved using the method getInventories.
productsarrayAn array of product ID numbers to download
include_erp_unitsbool(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.
statusvarchar(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
productsarrayA list of products where the key is the product id and the value is an array of fields listed below.
| - is_bundleboolIndicates whether a product is a bundle.
| - eanvarchar(32)Product EAN number.
| - skuvarchar(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_ratefloatVAT 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)
| - weightfloatWeight in kilograms
| - heightfloatHeight in centimeters
| - widthfloatWidth in centimeters
| - lengthfloatLength in centimeters
| - starfloatA type of star assigned to product
| - category_idintProduct category ID (the category must be created earlier with the addCategories method)
| - manufacturer_idintProduct manufacturer ID. IDs can be retrieved with getInventoryManufacturers method.
| - pricesarrayA 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.
| - stockarrayA 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.
| - locationsarrayA 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_fieldsarrayA 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:
  • [field] - Field name. Accepted field names: "name", "description", "features", "description_extra1", "description_extra2", "description_extra3", "description_extra4", "extra_field_[extra-field-ID]" e.g. "extra_field_75". The list of extra fields IDs can be retrieved with getInventoryExtraFields method.
  • [lang] - A two-letter code of language, which gets assigned given value eg. "en". If this value is not specified, the default catalog language is assigned. The list of languages available for each integration can be retrieved with getInventoryIntegrations method.
  • [source_id] - Integration ID provided when the given text field value is to be overwritten only for a specific integration. ID should have a following format: "[type:varchar]_[id:int]", where the type means a kind of integration (e.g. "ebay", "amazon", "google"), and ID is an account identifier for given integration (eg. "ebay_2445").
    If a value is to be overwritten throughout the integration (e.g. for all Amazon accounts), the value "0" should be used as the identifier. (e.g. "amazon_0").
Examples of text field identifiers:
  • "name" - Default name set to the default language.
  • "name|de" - Name set to a particular language.
  • "name|de|amazon_0" - Name set to a specific language for all Amazon accounts.
  • "name|de|amazon_123" - Name set to a specific language for an Amazon account with ID 123.
The list of all text field identifiers can be retrieved with the getInventoryAvailableTextFieldKeys method.

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_costfloatAverage cost in the main currency of the account
| - average_landed_costfloatAverage landed cost in the main currency of the account
| - imagesarrayA 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).
| - linksarrayA 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.
| - variantsarrayA 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_unitsarrayA 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: