Promotion.setPromotionPrices

Request

Name

Type

Mandatory

Description

id_promotion

integer

yes

id of the Promotion to which the prices will be applied

prices

array

yes

a two-dimensional array to set multiple prices for a collection of skus. The elements respond to the Promotion Price Data Structure

Promotion prices datastructure

Name

Type

Mandatory

Description

sku

string

yes

SKU (Shop SKU) of the product to which the Price will be assigned

price

string

yes

Price that applies to this sku in the addressed Promotion. Setting this value to "null" should remove the Product from the Promotion in the shop system

Please note

200 products per call

JSON example

Request :
[
   {
      "api":1,
      "method":"auth",
      "params":{
         "username":"sellercenter.cli",
         "password":"xxxxxxxx"
      },
      "id":1
   },
   {
      "api":1,
      "method":"Promotion.setPromotionPrices",
      "params":{
            "id_promotion":"78",
            "prices":[
                {
                   "sku":"“ALCJLDJFFFVNAMZ­12334",
                   "price":"2100.00"
                },
                {
                   "sku":"“ALCJLDJFFFVNAMZ­00001",
                   "price":"wrongprice"
                },
                {
                   "sku":"“ALCJLDJFFFVNAMZ­00002",
                   "price":null
                }
         ]
      },
      "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"

failedPrices

array

no

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

failedPrices Structure Data

sku

string

yes

SKU of the failed Price as sent in the request

error

string

yes

Error preventing this Price to be applied. eg: "sku does not exist"

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",
            "failedPrices":[
                {
                    "sku":"ALCJLDJFFFVNAMZ­00001",
                    "error":"Wrong price format"
                }
            ]
      },
      "id":1
   }
]

Return value (fully successful)

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