DRAFT Promotion.setVoucherPromotionProducts

Request

Name

Type

Mandatory

Description

id_promotion

integer

yes

id of the Promotion to which the prices will be applied

sellers

array

yes

Array of Seller's products and brands. The elements respond to the Seller Data Structure

Seller prices data structure

Name

Type

Mandatory

Description

sellershortcode

string

yes

Seller short code

brands

array

no

List of brand src ids

products

array

no

List of shop SKU

JSON example

Request :
[
   {
      "api":1,
      "method":"auth",
      "params":{
         "username":"sellercenter.cli",
         "password":"xxxxxxxx"
      },
      "id":1
   },
   {
      "api":1,
      "method":"Promotion.setPromotionProducts",
      "params":{
            "id_promotion":"78",
            "sellers":[
              	{
                  "seller_short_code": "MY12345",
                  "brands": [
                     "1",
                     "2"
                  ],
                  "products": [
                    "shop_sku1",
                    "shop_sku2"
                  ]                  
                },
              {
                  "seller_short_code": "MY12346",
                  "brands": [],
                  "products": [
                    "shop_sku3",
                    "shop_sku4"
                  ]                  
                }
              , {
                  "seller_short_code": "MY12347",
                  "brands": [
                  "3"
                  ],
                  "products": []                  
                }
               
         ]
      },
      "id":1
   }
]

Response

Return data structure

Name

Type

Mandatory

Description

status

string

yes

"success" / "failure" in case the full set of prices where saved successfully. "failure" indicates that at least one price was not saved.

error

string

no

stores any error happening at global level, therefore not attached to any Price in particular. eg: "Promotion does not exist"

failedSellers

array

no

contains detail of the Prices that were not saved and the error in each case

Return value (global error)

Response :
[
   {
      "api":1,
      "result":
         {
            "status":"failure",
            "error":"Promotion 78 does not exist"
      },
      "id":1
   }
]

Return Value (Errors on some Prices)

Response :
[
   {
      "api":1,
      "result":
         {
            "status":"failure",
            "failed_seller":[
                {
                    "seller_short_code":"MY12345",
                    "error":"Seller does not exist"
                }
            ]
      },
      "id":1
   }
]

Return value (fully successful)

Response :
[
   {
      "api":1,
      "result": {
            "status":"success"
      },
      "id":1
   }
]