As previously discussed on the create-order-V2 (link to the page), the delivery object is a powerful tool that enables the automation of order dispatches during the order creation process.
There are four different ways to compose the delivery object, and we will explore them from the simplest and least detailed approach to the most specific option you can choose.
1 - Preference Rule (minimal Object)
The simplest way to compose the delivery object is by specifying only the preference_rule. The chosen preference rule will determine which delivery_method among your registered options will be selected for order dispatch. There are two available preference_rules: cheapest and fastest.
{
"preference_rule": "fastest"
}
You can use this form of the delivery object even if you are not utilizing the Quotation Endpoint or the Delivery Options
2 - By Carrier Name
Another less specific way to compose the delivery object is by providing the name of the chosen carrier for delivery. Since the carrier name alone is not enough to define the exact delivery method, this format allows you to include the carrier name with an optional preference_rule. If the preference_rule is not specified, its default value will be 'cheapest'. To retrieve the names of the carriers available for your order, you may utilize the Delivery Options endpoint.
{
"carrier_name": "VAPT-VUPT",
"schedule_at": "2025-03-28T15:08:00.000Z",
"preference_rule": "fastest" //optional
}
3 - By Carrier Name + Carrier Method Type
This format is slightly more specific than using the carriername as it also takes into account the carrier's method_type._Again, in order to retrieve the names of the carriers and methods available for your order, you may utilize the Delivery Options endpoint.
{
"carrier_name": "VAPT-VUPT",
"method_type": "CONVENCIONAL",
"schedule_at": "2025-03-28T15:08:00.000Z"
}
4 - By Logistic_id
This is the most precise and specific way to request a pickup using the delivery object. There are two ways to compose this object, both of which require the use of the Quotation Endpoint.
Both the logistic_id and method_id can be retrieved from the quotation endpoint. The logistic_id represents the carrier and the method_type, while the method_id reflects the time frame for the delivery.
There are two types of method_ids:
- The first type is D(n), which is commonly used for conventional methods, where n represents the number of days (e.g. A carrier with a conventional method_type have a method_id D3, which means conventional delivery in 3 days).
- The second type is EXP(n), which is used for express methods, where n represents the time in minutes (e.g. A carrier with a Express method_type have a method_id EXP120 , which means express delivery in 120 minutes).
Assembling the Logistics Object
Because this delivery object is the most specific possible, it is necessary to provide the logistic_id along with the method_id (time frame).
Alternatively, you have the option to send only the logistic_id, which will result in a behavior similar to what is described in the 3 format(Carrier Name + Carrier Method Type), where the tie-breaking criterion is determined by the preference_rule.
Quick disclaimer: In rare cases, the quotation_endpoint might return the method_id as a UUID. Don't worry about this, these methods are being deprecated but will continue to function for now. You can still use them without issue.
{
"logistic_id": "9edc4f36-0444-47a7-a8e1-3ba0ba9deb45",
"method_id": "D1",
"schedule_at": "2025-03-28T15:08:00.000Z"
}
{
"logistic_id": "9edc4f36-0444-47a7-a8e1-3ba0ba9deb45",
"schedule_at": "2025-03-28T15:08:00.000Z",
"preference_rule"?: "cheapest" //fastest
}
