DOCS

Shipment automation rules

Shipment automation rules

Automatically modify shipments as they are created, based on conditions you define.

Shipment automation rules adjust a shipment as it is created, based on its data. Define a rule once and Zonos applies it to every matching shipment—no setting the service level, packaging, or signature by hand on each one.

Each rule is a pair of expressions:

  • A condition that decides when the rule applies.
  • One or more actions that change the shipment when the condition matches.

Rules run automatically whenever shipments are created.

How a rule works 

Each rule is made up of:

PartDescription
ConditionWhen the rule applies, based on the shipment's data (see the condition fields below).
ActionsWhat the rule changes on the shipment when the condition matches (see the actions below).
Starts atThe date the rule becomes effective. If empty, the rule is disabled.
Ends atThe date the rule stops being effective. If empty, the rule has no end date.

Condition fields 

These are the read-only facts about a shipment that a condition can reference. Conditions can compare against them, but actions cannot change them.

Weight and dimensions

FieldTypeDescription
weightNumberTotal weight of the shipment.
weight_unitStringUnit of weight (for example, lb, kg, oz).
dimension_unitStringUnit of dimensions (for example, in, cm).

Geography

FieldTypeDescription
ship_to_countryCountryDestination country.
ship_from_countryCountryOrigin country.
ship_to_stateStringDestination state or province code.
ship_to_postal_codeStringDestination postal code.

Shipment flags

FieldTypeDescription
is_domesticBooleantrue when the origin and destination country match.

Customs and compliance

FieldTypeDescription
ddpBooleanWhether the shipment is DDP (duties prepaid).
dduBooleanWhether the shipment is DDU (duties unpaid).
base_currencyCurrencyBase currency of the merchant.
hs_codesString listAll HS codes in the shipment.
countries_of_originString listCountries of origin for all items.

Monetary amounts

FieldTypeDescription
items_totalMoneyTotal value of the items.
shipping_totalMoneyShipping cost.
duty_totalMoneyTotal duty amount.
tax_totalMoneyTotal tax amount.
grand_totalMoneyGrand total (items_total + shipping_total + duty_total + tax_total).

Item data

FieldTypeDescription
sku_listString listAll SKUs on the order.
item_countNumberTotal number of items in the shipment.

Actions 

When a rule matches, its actions assign values to the fields below. After all actions run, the changed values are applied back to the shipment.

ActionTypeWhat it does
service_levelStringSets the shipment's service level by code or ID.
package_typeStringSets the packaging type on every carton.
signature_requiredBooleanWhen true, requires a direct signature on each carton; when false, sets no signature.
insuranceBooleanWhen true, insures the shipment for the full items_total; when false, sets the declared value to 0.
customs_descriptionStringSets the customs description on all items in the shipment.

How actions are applied

  • An action only takes effect if it changes the existing value.
  • A package_type value that doesn't match a known packaging type is skipped.
  • If one rule fails (for example, an invalid expression), it is skipped and logged. It does not block other rules or fail the shipment.

Examples 

A few common ways merchants use shipment automation rules:

  • Require a signature and set a packaging type on shipments over a certain weight.
  • Add insurance to high-value DDP shipments.
  • Set a customs description for items in a specific product category.
  • Upgrade the service level for shipments to a specific destination.

Setting up rules 

To get shipment automation rules created for your account, contact your Zonos representative. Share the conditions you want to match and the actions you want applied, and the Zonos team will configure the rules for you.

Auditing applied rules 

Every time a rule is applied to a shipment, Zonos records an applied-rule entry capturing the before and after values of the affected fields. These entries are available on the shipment so you can audit exactly which rules ran and what they changed.

Book a demo

Was this page helpful?