Promotion.setPromotions
Request
Push promotion/s to Shop , this call can be used both to create and update promotions. Following the promotion data structure.
Name |
Mandatory |
Type |
Description |
---|---|---|---|
id_promotion |
yes |
integer |
Id of the Promotion given by Seller Center |
name |
yes |
string |
Promotion name |
description |
yes |
string |
Promotion description |
start_date |
yes |
date |
Start date of promotion. Format "2015-12- 24 00:00:00" |
end_date |
yes |
date |
End date of promotion. Format "2015-12- 24 00:00:00" |
is_deleted |
undefined | bool |
Whether the Promotion has been removed from Seller Center. Values: true / false If this value is not included is taken as "false" by default on calls to createPromotions and left unchanged on calls to updatePromotions |
JSON example:
Request :
[
{
"api":1,
"method":"auth",
"params":{
"username":"sellercenter.cli",
"password":"xxxxxxxx"
},
"id":1
},
{
"api":1,
"method":"Promotion.setPromotions",
"params":{
"promotions":[
{
"id_promotion":"78",
"name":"Christmas",
"description":"Christmas campaign",
"start_date":"2015-12-24 00:00:00",
"end_date":"2015-12-25 00:00:00"
},
{
"id_promotion":"79",
"name":"Groundhog Day",
"description":"Happy Groundhog Day for all Mamota monax",
"start_date":"2016-02-15 00:00:00",
"end_date":"2016-02-16 00:00:00"
}
]
},
"id":1
}
]
Response
Return data structure
Name |
Type |
Mandatory |
Description |
---|---|---|---|
status |
string |
yes |
"success" / "failure" in case the Promotion was saved successfully or not |
promotion |
array |
yes |
array containing the identification of the addressed Promotion |
error |
array |
no |
present in case of an error happened during the creation of the promotion. If an error is triggered the Promotion is assumed not be created in the shop system. |
Promotion Structure Data
Name |
Type |
Mandatory |
Description |
---|---|---|---|
id_promotion |
int |
yes |
id of the addressed Promotion as sent in the request |
updated_at |
date |
yes |
date of the creation in the shop system |
Error Structure Data
Name |
Type |
Mandatory |
Description |
---|---|---|---|
message |
string |
yes |
described error message |
code |
integer |
yes |
error code |
Response :
[
{
"api":1,
"result":[
{
"status":"success",
"promotion":{
"id_promotion":"78",
"updated_at":"2015-11-14 12:00:00"
}
},
{
"status":"failure",
"promotion":{
"id_promotion":"79",
"updated_at":""
},
"error":{
"message":"Error Message",
"code":"404"
}
}
],
"id":1
}
]