Documentation

Creating transporation order

JSON query schema

JSON query example:

{
    SHIPMENTS: [
        {
            ID: 354,
            DELIVERY_SERVICE: {
                ID: 723,
                CONFIG: [
                    {
                        CODE: "PROFILE_TYPE",
                        VALUE: "TAXI",
                    }
                ],
                PARENT: {
                    ID: 722,
                    CONFIG: [
                        {
                            CODE: "SETTING_1",
                            VALUE: "SETTING_1 value",
                        },
                        {
                            CODE: "SETTING_2",
                            VALUE: "SETTING_2 value",
                        },
                    ],
                },
            },
            PRICE: 99999.99,
            CURRENCY: "GBP",
            WEIGHT: 230,
            PROPERTY_VALUES: [
                {
                    ID: 451,
                    TYPE: "ADDRESS",
                    VALUE: {
                        LATITUDE: "51.505779",
                        LONGITUDE: "-0.127673",
                        FIELDS: {
                            POSTAL_CODE: "SW1A 2WH",
                            COUNTRY: "United Kingdom",
                            ADM_LEVEL_1: "England",
                            LOCALITY: "Westminster",
                            STREET: "Whitehall",
                            BUILDING: "26",
                            ADDRESS_LINE_1: "Whitehall, 26",
                            ADDRESS_LINE_2: "Ripley Buildings",
                        },
                    },
                },
                {
                    ID: 452,
                    TYPE: "ADDRESS",
                    VALUE: {
                        LATITUDE: "51.507642",
                        LONGITUDE: "-0.125452",
                        FIELDS: {
                            POSTAL_CODE: "WC2N 5NS",
                            COUNTRY: "United Kingdom",
                            ADM_LEVEL_1: "England",
                            LOCALITY: "Westminster",
                            STREET: "Craven Street",
                            BUILDING: "10",
                            ADDRESS_LINE_1: "Craven Street, 10",
                        },
                    },
                },
                {
                    ID: 453,
                    TYPE: "STRING",
                    VALUE: "Some comments",
                },
            ],
            ITEMS: [
                {
                    NAME: "Apple xs 128gb",
                    PRICE: 99999.99,
                    WEIGHT: "230.00",
                    CURRENCY: "GBP",
                    QUANTITY: 1,
                    DIMENSIONS: {
                            WIDTH: "5",
                            HEIGHT: "5",
                            LENGTH: "20",
                    },
                }
            ],
            EXTRA_SERVICES_VALUES: [
                {
                    ID: 1036,
                    CODE: "cargo_type",
                    VALUE: "small_package",
                },
                {
                    ID: 1035,
                    CODE: "door_delivery",
                    VALUE: "Y",
                },
            ],
            CONTACTS: {
                RESPONSIBLE: {
                    NAME: "Liam Williams",
                    PHONES: [
                        {
                            TYPE: "WORK",
                            VALUE: "+73472222009",
                        }
                    ],
                },
                RECIPIENT: {
                    NAME: "John Smith",
                    PHONES: [
                        {
                            TYPE: "WORK",
                            VALUE: "+79097996161",
                        }
                    ],
                },
            },
        }
    ]
}

Example of response with successfully created order:

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

Example of response with unsuccessfully attempt to create a transportation order:

{
    SUCCESS: "N",
    REASON: {
        TEXT: "Delivery is not currently available"
    },
}


© «Bitrix24», 2001-2024