Packing Start Scripts
A Packing Start Script runs every time a packer opens a Shipment for packing in the Scanner. It can read details about the Shipment and adjust a handful of packing behaviors — most commonly the Weight Check tolerance band — for that specific Shipment, on top of whatever the Packing (Parcel) / Packing (Freight) configuration sections already provide.
See Scripting Basics to become more familiar with scripting in ShipStream in general.
Where It Lives
Packing Start Scripts are configured at System -> Configuration -> Warehouse -> Scanner -> Packing (General) -> Packing Start Script. Like Scale Precision, this setting applies per warehouse (Stock), not per Shipment Type — a single script runs for every Shipment packed at that warehouse, and can branch on the Shipment's own shipment_type if it needs to behave differently for Parcel vs. Freight.
Script Data
shipment (read-only)
| Field | Description |
|---|---|
shipment_id | The Shipment's entity ID |
external_id | External ID, if any |
order_unique_id | The Order's increment ID |
order_ref | The Order's external reference |
carrier_code | Carrier code for the Shipment's shipping method |
shipping_method | The Shipment's shipping method code |
batch_tag | Batch tag from the Order |
automation_data | Automation data from the Order |
merchant | Website code |
brand | Store code |
is_international | Whether the Shipment is international |
is_documents_required | Whether customs/other documents are required |
stock_id | Warehouse (Stock) ID |
picking_class_id | Picking Class ID |
shipment_type | parcel or freight |
shipment_weight, order_weight | Total weight of the Shipment / Order |
shipment_weight and order_weight also carry unit-suffixed variants for every supported weight unit — _lb, _oz, _g, and _kg (e.g. shipment_weight_lb, shipment_weight_kg) — use whichever unit suffix matches your logic instead of assuming the base unit.
config (readable)
| Field | Description |
|---|---|
create_shipping_label | Whether a shipping label will be created automatically |
create_shipping_label_offline | Whether the Shipment must ship offline (no label) |
print_shipping_label | Whether to print the shipping label automatically |
require_package_weight | Whether package weight is required to finish packing |
post_automation_url | URL to call after packing completes |
use_blind_count | Blind Count setting |
reset_packing_progress | Reset Packing Progress On Incorrect Count setting |
require_packaging_scan | Require Packaging Scan setting |
require_box_first | Require Box/Pallet Packaging First setting |
require_manual_override | Require Manual Packing Solutions Override setting |
require_item_sscc_association | Require Item SSCC Association setting |
fulfill_id | The Bulk Fulfill Order ID, if packing as part of one |
bypass_weight_check | Whether the weight check is bypassed entirely |
max_weight_check_failures | Maximum Weight Check Failures setting |
weight_check_diff_min | Weight Check Difference Minimum |
weight_check_diff_percent | Weight Check Difference Percentage |
weight_check_diff_max | Weight Check Difference Maximum |
scale_precision | Warehouse Scale Precision |
bulk_package | Bulk packaging data, when applicable |
containers | Container details from the packing solution, if any |
strict_containers | Whether packages must match containers 1:1 |
initial_solution_id | The packing solution ID applied to the Shipment |
container_styles | Container display styles for the 3D solution viewer |
skip_barcode_verification | Skip Barcode Verification setting |
auto_pack | Auto-Pack Button mode |
containers entries carry unit-suffixed length / width / height variants, same convention as the shipment weight fields.
Settable
Only the following config properties are read back after the script runs — anything else your script changes on config is silently ignored:
create_shipping_label, print_shipping_label, require_package_weight, reset_packing_progress, require_packaging_scan, post_automation_url, max_weight_check_failures, use_blind_count, weight_check_diff_min, weight_check_diff_percent, weight_check_diff_max.
Behavior Notes
- Do not write a
returnstatement — the script body runs directly (not inside a function), soreturnis a syntax error there. Just assign toconfigdirectly; its final value is used automatically. - Script changes apply after the Packing (Parcel) / Packing (Freight) configuration is resolved for the Shipment's type, so a script always wins over those settings.
print()output is shown at the bottom of the packing page as "Packing Start Script output: …".- A thrown exception — including a syntax error such as a stray
return— is caught and shown as an info message, "Packing Start Script error: …", and does not block packing or raise any other warning. A script that silently fails to apply is usually this: check the packing page's info message for an error before assuming the setting was ignored.
Examples
Override the weight check band for a specific warehouse and Freight
// Freight shipments at warehouse 3 use a wider Percentage than the Freight default
if (shipment.shipment_type === 'freight' && shipment.stock_id === 3) {
config.weight_check_diff_percent = 15;
}
Skip automatic label creation for a carrier
// This carrier's labels are always created manually
if (shipment.carrier_code === 'external') {
config.create_shipping_label = false;
}