Create Delivery Request CREATE_DELIVERY_REQUEST_URL

The request is sent to the address specified in CREATE_DELIVERY_REQUEST_URL when creating a delivery handler using the method sale.delivery.handler.add.

Request Parameters

Name
type

Description

SHIPMENTS
object[]

Information about shipments (detailed description provided below)

SHIPMENT

Name
type

Description

ID
sale_order_shipment.id

Identifier of the shipment.

If the calculation is based on an unsaved shipment, the parameter value will be null.

You can obtain shipment identifiers using the sale.shipment.list method

DELIVERY_SERVICE
object

Information about the selected delivery service, its profile, and settings (detailed description provided below)

PRICE
double

Total cost of goods for the client in the shipment

CURRENCY
crm_currency.CURRENCY

Currency code of the cost

WEIGHT
double

Total weight of goods in the shipment (in grams)

PROPERTY_VALUES
object[]

Array containing the property values of the shipment (detailed description provided below)

ITEMS
object[]

Array containing all the goods included in the shipment (detailed description provided below)

EXTRA_SERVICE_VALUES
object[]

Array containing a list of necessary additional services selected for delivery (detailed description provided below)

RESPONSIBLE_CONTACT
object

Information about the contact person responsible for delivery from Bitrix24 (detailed description provided below)

RECIPIENT_CONTACT
object

Information about the recipient's contact person (detailed description provided below)

DELIVERY_SERVICE

Name
type

Description

ID
sale_delivery_service.ID

Identifier of the delivery service

CONFIG
object[]

Values of the delivery service settings (detailed description provided below)

PARENT
object

Information about the parent delivery service (detailed description provided below)

PARENT

Name
type

Description

ID
sale_delivery_service.ID

Identifier of the parent delivery service

CONFIG
object[]

Values of the parent delivery service settings (detailed description provided below)

CONFIG

Name
type

Description

CODE
string

Symbolic code of the setting

VALUE
any

Value of the setting

PROPERTY_VALUES

Name
type

Description

ID
sale_shipment_property.id

Identifier of the shipment property.

You can obtain the identifier of shipment properties using the sale.shipmentproperty.list method

TYPE
string

Type of the property. Possible values:

  • STRING
  • Y/N
  • NUMBER
  • ENUM
  • FILE
  • DATE
  • LOCATION
  • ADDRESS

VALUE
string | object

Value of the property. For the object type, detailed description provided below

VALUE

Name
type

Description

LATITUDE
double

Geographic latitude

LONGITUDE
double

Geographic longitude

FIELDS
object

Detailed information about the delivery address (detailed description provided below)

FIELDS

Name
type

Description

POSTAL_CODE
string

Postal code

COUNTRY
string

Country

ADM_LEVEL_1
string

First-level administrative division unit (e.g., state or region)

ADM_LEVEL_2
string

Second-level administrative division unit (e.g., district)

LOCALITY
string

Locality

STREET
string

Street

BUILDING
string

Building, house number

ADDRESS_LINE_1
string

Address (street, building, house number)

ITEMS

Name
type

Description

NAME
string

Name of the product

PRICE
double

Price of a single item of the product

CURRENCY
crm_currency.CURRENCY

Currency code of the price

WEIGHT
double

Weight of a single item of the product

QUANTITY
double

Quantity of product units

DIMENSIONS
object

Dimensions of the cargo (detailed description provided below)

DIMENSIONS

Name
type

Description

LENGTH
double

Length of the product (mm)

WIDTH
double

Width of the product (mm)

HEIGHT
double

Height of the product (mm)

EXTRA_SERVICE_VALUES

Name
type

Description

ID
sale_delivery_extra_service.ID

Identifier of the service.

You can obtain the identifiers of delivery service extra services using the sale.delivery.extra.service.get method

CODE
string

Symbolic code of the additional service

VALUE
string | double

Value.

Depending on the type (sale_delivery_extra_service.TYPE) of the additional service, the value is formed differently:

  • checkbox
    • Y — if the service is required
    • N — if the service is not required
  • enum — string containing the symbolic code of the selected value from the service list
  • quantity — number reflecting the required amount for the additional service

RESPONSIBLE_CONTACT

Name
type

Description

NAME
string

Full name of the contact

PHONES
object[]

Array containing information about the contact's phone numbers (detailed description provided below)

RECIPIENT_CONTACT

Name
type

Description

NAME
string

Full name of the contact

PHONES
object[]

Array containing information about the contact's phone numbers (detailed description provided below)

PHONES

Name
type

Description

TYPE
string

Type of phone. Possible values:

  • WORK
  • MOBILE
  • HOME
  • FAX
  • PAGER

VALUE
string

Phone number

Examples

Example JSON request:

{
            "SHIPMENTS":[
                {
                    "ID":4063,
                    "DELIVERY_SERVICE":{
                        "ID":225,
                        "CONFIG":[
                            {
                                "CODE":"PROFILE_TYPE",
                                "VALUE":"CARGO"
                            }
                        ],
                        "PARENT":{
                            "ID":223,
                            "CONFIG":[
                                {
                                    "CODE":"SETTING_1",
                                    "VALUE":"String Example Value"
                                }
                            ]
                        }
                    },
                    "PRICE":179998,
                    "CURRENCY":"USD",
                    "WEIGHT":600,
                    "PROPERTY_VALUES":[
                        {
                            "ID":100,
                            "TYPE":"ADDRESS",
                            "VALUE":{
                                "LATITUDE":55.726421,
                                "LONGITUDE":37.61187,
                                "FIELDS":{
                                    "COUNTRY":"USA",
                                    "ADM_LEVEL_1":"Los Angeles",
                                    "ADM_LEVEL_2":"Los Angeles",
                                    "ADM_LEVEL_3":"South",
                                    "LOCALITY":"Los Angeles",
                                    "SUB_LOCALITY_LEVEL_1":"Central",
                                    "STREET":"Flowers Street",
                                    "BUILDING":"9",
                                    "ADDRESS_LINE_1":"Flowers Street, 9"
                                }
                            }
                        },
                        {
                            "ID":101,
                            "TYPE":"ADDRESS",
                            "VALUE":{
                                "LATITUDE":55.724779,
                                "LONGITUDE":37.614294,
                                "FIELDS":{
                                    "POSTAL_CODE":"115162",
                                    "COUNTRY":"USA",
                                    "ADM_LEVEL_1":"Los Angeles",
                                    "ADM_LEVEL_2":"South",
                                    "LOCALITY":"Los Angeles",
                                    "STREET":"Flowers Street",
                                    "BUILDING":"13 b10",
                                    "ADDRESS_LINE_1":"Flowers Street, 13 b10"
                                }
                            }
                        }
                    ],
                    "ITEMS":[
                        {
                            "NAME":"iPhone 14",
                            "PRICE":89999,
                            "WEIGHT":300,
                            "CURRENCY":"USD",
                            "QUANTITY":2,
                            "DIMENSIONS":{
                                "WIDTH":400,
                                "HEIGHT":80,
                                "LENGTH":500
                            }
                        }
                    ],
                    "EXTRA_SERVICES_VALUES":[
                        {
                            "ID":138,
                            "CODE":"cargo_type",
                            "VALUE":"small_package"
                        },
                        {
                            "ID":137,
                            "CODE":"door_delivery",
                            "VALUE":"Y"
                        },
                        {
                            "ID":139,
                            "CODE":"some_quantity_service",
                            "VALUE":2
                        }
                    ],
                    "RESPONSIBLE_CONTACT":{
                        "NAME":"Ronald Perez",
                        "PHONES":[
                            {
                                "TYPE":"MOBILE",
                                "VALUE":"+19097996161"
                            }
                        ]
                    },
                    "RECIPIENT_CONTACT":{
                        "NAME":"James Johnson",
                        "PHONES":[
                            {
                                "TYPE":"WORK",
                                "VALUE":"+19097996162"
                            }
                        ]
                    }
                }
            ]
        }
        

Response Parameters

Required parameters are marked with *

Name
type

Description

SUCCESS*
string

Indicator of the success of the delivery cost calculation. Possible values:

  • Y — cost calculated successfully
  • N — an error occurred while attempting to calculate the cost

REQUEST_ID
string

Identifier of the delivery request issued by the external system

REASON
object

Reason for the error. Provided in case of an unsuccessful cost calculation attempt (detailed description provided below)

REASON

Name
type

Description

TEXT*
string

Description of the error

Example Response with Successful Delivery Request Creation

{
            "SUCCESS": "Y",
            "REQUEST_ID": "4757aca4931a4f029f49c0db4374d13d"
        }
        

Example Response with Error in Cost Calculation

{
            "SUCCESS": "N",
            "REASON": {
                "TEXT": "Delivery is not available for the specified address"
            }
        }
        

Continue Learning