API documentation
Method list
Test your request
Changelog


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


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.
include_wms_unitsbool(optional) Include WMS units in the response. Only available for inventories with enabled advanced warehouse management system.
include_additional_eansbool(optional) Include additional EANs in response. User can set additional EANs for product, to work with products cases (4-pack etc.) or different regional codes for the same product.
include_suppliersbool(optional) Include suppliers data in the response.
include_relationsbool(optional) Include product relationships in the response (related, substitution, upsell, downsell, crosssell).
include_marketplace_categoriesbool(optional) Include marketplace category assignments in the text_fields output. When set to true, the response will include marketplace_category_id|[source_id] entries showing the marketplace category set for each integration channel.
include_channels_mediabool(optional) Include channel-specific media in the response. When true, the 'images' and 'videos' objects additionally contain keys with the format "[position]|[source_id]" for channel overrides (e.g. "3|amazon_0", "3|allegro_123"; an empty string value means the channel blanks the inherited media at that position) and a top-level 'media_options' object is returned describing how each channel resolves its media gallery (0 - use default, 1 - separate, 2 - overwrite).



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.
| - parent_idintProduct parent ID. Returns 0 for main products, or the main product ID for variants.
| - 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.
| - eanvarchar(32)Product EAN number (primary EAN).
| - ean_additionalarrayA list containing EAN numbers. Each EAN data is an array containing the fields listed below.
  • ean (string) - EAN number
  • quantity (int) - quantity of product with given EAN number
| - asinvarchar(50)Product ASIN number (primary ASIN).
| - tagsarrayA list of product tags.
| - 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
| - starintA type of star assigned to product
| - category_idintProduct category ID (the category must be created earlier with addInventoryCategory method).
| - manufacturer_idintProduct manufacturer ID. IDs can be retrieved with getInventoryManufacturers method.
| - pricesarrayA list containing 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.
| - reservationsarrayA list containing product reserved quantities, where the key is the warehouse ID.
| - thresholdsarrayA list containing product stock thresholds (reorder points), where the key is the warehouse ID.
| - incomingarrayA list containing product incoming stock quantities (ordered from supplier), where the key is the warehouse ID.
| - 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), "marketplace_category_id" - marketplace category identifier assigned to the product for a given integration account. This field only appears when include_marketplace_categories is set to true. It uses the format marketplace_category_id|[source_id] or marketplace_category_id|[source_id]|[site] for integrations with per-site categories (eBay, Amazon). Note: amazon_vendor categories are not included.
  • [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.
  • "marketplace_category_id|allegro_123" - Marketplace category set for Allegro account 123.
  • "marketplace_category_id|amazon_0|us" - Marketplace category for Amazon on US marketplace site (categories are assigned to all accounts, so only _0 is used; site component indicates the marketplace site).
  • "marketplace_category_id|ebay_456|us" - Marketplace category for eBay account 456 on US eBay site.
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
| - bundle_productsarrayList (returned only if product is a bundle) containing products included in the bundle with number of pieces, where the key is product identifier, and the value is the number of pieces included in the bundle. The list of products can be retrieved using the getInventoryProductsList method.
| - imagesarrayA list of product images. Each element of the list is a separate photo (given as an URL) where the key identifies the photo position in the gallery.
By default only the default product gallery is returned and keys are simply the position number (numbering from 1 to 16).
When the include_channels_media flag is set to true, the list additionally contains channel-specific overrides where the key has the format "[position]|[source_id]" (e.g. "3|amazon_0", "3|allegro_123"). An empty string value at such a key means that the channel blanks the inherited photo at that position (only relevant when the channel uses the "overwrite" media_options).
| - videosarrayA list of product videos where the key is the video position in 1-based indexing (1-6) and the value is the video URL.
By default only the default product video gallery is returned and keys are simply the position number (numbering from 1 to 6).
When the include_channels_media flag is set to true, the list additionally contains channel-specific overrides where the key has the format "[position]|[source_id]" (e.g. "2|amazon_0", "2|allegro_123"). An empty string value at such a key means that the channel blanks the inherited video at that position (only relevant when the channel uses the "overwrite" media_options). Note: addInventoryProduct accepts 0-based input positions (0-5), which are stored and returned here as 1-based (1-6).
| - media_optionsarrayReturned only when the include_channels_media flag is set to true. A list describing how each channel resolves its media gallery, where the key is the channel identifier in the format "[type:varchar]_[id:int]" (e.g. "amazon_0", "allegro_123") and the value is one of:
  • 0 - use default: the channel uses default product media.
  • 1 - separate: the channel has its own independent media gallery; default media are ignored.
  • 2 - overwrite: the channel inherits default media, but selected positions can be overridden via channel-specific keys in the images and videos lists (an empty value at a given position blanks the inherited media for the channel).
| - 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 warehouse 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
asin (varchar) - ASIN 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 ERP unit
expiry_date (varchar) - expiry date of given ERP unit
| - stock_wms_unitsarrayA list containing products stock wms 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 WMS unit
location (varchar) - location of given WMS unit
expiry_date (varchar) - expiry date of given WMS unit
batch (varchar) - batch of given WMS unit
serial_no (varchar) - serial number of given WMS unit
| - suppliersarrayA list containing product suppliers data. Each supplier is an array containing the fields listed below:
id (int) - Supplier ID
product_code (varchar) - Product code of that supplier
cost (float) - Product purchase price from this supplier
| - relationsarrayA list of product relationships. Each relationship is an array containing the fields listed below:
product_id (int) - Related product ID
relation_type (string) - Relationship type (related, substitution, upsell, downsell, crosssell)



Sample
Input data:
Output data:
A sample request in PHP: