Omnitron Shipment Client
OmnitronShipmentClient can produce a shipping label (cargo label) in two ways:
Local generation (default): The label is generated inside OMS via
get_label_data.Fetch from Omnitron: The label is retrieved from the shipping-info record on Omnitron (
cargo_label).
Which path is used is controlled by two independent flags under shipper_info.strategies.
Strategies
fetch_label
false
If true, the label is fetched from Omnitron; if false, it is generated locally.
fetch_label_only_for_4p
false
Only meaningful when fetch_label = true. If true, the label is fetched from Omnitron only for orders where extra_field.is4P evaluates to true; for all other orders the label is generated locally. If false (default), the is4P check is skipped and the label for all orders is fetched from Omnitron.
Behavior Table
fetch_label
fetch_label_only_for_4p
extra_field.is4P
Result
false
—
—
Label is generated locally
true
false (default)
any
Label is fetched from Omnitron
true
true
true / "true"
Label is fetched from Omnitron
true
true
false / missing / "false"
Label is generated locally
The is4P value is supported both as a boolean (true) and as a string ("true"). For string values, case and leading/trailing whitespace are ignored (e.g. " True " is accepted as true). Any other value (false, 0, null, or the field being absent entirely) is treated as "not 4P".
How to Configure shipper_info in a Cargo Condition
shipper_info in a Cargo ConditionIn the example condition from the original question, shipper_info was empty:
If you want labels for 4P orders to be fetched from Omnitron, shipper_info should be filled in as follows:
Full example of a cargo company condition:
If you want labels to be fetched from Omnitron for all orders (without distinguishing 4P), either omit fetch_label_only_for_4p entirely or leave it as false; just "fetch_label": true is enough.
Marking an Order as 4P
For the label to be fetchable from Omnitron (when fetch_label_only_for_4p = true), the order's extra_field must contain the is4P information:
API Service Used
When the fetch_label condition (and is4P, if required) is satisfied, the label is fetched from Omnitron via OmnitronApiClient.get_shipping_info.
Endpoint:
GET /order_shipping_infos/?order={omnitron_id}&sort=-created_dateFull URL:
{OMNITRON_BASE_URL}/order_shipping_infos/?order={omnitron_id}&sort=-created_dateAuth: Omnitron client token header (added automatically by the client)
The client takes the first record from the returned
resultslist (the most recent one, due tosort=-created_date) and uses itscargo_labelvalue as the label URL.
Example Request
Example Response
Return Value of OMS's get_shipping_label
get_shipping_labelget_shipping_label returns a (label_data, label_url) tuple:
Scenario
label_data
label_url
Fetched from Omnitron (response present)
None
cargo_label URL (e.g. https://omnitron.example.com/cargo-label/123/)
Fetched from Omnitron but shipping_info is empty/None
None
None
Generated locally
ContentFile (HTML)
OMS label URL
On the Omnitron-fetch path, label_data is always None; the label arrives as an external URL (label_url). On the local-generation path, the label content is returned as a ContentFile inside label_data.
Summary Flow
Last updated
Was this helpful?

