When a purchase is happening, while the purchase data is getting captured, the API should also capture the product details (Category, Sub-category, Brand, Product Name, SKU, Variant), and update it to the Kreesalis Product database for that client if the product information does not already exist.
For updating products to kreesalis DB,
1.The Clients to which products need to be added should enable Allow API. Respective Client Id and Client Secret should be provided in Headers.
2.The product can be added to either sales or reward or both the categories.
3.Product's Title, model no, brand, pack size, metrics, either sales or reward product category are mandatory and title should be unique across the sales or reward to which the product is getting added for that client.
4.Metrics should be one of the predefined metrics(l,ml,kl,g,mg,kg,units)
5. To update the product, the listing id sent with the request must match the existing product listing id
Success - Product created successfully.
{
"title": "ok",
"status_code": 0,
"status_message": "Product created successfully!!"
}
Error - Mandatory check for Title, Brand, Model No, Reward item points pack size, Reward item points metric
{
"title": "errors",
"status_code": 1,
"status_message": [
"Reward item points pack size must be given please",
"Reward item points pack size is not a number",
"Reward item points metric must be given please",
"Reward item points metric Not a valid metric",
"Title must be given please",
"Model no must be given please",
"Brand must be given please"
]
Error - Title has already taken
{
"title": "errors",
"status_code": 1,
"status_message": [
"Title has already been taken"]
}
Error - Reward item points metric Not a valid metric
{
"title": "errors",
"status_code": 1,
"status_message": [
"Reward item points metric Not a valid metric" ]
}