addProduct
The method allows you to add a new product to BaseLinker storage. Entering the product with the ID updates previously saved product.
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) | Main 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. |
ean | varchar(32) | Product EAN number. |
sku | varchar(32) | Product SKU number. |
name | varchar(200) | Product name |
quantity | int | Stock quantity |
price_brutto | float | Price gross |
price_wholesale_netto | float | Net wholesale price |
tax_rate | float | VAT 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) |
weight | float | Weight in kilograms |
description | text | Product description |
description_extra1 | text | Additional product description |
description_extra2 | text | Additional product description |
description_extra3 | text | Additional product description |
description_extra4 | text | Additional product description |
man_name | varchar(50) | Manufacturer name |
category_id | int | Product category ID (the category must be created earlier with the addCategories method) |
images | array | An array of product images (maximum 16). Each element of the array is a separate photo. You can submit a photo in binary format, or a link to the photo. In case of binary format, the photo should be coded in base64 and at the very beginning of the photo string the prefix "data:" should be provided. In case of link to the photo, the prefix "url:" must be given before the link. Example: images[0] = "url:http://adres.pl/image.jpg"; images[1] = "data:4AAQSkZJRgABA[...]"; |
features | array | An array of product features in the form of a list. Each array element is an object containing two fields: name (varchar) - parameter name e.g. "resolution" value (varchar) - parameter value, e.g. "Full HD" If the parameter name is identical to the name of the parameter used in categories of the Allegro.pl website, the parameter will be automatically completed when listing the offer, which will considerably facilitate the product listing for the seller, |
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 added or updated product 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. This number will also be given in the order items in the getOrders function. |
warnings | object | An 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 error. |
Sample
Input data:Output data:
A sample request in PHP: