Starting from December 31, push API methods will be unavailable. From October 1, they may be unstable.
Requests to use to transmit information:
- About the leftovers — PUT v2/campaigns/{campaignId}/offers/stocks.
- About the store's points of sale — GET v2/campaigns/{campaignId}/outlets.
To receive information about orders, enable API notifications. How to do it
Requesting information about products
The market verifies that the products that the customer has put in the basket are available in the store. At DBS-stores are also asked for information about the possibility of delivery and available payment methods.
Response time: 5.5 seconds.
Request
POST
/cart
Body
application/json
{
"cart": {
"businessId": 0,
"currency": "RUR",
"deliveryCurrency": "RUR",
"buyer": {
"id": "example",
"lastName": "example",
"firstName": "example",
"middleName": "example",
"type": "PERSON"
},
"delivery": {
"region": {
"id": 0,
"name": "example",
"type": "OTHER",
"parent": null
},
"address": {
"country": "example",
"postcode": "example",
"city": "example",
"district": "example",
"subway": "example",
"street": "example",
"house": "example",
"block": "example",
"entrance": "example",
"entryphone": "example",
"floor": "example",
"apartment": "example",
"lat": 0.5,
"lon": 0.5,
"notes": "example",
"outletPhones": [
null
],
"schedule": [
null
]
},
"estimated": true,
"outlet": {
"code": "example"
}
},
"items": [
{
"id": 0,
"feedId": 0,
"offerId": "example",
"feedCategoryId": "example",
"offerName": "example",
"price": 0.5,
"subsidy": 0.5,
"count": 0,
"shopSku": "example",
"warehouseId": 0,
"partnerWarehouseId": "example",
"fulfilmentShopId": 0,
"promos": [
{}
]
}
]
}
}
|
Name |
Description |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
cart |
Type: object
Basket. Example
|
Responses
200 OK
Up-to-date information about the availability of goods for the transferred basket and the specified delivery region.
- How to transfer product data in different situations
-
Магазин не доставляет заказы в переданный регион или по адресу покупателя (DBS)
Specify empty delivery options:
"deliveryOptions": []. In the parameteritemsfor each product, the parameterdeliveryYou don't have to transmit it.В корзине есть товары, которые магазин не доставляет в переданный регион или по адресу покупателя (DBS)
For such products, specify
"delivery": falsein the parameteritems.Товар отсутствует в продаже (DBS)
Specify the parameter for the product
"count": 0. If all the items from the basket are not on sale, pass the parameteritemsempty.Вы получили информацию, что товар отсутствует в продаже
After 10-15 minutes, this offer stops being displayed on the Market by model. DBS until the next update of the data on the service (indexing takes place every 4 hours).
Товара сейчас нет в наличии
Specify the parameter
count="0", nested in the parameteritems. If all the items from the basket are not on sale, pass the parameteritemsempty.Пример
For ease of reading, the sample code is provided in an abbreviated format.
{ "cart": { "items": [ { "feedId": {int64}, "offerId": "{string}", "count": {int32}, "delivery": {boolean} }, ... ] } } - How to send delivery information to pick-up points (DBS)
-
Specify in the parameter
outletsids of all pick-up points where the product is already in stock and to which you can deliver the product if it is not there yet. You need to specify all the suitable pick-up points in the region specified in the request in the parameterregion(even if the parameter contains an incomplete address: for example, only a city or a district in the region).If the delivery conditions for different pick-up points differ (for example, the order will be delivered to some points tomorrow, and to others — the day after tomorrow), in the parameter
deliveryOptionsspecify one nested parameter for each group of points with the same conditions and list the appropriate points in each of them. - How to transfer data about digital goods (DBS)
-
If you have disabled working with the method
POST cart, you do not need to transfer data. - What to send as the shipping price (DBS)
-
The Market has a single delivery rate for customers. The cost of delivery is substituted automatically from the unified tariff schedule. You can transmit any number. — shipping cost data transmitted via the API is not taken into account. Detailed information about the unified tariff is provided in the Help of the Market for sellers.
- Date ranges and delivery intervals (DBS)
-
Specify in the parameters
fromDateandtoDate, nested indates, the earliest and latest possible delivery dates, respectively, and in the parameterintervals— dates and (for courier delivery, if possible) delivery intervals, which the user can choose between.A set of parameters nested in
dates, depends on the order delivery method:- For orders with the courier delivery method (
"type": "DELIVERY") either all three parameters should be passed (fromDate,toDate,intervals), or only an early delivery date (fromDate). - For orders with a pickup delivery method (
"type": "PICKUP") only the parameters should be passedfromDateandtoDate. ParameterintervalsYou can't transfer it for such orders.
Пример
For ease of reading, the sample code is provided in an abbreviated format.
What will you convey in your response to
POST cartWhat the user can choose
"type": "DELIVERY", "dates": { "fromDate": "10-03-2021" }March 10, 00:00-23:59
"type": "PICKUP", "dates": { "fromDate": "01-03-2021", "toDate": "03-03-2021" }March 1, 00:00 — March 3, 23:59
- For orders with the courier delivery method (
Body
application/json
{
"cart": {
"paymentMethods": [
"SHOP_PREPAID"
],
"deliveryCurrency": "RUR",
"items": [
{
"feedId": 0,
"offerId": "example",
"count": 0,
"delivery": true,
"sellerInn": "example"
}
],
"deliveryOptions": [
{
"id": "example",
"price": 0.5,
"serviceName": "example",
"type": "DELIVERY",
"dates": {
"fromDate": "23-09-2022",
"toDate": "23-09-2022",
"intervals": [
null
]
},
"outlets": [
{}
],
"paymentMethods": [
"SHOP_PREPAID"
]
}
]
}
}
|
Name |
Description |
||||||||||||||||||||||||||||||||||||||||||||||
|
cart |
Type: object
Example
|
400 Bad Request
If the store considers the request received from Yandex. Market to be incorrect, the store must return the response status 400 with a description of the reason for the error in the response body. Such responses will be analyzed for violations and flaws of the API on the part of the Market.
500 Internal Server Error
In case of a technical error on the store's side, it should return the response status 500. Stores with a large number of such responses may be disconnected from the Market.
No longer supported, please use an alternative and newer version.