ProductAdd
The method allows add a new product from BaseLinker to the store.
Input parameters
Incoming as $_POST fields.
POST request:
returned data JSON:
Dane wyjściowe:
product_id | string | External Product ID |
sku | string | Product SKU number. May be completed e.g. with the product number in an external system. This will allow you to rebuild the list of product bindings later if they are lost. |
ean | string | EAN - 13 digit barcode |
name | string | Product name |
quantity | int | Product quantity (stock) |
price | float | Price gross |
tax | int | Tax value (precentage) |
weight | float | Weight expressed in kilograms |
height | float | Height expressed in centimeters |
length | float | Length expressed in centimeters |
width | float | Width expressed in centimeters |
description | string | Long description |
description_extra1 | string | Long description extra |
description_extra2 | string | Long description extra |
description_extra3 | string | Long description extra |
description_extra4 | string | Long description extra |
man_name | string | Manufacturer name |
category_id | string | Product Category ID |
images | array | An array containing urls to images. Each element of the board is a separate photo. First element is main photo. |
features | array | An array of product features in the form of a list. Each element of the array is also an array containing a pair of elements: name and value of the feature, eg ["resolution", "Full HD"] If the feature has more than one value, it is separated with "|", for example: [" outputs "," audio | D-sub | HDMI "]. |
tags | array | (will start working after May 23, 2024) An array of product tags, key as tag Id, value as tag Value |
Outgoing data
Array fields that the method should return.
product_id | string | ID of the new product saved in store database |
Example:
Input data:Array
(
[name] => Koszulka Cleopatra
[sku] => LE4729
[description] => Koszulka typu bokserka z nadrukiem
[quantity] => 0
[man_name] => Quanzhou Yibiao Sexy Lingerie
[category_id] => 4
[category_name] => Koszulki
[tax] => 23.000
[price] => 49.00
[images] => Array
(
[0] => http://sklep.pl/img/456a.jpg
[1] => http://sklep.pl/img/456b.jpg
)
[features] => Array
(
[0] => Array
(
[0] => Waga
[1] => 0,07 kg
)
[1] => Array
(
[0] => Materiał
[1] => Polyester+ Spandex
)
[2] => Array
(
[0] => Rozmiar
[1] => Rozmiar uniwersalny
)
)
)
(
[name] => Koszulka Cleopatra
[sku] => LE4729
[description] => Koszulka typu bokserka z nadrukiem
[quantity] => 0
[man_name] => Quanzhou Yibiao Sexy Lingerie
[category_id] => 4
[category_name] => Koszulki
[tax] => 23.000
[price] => 49.00
[images] => Array
(
[0] => http://sklep.pl/img/456a.jpg
[1] => http://sklep.pl/img/456b.jpg
)
[features] => Array
(
[0] => Array
(
[0] => Waga
[1] => 0,07 kg
)
[1] => Array
(
[0] => Materiał
[1] => Polyester+ Spandex
)
[2] => Array
(
[0] => Rozmiar
[1] => Rozmiar uniwersalny
)
)
)
POST request:
name=Koszulka+Cleopatra&sku=LE4729&description=Koszulka+typu+bokserka+z+nadrukiem&quantity=0&man_name=Quanzhou+Yibiao+Sexy+Lingerie&category_id=4&category_name=Koszulki&tax=23.000&price=49.00&images%5B0%5D=http%3A%2F%2Fsklep.pl%2Fimg%2F456a.jpg&images%5B1%5D=http%3A%2F%2Fsklep.pl%2Fimg%2F456b.jpg&features%5B0%5D%5B0%5D=Waga&features%5B0%5D%5B1%5D=0%2C07+kg&features%5B1%5D%5B0%5D=Materia%C5%82&features%5B1%5D%5B1%5D=Polyester%2B+Spandex&features%5B2%5D%5B0%5D=Rozmiar&features%5B2%5D%5B1%5D=Rozmiar+uniwersalny
returned data JSON:
{"product_id":"456"}
Dane wyjściowe:
Array
(
[product_id] => 456
)
(
[product_id] => 456
)