API documentation
Method list
Test your request
Changelog


addProductVariant
The method allows to add a new variant to the product in BaseLinker storage. Providing the variant together with the ID, causes an update of the previously saved variant.


Input parameters
storage_idvarchar(30)Storage ID in format "[type:bl|shop|warehouse]_[id:int]" (e.g. "shop_2445").
product_idvarchar(30)Product ID.
variant_idvarchar(30)Product variant ID. Given only for updates. Should be left blank when creating a new variant. The new variant identifier is returned as a response to this method.
namevarchar(100)Variant name
quantityintStock quantity
price_bruttofloatPrice gross
skuvarchar(32)Product SKU number.
eanvarchar(32)Product EAN number.



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
storage_idvarchar(30)The identifier of the storage, where the product was added or changed in format "[type:bl|shop|warehouse]_[id:int]" (e.g. "shop_2445").
product_idvarchar(30)The number of the product to which variant has been added/changed.
variant_idvarchar(30)The number of an added or updated product variant in BaseLinker storage. In an external application you must create a link between the internal number and the number received here. It will later be used to update the added product variant. This number will also be given in the order items in the getOrders function.



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