Enable the feature
Open Project configuration and turn on Enable Tradelines in the features section. Enabling it adds:- A Tradelines tab in the CRM navigation, next to Companies, Locations, and Contacts, listing the catalog with a detail sidebar.
- An Upload Tradelines button on Testing → Customers.
- A Tradeline field on the shipment detail page, rendered above the stops.
Projects that already used a
tradeline_id shipment field before the flag
existed can run the backfillTradelineFeatureFlag migration from Testing →
Migrations to enable the feature everywhere it was already in use.Import tradelines
Import the catalog as a JSONL file via Testing → Customers → Upload Tradelines. Each line is one tradeline object:| Field | Required | Description |
|---|---|---|
external_id | Yes | Stable tradeline identifier from the source TMS. Used for upserts. |
name | Yes | Human-readable tradeline name. |
customer_id | Yes | Customer identifier of an already imported customer. |
pickup_address_external_id | Yes | External address ID of an already imported pickup address. |
delivery_address_external_id | Yes | External address ID of an already imported delivery address. |
is_active | No | Defaults to true. |
Background processing
Uploads run as background upload runs on Convex, the same system used for customer and address uploads. The dialog validates the file locally for a preview, stores it, and starts a run; you can close the dialog and leave the page. The Upload Runs card on the same screen shows live progress, created/updated/failed counts, and per-row errors. Rows are processed in server-side batches and upserted byexternal_id within the project: existing tradelines are updated, new ones created. The uploaded file is limited to 25 MB and is deleted from storage once the run finishes.
Reference resolution
Import customers and addresses before tradelines — rows are resolved against the existing catalog:- A row whose
customer_iddoes not match an existing customer fails and is reported in the run’s row errors. - A row whose pickup or delivery address cannot be resolved is imported as inactive. Re-importing the same
external_idafter the missing addresses exist activates it.
Matching in the shipment editor
On the shipment detail page the tradeline appears as a dedicated block above the stops, because it connects two stops rather than describing a single field. The option list is scoped to the shipment: only tradelines matching the shipment’s customer or its linked pickup/delivery addresses are offered. When the scoped list contains exactly one candidate that is not yet applied, it is applied automatically. Applying a tradeline — automatically or by picking one from the list:- Links the tradeline’s customer to the order if a different one was set.
- Fills the pickup and delivery stops with the tradeline’s addresses.
- Stores the tradeline reference on the shipment’s
tradeline_idfield and autosaves.
Auto-apply never triggers from an unscoped match. A project with a single
global tradeline does not get it applied to shipments that share no customer
or address with it.