E-commerce pack

Shipments CSV import API

Import shipment and tracking files from any CSV: order, carrier, tracking number, ship and delivery dates, delivery status. Multilingual headers.

30-second curl
curl -X POST https://api.adaptivmapr.com/v1/uploads \
  -H "Authorization: Bearer $ADAPTIVMAPR_API_KEY" \
  -F "template=shipments_v1" \
  -F "file=@your_data.csv"
→ 8 canonical fields · 0 validated · low risk

Canonical columns

The whole schema, printed as it ships.

Every canonical column, the type each row carries, whether it is required, the field-level validators that fire on commit, and the multilingual header hints the cascade resolves against. This is the shipped definition, not a summary of it.

shipments_v1
fields
8
required
2
validated
0
hints
48
Canonical columnTypeRequiredValidatorsHeader hints the cascade matches
idstringyes—sendungsnummerversand-idnuméro d'envoiid spedizioneshipment idid de envío
order_idstringyes—bestellnummerauftragsnummernuméro de commandenumero ordineorderpedido
carrierstring——versanddienstspediteurtransporteurcorrierecarriertransportista
tracking_numberstring——trackingnummersendungsverfolgungnuméro de suivinumero di tracciamentotrackingnúmero de seguimiento
shipped_atdate——versanddatumversendet amdate d'expéditiondata di spedizioneshippedfecha de envíoship dateshipping date
delivered_atdate——zustelldatumzugestellt amdate de livraisondata di consegnadeliveredfecha de entrega
statusenumlabel_createdin_transitout_for_deliverydeliveredreturnedlost——statusstatutstatoestado
destination_countrystring——ziellandlandpays de destinationpaese di destinazionecountrypaís de destino

Read the same definition as JSON at GET /v1/templates/shipments_v1. A hint match resolves on layer 2 — no LLM call, no token spend, just the flat per-map fee. Hover a validator id to see what it checks.

  • 8 canonical fields
  • 2 required
  • 0 validated
  • 48 header hints, 5 languages

Why it exists

Written for the file you actually receive.

The Shipments template is one parcel per row: its own id and the order_id it fulfils (both required), the carrier, the tracking_number, when it shipped and when it was delivered, a status from label_created to delivered (or returned, or lost), and the destination_country. It is what a shipping platform's export, a 3PL's daily dispatch report or a carrier manifest reduces to. E-commerce operations teams use it to answer "where is my order" tickets from one table instead of four carrier portals, to measure delivery times by carrier and country, and to reconcile what a 3PL says it shipped against what the shop believes it sold. Keeping shipments apart from orders matters, because one order often leaves in two parcels. It is `low` risk, logistics data with no address lines or recipient names, so a confirmed mapping commits straight through.

id and order_id are required; everything else may be blank, because a label is created before a parcel moves. tracking_number is a free string: formats differ by carrier and the template does not check them. shipped_at and delivered_at are separate dates, auto-detected across ISO, US and European formats, so transit time is a subtraction downstream. status is an enum of six states; carrier scan events such as "arrived at sorting centre" do not fit and should be collapsed into in_transit. destination_country is free text, so "CH" and "Switzerland" both pass and can be normalised later.

Migration scenarios & the foreign headers they ship

Typical moves: pulling a month of shipments out of ShipStation, Sendcloud or Shippo for a carrier-performance review; ingesting a 3PL's dispatch file every morning to update order status in the shop; merging DHL, Swiss Post and La Poste manifests into one table before a carrier negotiation; and backfilling tracking history after an order-management migration. Headers we see: "Sendungsnummer / Shipment ID / Bestellnummer / Order Number / Numéro de commande / Versanddienst / Transporteur / Corriere / Carrier / Trackingnummer / Numéro de suivi / Tracking Number / Versanddatum / Data di spedizione / Zustelldatum / Date de livraison / Delivery Date / Status / Zielland / Ship To Country". An English "Ship Date" is a registered hint too, so a US-style export resolves the same way.

The cascade

Six layers, and the cheapest one wins.

Layers run in order and stop the moment a column resolves. That is the single biggest cost lever in the system: a column caught on layer 2 never reaches the metered layer 5.

  1. L1Statisticsno LLM

    Auto-accepts a header that past confirmations already resolved the same way, at {minN:100, minRatio:0.95} or {minN:20, minRatio:1.00}.

  2. L2Heuristicno LLM

    Normalises accents, punctuation and whitespace, then compares against the column name, the label, and every registered hint (DE / FR / IT / EN / ES).

  3. L3Fuzzyno LLM

    Token-set ratio plus Levenshtein over the normalised strings. Auto-accepts at 0.80 — it absorbs typos and reordered words.

  4. L4Semanticcheap, cached

    Embedding cosine between the header and the field’s label + hints. Catches the long tail of paraphrases.

  5. L5LLMmetered

    Everything still unresolved goes up in ONE batched, collision-aware call, constrained to this template’s column set so it cannot invent a field.

Try it

One template id, two ways in.

REST for your import pipeline, MCP for your editor. Both run the same cascade and both honour the same schema-only clamp.

REST · POST /v1/uploads

Name the template; the cascade picks up the rest. The canonical definition is read-only at GET /v1/templates/shipments_v1.

bash
curl -X POST https://api.adaptivmapr.com/v1/uploads \
  -H "Authorization: Bearer $ADAPTIVMAPR_API_KEY" \
  -F "template=shipments_v1" \
  -F "file=@your_data.csv"
→ upload created · mappings ready · confirm before commit

MCP · Cursor / Claude Desktop

Drop AdaptivMapr into your editor and call the same cascade as a tool. Schema-only calls leave only column names and a few example values.

mcp
// In Cursor or Claude Desktop with the AdaptivMapr MCP server installed:
adaptivmapr.match_headers({
  template_id: "shipments_v1",
  headers: ["id", "order_id", "carrier", "tracking_number"]
})
schema-only · column names and a few examples only
MCP install instructions

Questions

Shipments CSV import — FAQ

Does AdaptivMapr track parcels with the carriers?
No. The template imports what the file says; nothing calls a carrier. Refresh the status by importing a newer export.
How do I record an order that shipped in two parcels?
Two rows with the same order_id and different ids and tracking numbers. That is the main reason shipments are a template of their own rather than columns on the order.
Where is the delivery address?
Not in this template, which keeps names and addresses out of the logistics table. Join on order_id to your orders, or use the Addresses template for the address book itself.
Our carrier reports "exception" and "held at customs". Where do those go?
They are not members of the status enum, and the validator reports them rather than picking the nearest state. Map carrier events onto the six statuses before import; most belong under in_transit.

Map shipments in production — without shipping raw records.

Minimal data mode sends only column names and a few example values — never the full file. Add full-data when you need row-level AI, routed in-region under a BAA.