Deleting all prices set via the API

Description

POST /campaigns/{campaignId}/offer-prices/removals

The request removes all the offer prices that were set using the API. After deletion, the prices from the price lists will take effect.

Attention. This request only works for connected stores. If the store is disconnected, the data in Yandex.Market is not updated, even if the 200 OK HTTP code is returned. You can check the store status using basic methods or on the My stores (“My stores”).

Resource URL:

https://api.partner.market.yandex.ru/v2/campaigns/{campaignId}/offer-prices/removals.[format]

Input data

Parameter

Type

Value

Required

campaignId

Int64

Campaign ID.

To find out the ID, log in to your personal account, click the store name in the top row, and copy the number after the hyphen from the Кампания № (“Campaign No.”) column. For example, if the column contains the value “11-213856”, the campaign ID is 213856.

Parameter

Type

Value

Required

campaignId

Int64

Campaign ID.

To find out the ID, log in to your personal account, click the store name in the top row, and copy the number after the hyphen from the Кампания № (“Campaign No.”) column. For example, if the column contains the value “11-213856”, the campaign ID is 213856.

Structure of POST request body:

Parameters of POST request body:

Parameter for XML format

Parameter for JSON format

Type

Value

offer-price-removal

Information about removal of price offers.

Required parameter, specified only for XML format.

Parameters nested in offer-price-removal

remove-all removeAll Boolean

Removes all offer prices set via the API.

Required parameter with the true value.

For XML format, it is an attribute of the offer-price-removal parameter.

Parameter for XML format

Parameter for JSON format

Type

Value

offer-price-removal

Information about removal of price offers.

Required parameter, specified only for XML format.

Parameters nested in offer-price-removal

remove-all removeAll Boolean

Removes all offer prices set via the API.

Required parameter with the true value.

For XML format, it is an attribute of the offer-price-removal parameter.

Output data

The output data structure is shown below. The order of parameters is not guaranteed.

<response>
  <errors>
    <error code="{enum}" message="{string}"/>
    ...
  </errors>
  <status>{enum}</status>
</response>

Parameter description:

Parameter for XML format

Parameter for JSON format

Type

Value

response

Response.

This parameter is returned only for XML format.

Parameters nested in response

errors errors

List of request execution errors.

Output if status="ERROR".

status status Enum

Request execution status.

Possible values:

  • OK: Request completed successfully.

  • ERROR: An error occurred.

Parameters nested in errors

error

Information about the error.

This parameter is returned only for XML format.

Parameters nested in error / errors

code code Enum

Error code:

Possible values:

  • REQUEST_LIMIT_EXCEEDED — Exceeded the number of offers that prices can be removed for per minute.

For XML format, it is an attribute of the error parameter.

message message String

Description of the error.

For XML format, it is an attribute of the error parameter.

Parameter for XML format

Parameter for JSON format

Type

Value

response

Response.

This parameter is returned only for XML format.

Parameters nested in response

errors errors

List of request execution errors.

Output if status="ERROR".

status status Enum

Request execution status.

Possible values:

  • OK: Request completed successfully.

  • ERROR: An error occurred.

Parameters nested in errors

error

Information about the error.

This parameter is returned only for XML format.

Parameters nested in error / errors

code code Enum

Error code:

Possible values:

  • REQUEST_LIMIT_EXCEEDED — Exceeded the number of offers that prices can be removed for per minute.

For XML format, it is an attribute of the error parameter.

message message String

Description of the error.

For XML format, it is an attribute of the error parameter.

Error description

If an error occurs, the server returns the HTTP response code and a short error description.

Restrictions

You can delete prices for a limited number of offers per minute. If a store has:

  • has a maximum of 10,000 offers, the limit is 50 offers.
  • has more than 10,000 offers, the limit is calculated from the formula:
    (store's total number of offers)/200
Note.

The total number of offers is based on data from the past seven days (not including today).

Examples

Request example:

curl -i -H 'Content-Type: application/xml' -X POST 'https://api.partner.market.yandex.ru/v2/campaigns/10001/offer-prices/removals.xml'

POST request body:

-d '<offer-price-removal remove-all="true"/>'

Response example:

HTTP/1.1 200 OK
Date: Sat, 12 Apr 2018 08:37:40 GMT
Content-Type: application/xml;charset=utf-8
...

<response>
  <status>OK</status>
</response>