2.3. Receipt of delivery offers

  1. HTTP Request
  2. Header Parameters
  3. Request Body
    1. Representation
    2. Fields
  4. Responses
    1. Code 200
      1. Representation
      2. Fields
    2. Code 400
      1. Representation
      2. Fields
    3. Code 409
      1. Representation
      2. Fields
  5. Example
  • 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

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

Collapse all
Expand all

Fields

items[]

array

Listing of boxes to be shipped

items[].quantity *

integer

Number of product units

Minimum value: 1.

items[].size

object

Linear dimensions of the item in meters.
Example: 0.45

items[].size.height *

number

items[].size.length *

number

items[].size.width *

number

items[].weight

number

Weight in kilograms.
Example: 2.105

requirements

object

Delivery requirements

requirements.due

string

Expected delivery time (you can postpone the expected time for 30-60 minutes from the current moment)

requirements.pro_courier

boolean

Option "Pro" for "Express" tariff.

requirements.skip_door_to_door

boolean

Refusing door-to-door delivery (turn off the "Door-to-door" option).

Possible values:

  • true (the courier will deliver the order only to the street, to the entrance)
  • false (by default, door-to-door delivery)

requirements.taxi_classes[]

array

route_points[] *

array

Route points. Sorted in order of visit A-B1....BN

route_points[].coordinates[]

array

Array of two real numbers [longitude, latitude]. The order is important!

route_points[].fullname

string

Full name indicating the city (Moscow, Sadovnicheskaya Naberezhnaya, 82 bld. 2).
It's important to enter a locality indicating the house number but without the apartment number, entrance, or floor

items[]

array

Listing of boxes to be shipped

items[].quantity *

integer

Number of product units

Minimum value: 1.

items[].size

object

Linear dimensions of the item in meters.
Example: 0.45

items[].size.height *

number

items[].size.length *

number

items[].size.width *

number

items[].weight

number

Weight in kilograms.
Example: 2.105

requirements

object

Delivery requirements

requirements.due

string

Expected delivery time (you can postpone the expected time for 30-60 minutes from the current moment)

requirements.pro_courier

boolean

Option "Pro" for "Express" tariff.

requirements.skip_door_to_door

boolean

Refusing door-to-door delivery (turn off the "Door-to-door" option).

Possible values:

  • true (the courier will deliver the order only to the street, to the entrance)
  • false (by default, door-to-door delivery)

requirements.taxi_classes[]

array

route_points[] *

array

Route points. Sorted in order of visit A-B1....BN

route_points[].coordinates[]

array

Array of two real numbers [longitude, latitude]. The order is important!

route_points[].fullname

string

Full name indicating the city (Moscow, Sadovnicheskaya Naberezhnaya, 82 bld. 2).
It's important to enter a locality indicating the house number but without the apartment number, entrance, or floor

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

Collapse all
Expand all

Fields

offers[] *

array

Array of delivery options

offers[].delivery_interval *

object

Time interval for the delivery (point B)

offers[].delivery_interval.from *

string

Start of the time interval (UTC)

offers[].delivery_interval.to *

string

End of the time interval (UTC)

offers[].description

string

Description of the delivery option. Example: express_30min_longer (express with a delay of 30 minutes)

offers[].payload *

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[].pickup_interval *

object

Time interval for the pickup (point A)

offers[].pickup_interval.from *

string

Start of the time interval (UTC)

offers[].pickup_interval.to *

string

End of the time interval (UTC)

offers[].price *

object

Price

offers[].price.base_price

string

Base shipping price

offers[].price.currency *

string

Currency

offers[].price.surge_ratio *

number

The growth rate of the order value (depending on the system loads)

offers[].price.total_price *

string

Price taking into account the growth factor of the order value (without VAT)

offers[].price.total_price_with_vat *

string

Price taking into account the growth factor of the order value (including VAT)

offers[].taxi_class *

string

offers[] *

array

Array of delivery options

offers[].delivery_interval *

object

Time interval for the delivery (point B)

offers[].delivery_interval.from *

string

Start of the time interval (UTC)

offers[].delivery_interval.to *

string

End of the time interval (UTC)

offers[].description

string

Description of the delivery option. Example: express_30min_longer (express with a delay of 30 minutes)

offers[].payload *

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[].pickup_interval *

object

Time interval for the pickup (point A)

offers[].pickup_interval.from *

string

Start of the time interval (UTC)

offers[].pickup_interval.to *

string

End of the time interval (UTC)

offers[].price *

object

Price

offers[].price.base_price

string

Base shipping price

offers[].price.currency *

string

Currency

offers[].price.surge_ratio *

number

The growth rate of the order value (depending on the system loads)

offers[].price.total_price *

string

Price taking into account the growth factor of the order value (without VAT)

offers[].price.total_price_with_vat *

string

Price taking into account the growth factor of the order value (including VAT)

offers[].taxi_class *

string

Code 400

Invalid request

{
  "code": string,
  "message": string
}
Copied to clipboard

Representation

Collapse all
Expand all

Fields

code *

string

Error code

message *

string

Error description

code *

string

Error code

message *

string

Error description

Code 409

There are no suitable cars | Failed to build a route

{
  "code": string,
  "message": string
}
Copied to clipboard

Representation

Collapse all
Expand all

Fields

code *

string

Error code

message *

string

Error description

code *

string

Error code

message *

string

Error description

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