API documentation
Method list
Test your request
Changelog


addInventoryProduct
The method allows you to add a new product to BaseLinker catalog. Entering the product with the ID updates previously saved product.


Input parameters
inventory_idintCatalog ID. The list of identifiers can be retrieved using the method getInventories. (inventory_id field).
product_idintMain product identifier, given only during the update. Should be left blank when creating a new product. The new product identifier is returned as a response to this method.
parent_idintProduct parent ID. To be provided only if the added/edited product is a variant of another product.
is_bundleboolIs the given product a part of a bundle
skuvarchar(50)Product SKU number.
eanvarchar(32)Product EAN number.
ean_additionalarrayA list containing EAN numbers. Each EAN data should be 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.
tagsarrayA list containing tag names. If:
  • No tags are provided in the API request, the product retains its existing tags (e.g., A, B, C).
  • Tags A, B, and C are provided in the API request, the product retains its existing tags (A, B, C).
  • Tags B and C are provided in the API request, tag A is removed from the product, leaving tags B and C.
  • An empty list of tags is provided in the API request, all existing tags (A, B, C) are removed from the product.
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)
weightdecimal(10,2)Weight in kilograms.
heightdecimal(10,2)Product height
widthdecimal(10,2)Product width
lengthdecimal(10,2)Product length
average_costdecimal(10,2)Product average cost. If storage documents are turned off, this field sets product average cost. If storage documents are turned on, a value in this field can be set in two cases: while creating a new product or when a current average cost is set to 0.
starintProduct star type. It takes from 0 to 5 values. 0 means no starring.
manufacturer_idintProduct manufacturer ID. IDs can be retrieved with getInventoryManufacturers method.
category_idintProduct category ID (category must be previously created with addInventoryCategory method).
pricesarrayA list containing product 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 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: "bl_[id:int]" (eg. "bl_123"). The list of warehouse IDs can be retrieved with getInventoryWarehouses method. Stocks cannot be assigned to the warehouses created automatically for purposes of keeping external stocks (shops, wholesalers, etc.).
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. To assign multiple locations to a single warehouse, separate them with a semicolon.
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 uses a special format: marketplace_category_id|[source_id] or marketplace_category_id|[source_id]|[site] — it does not use the standard [lang] and [source_id] components from other text fields. The value is the category ID as known on the marketplace side. For integrations with per-site categories (eBay, Amazon), the [site] component is required (e.g. "marketplace_category_id|ebay_123|us"). For integrations without per-site categories (Allegro), the [site] component must not be provided. Note: amazon_vendor is not supported as a source type. For integrations where categories are assigned to all accounts (e.g. Amazon), only _0 is accepted as the account ID.
  • [lang] - A two-letter code of language, which gets assigned given value e.g. "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 assigned to the default language.
  • "name|de" - Name assigned to a particular language.
  • "name|de|amazon_0" - Name assigned to a specific language for all Amazon accounts.
  • "name|de|amazon_123" - Name assigned to a specific language for an Amazon account with ID 123.
  • "marketplace_category_id|allegro_123" - Marketplace category for Allegro account with ID 123.
  • "marketplace_category_id|amazon_0|us" - Marketplace category for Amazon on US marketplace site (Amazon categories are always assigned to all accounts, so only _0 is accepted; site component is required).
  • "marketplace_category_id|ebay_456|us" - Marketplace category for eBay account 456 on US eBay site. Site component is required for eBay.
The list of all text field identifiers can be retrieved with the getInventoryAvailableTextFieldKeys method.

In the case of the name and short additional fields, the character limit for the field value is 200. When specifying the value of a product feature (field "features"), provide a list 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 expected:
{
    "title": "file.pdf" (varchar(40) - the file name)
    "file": "data:4AAQSkZJRgABA[...]" (base64 - the file body limited to 2MB)
}
imagesarrayA list of product images (maximum 16 per gallery). Each element of the list is a separate photo where the key identifies the photo position in the gallery (numbering from 0 to 15).

The key has the following format:
  • [position] - position in the default product gallery (e.g. "0", "3").
  • [position]|[source_id] - position in the channel-specific gallery, where [source_id] has the format "[type:varchar]_[id:int]" (e.g. "amazon_0", "allegro_123"). The "[type]" is a kind of integration (e.g. "ebay", "amazon", "allegro"), and the "[id]" is an account identifier for the given integration. Use "0" as the id to apply the value across the whole integration (e.g. "amazon_0").
Channel-specific images are used together with the media_options parameter (see below) - they are only visible to a given channel when its media_options is set to "separate" (1) or "overwrite" (2).

IMPORTANT: Include in the request ONLY the images you want to add or modify. Images not included in the request will remain unchanged. Do not include links to images that are already uploaded to BaseLinker CDN, as this will cause them to be re-uploaded as external images and may result in their deletion.

The value can be a URL prefixed with "url:" (e.g. "url:https://example.com/image.jpg"), base64-encoded binary data prefixed with "data:" (e.g. "data:"), or an empty string "". The meaning of "" differs by key type:
  • For a default gallery key (e.g. "5"): "" deletes the photo at that position.
  • For a channel-specific key (e.g. "3|allegro_123"): "" sets a blank override — the channel sees no photo at that position regardless of the default gallery. To remove a previously set channel override and revert to the behavior defined by media_options, send "url:" (empty URL) at the channel key.
Example:
{
    "0": "url:https://external-site.com/image.jpg", (default gallery, position 0; url limited to 1000 characters length)
    "3": "data:4AAQSkZJRgABA[...]", (default gallery, position 3; base64, limited to 2MB)
    "5": "", (default gallery, position 5; deletes the photo)
    "0|amazon_0": "url:https://external-site.com/amazon.jpg", (channel-specific image for all Amazon accounts, position 0)
    "3|allegro_123": "", (channel-specific, position 3; blank override — Allegro account 123 sees no photo here)
    "3|allegro_123": "url:" (channel-specific, position 3; removes the override — reverts to media_options behavior)
}

When updating an existing product:
- To add a new image at position 2, include only: {"2": "url:https://..."} or {"2": "data:..."}
- To delete image at position 1, include only: {"1": ""}
- Images at other positions (0, 2, 3, etc.) not mentioned in the request will remain unchanged
- Never include existing BaseLinker CDN URLs (https://upload.cdn.baselinker.com/...) as they will be treated as new external images
videosarrayA list of product videos (maximum 6 per gallery). Each element of the list is a separate video where the key identifies the video position in the gallery (numbering from 0 to 5).

The key has the following format:
  • [position] - position in the default product video gallery (e.g. "0", "2").
  • [position]|[source_id] - position in the channel-specific video gallery, where [source_id] has the format "[type:varchar]_[id:int]" (e.g. "amazon_0", "allegro_123"). The "[type]" is a kind of integration (e.g. "ebay", "amazon", "allegro"), and the "[id]" is an account identifier for the given integration. Use "0" as the id to apply the value across the whole integration (e.g. "amazon_0").
Channel-specific videos are used together with the media_options parameter (see below) - they are only visible to a given channel when its media_options is set to "separate" (1) or "overwrite" (2).

Input uses 0-based indexing (0-5), but the output in getInventoryProductsData returns 1-based positions (1-6). Supported formats: MP4, WEBM. Maximum file size: 15 MB. The value can be: a URL prefixed with "url:" (e.g. "url:https://example.com/video.mp4"), base64-encoded binary data prefixed with "data:" (e.g. "data:"), or an empty string "". The meaning of "" differs by key type:
  • For a default gallery key (e.g. "2"): "" deletes the video at that position.
  • For a channel-specific key (e.g. "2|allegro_123"): "" sets a blank override — the channel sees no video at that position regardless of the default gallery. To remove a previously set channel override and revert to the behavior defined by media_options, send "url:" (empty URL) at the channel key.
media_optionsarrayA list defining how product media (images and videos) are resolved per channel. 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; any previously uploaded channel media are ignored.
  • 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 parameters (an empty value at a given position blanks the inherited media for the channel).
Example:
{
    "amazon_0": 1,
    "allegro_123": 2
}
linksarrayAn array containing product links to external warehouses (e.g. shops, wholesalers). Each element of the array is a list in which the key is the identifier of the external warehouse in the format "[type:shop|warehouse]_[id:int]". (e.g. "shop_2445"). The warehouse identifiers can be retrieved with the getStoragesList method. The value is an array containing the fields listed below.
| - product_idtextProduct identifier in external warehouse.
| - variant_idtext(optional) Product variant identifier in the external warehouse. When assigning a link to a main product, this parameter shall be omitted or a value of 0 provided.
bundle_productsarrayA list containing information about the products included in the bundle, where the key is the identifier of the product included in the bundle, and the value is the number of pieces of this product in the bundle.
Subproducts can only be defined if the added/edited product is a bundle (is_bundle = true).
suppliersarrayA list of product suppliers. When provided, replaces all existing suppliers for the product. An empty array removes all suppliers.
| - idintSupplier ID, retrievable with getInventorySuppliers.
| - product_codevarchar(50)Product code at the supplier.
| - costdecimal(10,2)Purchase cost from the supplier.



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
product_idintThe number of an added or updated product in the BaseLinker inventory. In an external application you should create a link between the internal number and the number received here. It will later be used to update the added product. This number will also be included in the order items in the getOrders method.
warningsarrayAn object with notes on adding a product (e.g. image errors or others that do not interrupt the request). Each object field informs about a separate group of warnings.
Currently supported groups:
  • parameters - validation issues with predefined parameter values. Each key is the parameter identifier as sent in the request (predefined parameter ID or its display name), and the value is a human-readable warning message describing the skipped value(s).



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