Документация для разработчиков
Темная тема

Расчет стоимости доставки

Scope: sale, delivery Права на выполнение: для всех

JSON схема запроса

Пример запроса JSON:

{
	SHIPMENT: {
		ID: 354,
		DELIVERY_SERVICE: {
			ID: 716,
			CONFIG: [
				{
					CODE: "PROFILE_TYPE",
					VALUE: "TAXI",
				}
			],
			PARENT: {
				ID: 715,
				CONFIG: [
					{
						CODE: "SETTING_1",
						VALUE: "SETTING_1 value",
					},
					{
						CODE: "SETTING_2",
						VALUE: "SETTING_2 value",
					},
				],
			},
		},
		PRICE: 99999.99,
		CURRENCY: "RUB",
		WEIGHT: 230,
		PROPERTY_VALUES: [
			{
				ID: 451,
				TYPE: "ADDRESS",
				VALUE: {
					LATITUDE: "51.507625620491",
					LONGITUDE: "-0.12546300888062",
					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: 452,
				TYPE: "ADDRESS",
				VALUE: {
					LATITUDE: "51.511995991646",
					LONGITUDE: "-0.13612747192383",
					FIELDS: {
						POSTAL_CODE: "W1F 9UH",
						COUNTRY: "United Kingdom",
						ADM_LEVEL_1: "England",
						LOCALITY: "Westminster",
						STREET: "Great Pulteney Street",
						BUILDING: "33-34",
						ADDRESS_LINE_1: "Great Pulteney Street, 33-34",
					},
				},
			},
			{
				ID: 453,
				TYPE: "STRING",
				VALUE: "some comment",
			},
		],
		ITEMS: [
			{
				NAME: "Apple xs 128gb",
				PRICE: 99999.99,
				WEIGHT: 230,
				CURRENCY: "RUB",
				QUANTITY: 1,
				DIMENSIONS: {
					WIDTH: "5",
					HEIGHT: "5",
					LENGTH: "20",
				},
			}
		],
		EXTRA_SERVICES_VALUES: [
			{
				ID: 1034,
				CODE: "cargo_type",
				VALUE: "small_package",
			},
			{
				ID: 1033,
				CODE: "door_delivery",
				VALUE: "Y",
			},
		],
		RESPONSIBLE_CONTACT: null,
		RECIPIENT_CONTACT: null,
	}
}

Пример ответа с успешным расчетом стоимости:

{
	SUCCESS: "Y",
	PRICE: 79.99,
}

Пример ответа с ошибкой при расчете стоимости:

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


© «Битрикс», 2001-2024, «1С-Битрикс», 2024