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
Output data:
A sample request in PHP:
storage_id | varchar(30) | Storage ID in format "[type:bl|shop|warehouse]_[id:int]" (e.g. "shop_2445"). |
product_id | varchar(30) | Product ID. |
variant_id | varchar(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. |
name | varchar(100) | Variant name |
quantity | int | Stock quantity |
price_brutto | float | Price gross |
sku | varchar(32) | Product SKU number. |
ean | varchar(32) | Product EAN number. |
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 |
storage_id | varchar(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_id | varchar(30) | The number of the product to which variant has been added/changed. |
variant_id | varchar(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: