Skip to main content
A tradeline is a recurring route for a specific customer: a pickup address and a delivery address under a stable identifier from the customer’s TMS. Vectrix keeps tradelines as a project-level catalog and uses it in the shipment editor to recognize which route a shipment belongs to and fill in the linked addresses. The feature is project-configured and off by default.

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:
{"external_id":"TL-001","name":"Brussels - Antwerp ROAD","customer_id":"CUST-001","pickup_address_external_id":"ADDR-PICKUP","delivery_address_external_id":"ADDR-DELIVERY","is_active":true}
FieldRequiredDescription
external_idYesStable tradeline identifier from the source TMS. Used for upserts.
nameYesHuman-readable tradeline name.
customer_idYesCustomer identifier of an already imported customer.
pickup_address_external_idYesExternal address ID of an already imported pickup address.
delivery_address_external_idYesExternal address ID of an already imported delivery address.
is_activeNoDefaults to true.
The dialog’s Conversion Prompt tab contains an LLM prompt that converts raw TMS exports into this format.

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 by external_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_id does 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_id after 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:
  1. Links the tradeline’s customer to the order if a different one was set.
  2. Fills the pickup and delivery stops with the tradeline’s addresses.
  3. Stores the tradeline reference on the shipment’s tradeline_id field 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.