Skip to main content

Parcel Optimization with Codept

Codept offers a parcel optimization service in addition to providing a single API to ship parcels using multiple providers.

When working with multiple parcel providers and multiple warehouses, the provider you choose for each parcel might result in a different total cost and delivery time. While the cost has always been an important factor to consider, the delivery times are increasingly important with the rise of models like Seller Fulfilled Prime and the delivery time guarantees that are needed to participate in these models.

The Parcel Optimization functionality in Codept allows you to set a number of rules according to which the parcel provider will be chosen for each order. This ensures that you optimize both overall cost and runtime while automating the decision process as much as possible.

How parcel optimization works#

The rules for parcel optimization can be of two types.

General distribution rules allow you to direct portions of all orders to specific providers. For example, you can configure this rule to have 60% of all parcels shipped with Provider 1, 30% with Provider 2, and 10% with Provider 3.

Specific rules are the way for Codept to make a decision on a parcel provider based on a number of attributes in the order data. The specific rules override the general rules. If no specific rule matches a certain order, the decision on the shipping provider will be made according to the general rules.

The specific rules can be based on the following attributes:

  • Postal index
  • Address
  • Parcel weight
  • Parcel size

There are no limits on the number of specific rules or their complexity. However, it is important to consider the interplay between general distribution rules and specific rules. If too many parcels are assigned to a specific carrier by specific rules, it may not be possible to achieve the overall distribution set by general rules.

Codept can suggest specific optimizations based on the patterns of cost, location and delivery time.

The Codept team will help you set up the optimization rules during the onboarding process and keep them up to date.

How to enable parcel optimization#

When using the Shipment Orders API endpoint, you must supply the optimize field as part of the carrier object:

{
"orderId": "order#1",
"customerId": "customer#1",
"merchantCodeptId": "MT_DE_2002",
"senderAddress": {
"name": "",
"lastName": "",
"additionalName": "",
"street": "Kollwitzstraße",
"companyName": "Codept",
"houseNumber": "64",
"zip": "10435",
"city": "Berlin",
"country": "DE",
"telephoneNumber": "+4917695363136"
},
"recipientAddress": {
"name": "John",
"lastName": "Doe",
"additionalName": "Patric",
"street": "Kollwitzstraße",
"companyName": "Codept",
"houseNumber": "64",
"zip": "10435",
"city": "Berlin",
"country": "DE",
"postbox": "Codept",
"gpsLocation": "52.536543,13.417865",
"telephoneNumber": "+4917695363136"
},
"parcels": [
{
"clientReferenceNumber": "reference#1",
"weight": 1.23,
"length": 2.32,
"width": 3.12,
"height": 1.02,
"carrier": {
"optimize": true,
"notificationEmail": "test@merchant.com",
"createShippingLabel": true
},
"additionalServices": []
},
{
"clientReferenceNumber": "reference#2",
"weight": 1.23,
"length": 2.32,
"width": 3.12,
"height": 1.02,
"carrier": {
"optimize": true,
"notificationEmail": "test@merchant.com",
"createShippingLabel": true
},
"additionalServices": []
}
]
}

Setting the optimize field to false will make Codept use the information in the carrier field to choose the parcel provider. If set to true, the provider will be chosen dynamically based on the optimization rules.