This section will introduce the methods for creating and updating platform products.
curl -XGET -H 'APIKEY: [the_tenant_api_key_string]'
https://[the_tenant_endpoint]/public-api/productIt can be filtered by any payload fields, such as: name, identifier, price, sku, ean, stock, tax, and description.
Request examples
The request can be with a single query string or multiple query strings (two or more).
The limit and the offset can be added.
For example:
curl -XPOST -H 'APIKEY: [the_tenant_api_key_string]' -H "Content-type: application/json" -d '
{
"name":"Red shirt with plants",
"identifier": "210000324542322",
"price":"2500",
"sku":"AS34DS",
"ean":"210000324542322",
"stock":"100",
"taxes":"23",
"description":"Red shirt with plants from the 2k21 summer collection",
"manufacturer":"YoungCloth",
"country":"Portugal",
"composition":"cotton;fiber",
"typology”:"casual;fabric",
“classification”:“young;teenager",
"category_code":"TSHIRT"
}' 'https://[the_tenant_endpoint]/public-api/product'
Fields that are mandatory
Fields that are optional
If everything has gone as expected, the API response will be as follows:
{
"path_code": null,
"path_name": null,
"price": "2500",
"productv2_id": "51",
"sku": "AS34DS",
"status": "1",
"stock": "100",
"taxes": "23",
"updated_log": null,
"updated_on": null,
"category_id": null,
"created_log": "63752DB101060215279067",
"created_on": "1668623793",
"description": "Red shirt with plants from the 2k21 summer collection",
"manufacturer":"YoungCloth",
"country":"Portugal",
"composition":"cotton;fiber",
"typology”:"casual;fabric",
“classification”:“young;teenager",
"ean": "210000324542322",
"identifier": "210000324542322",
"img_url": null,
"import_id": null,
"name": "Red shirt with plants"
}
To update the product you must send only the fields that the data will change, you do not have to send all the product fields.
For example, if you want to change the name, price and the description of the product, the only fields that needed to be sent in the payload are "name", "price" and “description”.
curl -XPUT -H 'APIKEY: [the_tenant_api_key_string]' -H "Content-type: application/json" -d '
{
"name":"Red shirt with roses",
"price":"2000",
"description":"Red shirt with roses from the 2k21 summer collection",
"country":"Spain",
"composition":"fiber",
"typology”:"casual",
“classification”:“young",
"category_code": "TSHIRT"
}' 'https://[the_tenant_endpoint]/public-api/product/51'
If the update has proceeded as expected, we will have the following response from the API:
{
"path_code": null,
"path_name": null,
"price": "2000",
"productv2_id": "51",
"sku": "AS34DS",
"status": "1",
"stock": "100",
"taxes": "23",
"updated_log": null,
"updated_on": null,
"category_id": null,
"created_log": "63752DB101060215279067",
"created_on": "1668623793",
"description": "Red shirt with roses from the 2k21 summer collection",
"manufacturer":"YoungCloth",
"country":"Spain",
"composition":"fiber",
"typology”:"casual",
“classification”:“young"
"ean": "210000324542322",
"identifier": "210000324542322",
"img_url": null,
"import_id": null,
"name": "Red shirt with roses"
}
curl -XDELETE -H 'APIKEY: [the_tenant_api_key_string]' -H "Content-type: application/json" -d '
'https://[the_tenant_endpoint]/public-api/product/51'
If the delete has proceeded as expected, we will have the following response from the API:
{
“status”: “deleted”
}