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 goods 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": "string",
"lastName": "string",
"firstName": "string",
"middleName": "string",
"type": "PERSON"
},
"delivery": {
"region": {
"id": 0,
"name": "string",
"type": "OTHER"
},
"address": {
"country": "string",
"postcode": "string",
"city": "string",
"district": "string",
"subway": "string",
"street": "string",
"house": "string",
"block": "string",
"entrance": "string",
"entryphone": "string",
"floor": "string",
"apartment": "string",
"lat": 0,
"lon": 0,
"notes": "string",
"outletPhones": [
"string"
],
"schedule": [
{
"fromDay": "MONDAY",
"toDay": "MONDAY",
"fromTime": "string",
"toTime": "string"
}
]
},
"estimated": false,
"outlet": {
"code": "string"
}
},
"items": [
{
"id": 0,
"feedId": 0,
"offerId": "string",
"feedCategoryId": "string",
"offerName": "string",
"price": 0,
"subsidy": 0,
"count": 0,
"shopSku": "string",
"warehouseId": 0,
"partnerWarehouseId": "string",
"fulfilmentShopId": 0,
"promos": [
{
"type": "DIRECT_DISCOUNT",
"subsidy": 0,
"marketPromoId": "string"
}
]
}
]
}
}
|
Name |
Description |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
cart* |
Type: object
Basket. |
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
-
The store does not deliver orders to the transferred region or to the buyer's address (DBS)
Specify empty delivery options:
"deliveryOptions": []. In the parameteritemsfor each product, the parameterdeliveryYou don't have to transmit it.There are items in the basket that the store does not deliver to the transferred region or to the buyer's address (DBS)
For such products, specify
"delivery": falsein the parameteritems.The product is not available for sale (DBS)
Specify the parameter for the product
"count": 0. If all the items from the basket are not on sale, pass the parameteritemsempty.You have received information that the product is out of stock
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).
The product is currently out of stock
Specify the parameter
count="0", nested in the parameteritems. If all the items from the shopping cart are not on sale, pass the parameteritemsempty.Example
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 transfer 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.
Example
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": "string",
"count": 0,
"delivery": false,
"sellerInn": "string"
}
],
"deliveryOptions": [
{
"id": "string",
"price": 0,
"serviceName": "string",
"type": "DELIVERY",
"dates": {
"fromDate": "23-09-2022",
"toDate": "23-09-2022",
"intervals": [
{
"date": "23-09-2022",
"fromTime": "string",
"toTime": "string"
}
]
},
"outlets": [
{
"code": "string"
}
],
"paymentMethods": [
"SHOP_PREPAID"
]
}
]
}
}
|
Name |
Description |
||||||||
|
cart* |
Type: object
|
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 API violations and flaws 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.