2.3. Receipt of delivery offers
- The method returns the available delivery options.
- Each option contains a price, a time interval for picking up a parcel at a point A, the time interval of delivery to point B.
- After receiving the available delivery options, you can choose the optimal one and create an order based on it.
- You can get delivery options only in Russia — in other countries the method will not work correctly.
HTTP Request
POST b2b.taxi.yandex.net/b2b/cargo/integration/v2/offers/calculate
Header Parameters
Accept-Language * | string Preferred language of response |
Accept-Language * | string Preferred language of response |
* Required parameter
Request Body
{ "items": [ { "quantity": integer, "size": { "height": number, "length": number, "width": number }, "weight": number } ], "requirements": { "due": string, "pro_courier": boolean, "skip_door_to_door": boolean, "taxi_classes": [ string ] }, "route_points": [ { "coordinates": [ number ], "fullname": string } ] }
Copied to clipboard
Representation
Fields
items[] | array Listing of boxes to be shipped |
items[]. | integer Number of product units Minimum value: |
items[]. | object Linear dimensions of the item in meters. |
items[]. | number |
items[]. | number |
items[]. | number |
items[]. | number Weight in kilograms. |
requirements | object Delivery requirements |
requirements. | string Expected delivery time (you can postpone the expected time for 30-60 minutes from the current moment) |
requirements. | boolean Option "Pro" for "Express" tariff. |
requirements. | boolean Refusing door-to-door delivery (turn off the "Door-to-door" option). Possible values:
|
requirements. | array |
route_points[] * | array Route points. Sorted in order of visit A-B1....BN |
route_points[]. | array Array of two real numbers [longitude, latitude]. The order is important! |
route_points[]. | string Full name indicating the city (Moscow, Sadovnicheskaya Naberezhnaya, 82 bld. 2). |
items[] | array Listing of boxes to be shipped |
items[]. | integer Number of product units Minimum value: |
items[]. | object Linear dimensions of the item in meters. |
items[]. | number |
items[]. | number |
items[]. | number |
items[]. | number Weight in kilograms. |
requirements | object Delivery requirements |
requirements. | string Expected delivery time (you can postpone the expected time for 30-60 minutes from the current moment) |
requirements. | boolean Option "Pro" for "Express" tariff. |
requirements. | boolean Refusing door-to-door delivery (turn off the "Door-to-door" option). Possible values:
|
requirements. | array |
route_points[] * | array Route points. Sorted in order of visit A-B1....BN |
route_points[]. | array Array of two real numbers [longitude, latitude]. The order is important! |
route_points[]. | string Full name indicating the city (Moscow, Sadovnicheskaya Naberezhnaya, 82 bld. 2). |
* Required parameter
Responses
Code 200
OK
{ "offers": [ { "delivery_interval": { "from": string, "to": string }, "description": string, "payload": string, "pickup_interval": { "from": string, "to": string }, "price": { "base_price": string, "currency": string, "surge_ratio": number, "total_price": string, "total_price_with_vat": string }, "taxi_class": string } ] }
Copied to clipboard
Representation
Fields
offers[] * | array Array of delivery options |
offers[]. | object Time interval for the delivery (point B) |
offers[]. | string Start of the time interval (UTC) |
offers[]. | string End of the time interval (UTC) |
offers[]. | string Description of the delivery option. Example: express_30min_longer (express with a delay of 30 minutes) |
offers[]. | string Payload of the delivery offer. To order delivery to the selected offer, you need to pass the payload to the claims/create method |
offers[]. | object Time interval for the pickup (point A) |
offers[]. | string Start of the time interval (UTC) |
offers[]. | string End of the time interval (UTC) |
offers[]. | object Price |
offers[]. | string Base shipping price |
offers[]. | string Currency |
offers[]. | number The growth rate of the order value (depending on the system loads) |
offers[]. | string Price taking into account the growth factor of the order value (without VAT) |
offers[]. | string Price taking into account the growth factor of the order value (including VAT) |
offers[]. | string |
offers[] * | array Array of delivery options |
offers[]. | object Time interval for the delivery (point B) |
offers[]. | string Start of the time interval (UTC) |
offers[]. | string End of the time interval (UTC) |
offers[]. | string Description of the delivery option. Example: express_30min_longer (express with a delay of 30 minutes) |
offers[]. | string Payload of the delivery offer. To order delivery to the selected offer, you need to pass the payload to the claims/create method |
offers[]. | object Time interval for the pickup (point A) |
offers[]. | string Start of the time interval (UTC) |
offers[]. | string End of the time interval (UTC) |
offers[]. | object Price |
offers[]. | string Base shipping price |
offers[]. | string Currency |
offers[]. | number The growth rate of the order value (depending on the system loads) |
offers[]. | string Price taking into account the growth factor of the order value (without VAT) |
offers[]. | string Price taking into account the growth factor of the order value (including VAT) |
offers[]. | string |
* Required parameter
Code 400
Invalid request
{ "code": string, "message": string }
Copied to clipboard
Representation
Fields
* Required parameter
Code 409
There are no suitable cars | Failed to build a route
{ "code": string, "message": string }
Copied to clipboard
Representation
Fields
* Required parameter
Example
Request:
curl -X POST "b2b.taxi.yandex.net/b2b/cargo/integration/v2/offers/calculate" \ -H "Accept-Language: {string}" \ -d '{ "items": [ { "quantity": 1, "size": { "height": 0.05, "length": 0.15, "width": 0.1 }, "weight": 2.105 } ], "requirements": { "due": "2020-01-01T00:00:00+00:00", "pro_courier": false, "skip_door_to_door": false, "taxi_classes": [ "express" ] }, "route_points": [ { "coordinates": [ 0.1, 0.1 ], "fullname": "St. Petersburg, Bolshaya Monetnaya Ulitsa, 1 bld. 1A" } ] }'
Copied to clipboard
Responses:
{ "offers": [ { "delivery_interval": { "from": "2023-07-17T08:02:26.607358+00:00", "to": "2023-07-17T09:15:43.607358+00:00" }, "description": "express_30min_longer", "payload": "5e2TPP5f7Yqyv19yRZ+QVas4JK+lhwa17ncxA3VCGI8hvnFS+CIySbmfHQlR6vhC2S4XsW+M7TbEV0EQl1/1Z0PO3QQX8KbGb6rtKay", "pickup_interval": { "from": "2023-07-17T08:02:26.607358+00:00", "to": "2023-07-17T08:42:26.607358+00:00" }, "price": { "base_price": "611.8", "currency": "RUB", "surge_ratio": 1.1, "total_price": "673.0", "total_price_with_vat": "807.6" }, "taxi_class": "express" } ] }
Copied to clipboard
{ "code": "validation_error", "message": "Validation error" }
Copied to clipboard
{ "code": "validation_error", "message": "Validation error" }
Copied to clipboard