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
How to Configure shipper_info in a Cargo Condition
In 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:
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_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
Summary Flow
Last updated
Was this helpful?

