> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trackstarhq.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Trackstar is a unified REST API for WMS, cart, and carrier systems. Base URL: https://production.trackstarhq.com. There is no SDK; call the API with plain HTTP.
> Send x-trackstar-api-key on every request. Endpoints scoped to one connection also need x-trackstar-access-token. Read both from environment variables and never print them.
> Reads return data Trackstar has already synced from the connected system. Writes (POST, PUT, PATCH, DELETE) are forwarded to the connected system immediately.
> A new connection has no data until its initial sync finishes. Wait for the connection.historical-sync-completed webhook, or poll GET /connections/{connection_id} and check historical_sync_completed.
> List endpoints page with page_token and next_token (limit is capped at 1000). Repeat every filter on every page. Filters use field[operator]=value, for example created_date[gte]=2026-01-01T00:00:00Z.
> Write bodies must not contain null or empty strings; omit the field instead. Call GET /integrations/{integration_type}/{integration_name}/write-info first to learn the exact fields an integration accepts.
> To test without real credentials, POST /sandbox/generate-sandbox/{wms|cart|carrier} with the API key returns a sandbox access token. Start at https://docs.trackstarhq.com/how-to-guides/build-with-ai.md and install the skills with: npx skills add https://docs.trackstarhq.com

# DHL eCommerce

> Sample invoice CSV for DHL eCommerce, delivered via SFTP.

## Overview

DHL eCommerce delivers invoices as positional CSVs over SFTP. Each file contains one `HDR` row (invoice metadata) followed by many `DTL` rows — one per shipment. A single `DTL` row may carry values in multiple charge columns; each non-zero charge becomes a separate line item in the Trackstar API.

## Shape notes

* **No header row.** The raw CSV has no column names — the downloadable sample is headerless too, matching the real file. The 79 columns always appear in the fixed order documented in **Fields** below. The inline example further down adds column names purely for readability.
* **Line type markers.** Each row starts with either `HDR` (invoice-level) or `DTL` (shipment-level). Only `DTL` rows become line items.
* **Multiple charges per shipment.** A shipment can populate `Charge*`, `ZFuel*`, special-handling surcharges, and taxes simultaneously. Each populated charge becomes one line item.
* **Totals reconciliation.** The sum of all `DTL` charges equals the total in column 12 (`Original Amount`) of the `HDR` row — use this to verify invoice integrity.
* **Asterisked column names.** Most column names end in `*` as delivered by DHL; preserved as-is.

## Sample rows

Curated subset of columns (with names added for readability). The downloadable CSV is the raw DHL eCom format — 79 columns, no header row.

```csv theme={null}
Sold_To*,PUDATE*,Internal_Tracking_Num:,Material_or_VAS_Desc*,ACTWeight*,Pricing_Zone*,Charge*,ZFuel*
2684030563,2026-03-27,7290846040,DHL SmartMail Parcel Ground,3.21,5,6.22,0.45
2684030563,2026-03-26,2052047713,DHL SmartMail Parcel Expedited,3.72,6,5.82,0.39
2684030563,2026-03-08,0065880238,DHL SmartMail Parcel Expedited,4.64,3,7.71,0.40
2684030563,2026-03-03,0559073905,DHL SmartMail Parcel Expedited,4.72,2,5.96,0.30
2684030563,2026-03-25,5335895286,DHL SmartMail Parcel Expedited,1.47,5,7.54,0.44
```

## Download

<a href="https://cdn.jsdelivr.net/gh/trackstarhq/documentation@main/assets/carrier-samples/dhl-ecom.csv" download>Download full sample CSV (1 HDR row + 20 DTL rows, 79 columns, no header row)</a>

<Note>
  All sample data is synthetic. Tracking numbers, account numbers, addresses, and reference fields are fabricated and do not correspond to any real shipments or customers.
</Note>

## Fields

### Row markers

| Column | Description | Example |
| :- | :- | :- |
| `Invoice` (index 0) | Line type. `HDR` for invoice header, `DTL` for line items | `DTL` |

On `HDR` rows, column index 2 carries the invoice number and index 11 carries the total. On `DTL` rows, the remaining columns below apply.

### Shipment identification

| Column | Description | Example |
| :- | :- | :- |
| `Sold_To*` | Account number | `2684030563` |
| `Inv_Posnr*` | Invoice line position | `10` |
| `BOL*` | Bill of Lading | `001122334455` |
| `BillRef*` / `BillRef2*` | Customer billing references | `REF-00001` |
| `SHIPPOINT*` | Origin facility code | `USIND1` |
| `PickUpFrom*` | Pickup facility | `USIND1` |
| `PUDATE*` | Pickup date (YYYY-MM-DD) | `2026-03-14` |
| `PUTIME*` | Pickup time | `09:15:00` |
| `Internal_Tracking_Num:` | DHL-assigned tracking number | `3343983579` |
| `Customer_Confirm*` | Customer's confirmation number | `3343983579` |
| `Delivery_Confirm*` | Delivery confirmation number | |

### Receiver address

| Column | Description |
| :- | :- |
| `Name*` | Recipient name |
| `Address1*` / `Address2*` | Street address |
| `City*` | City |
| `State*` | State |
| `Zip*` | Postal code |
| `Country*` | ISO country code |

### Service and weight

| Column | Description | Example |
| :- | :- | :- |
| `Material_or_VAS_Num*` | Material or VAS code | `SMP1` |
| `Material_or_VAS_Desc*` | Service description | `DHL SmartMail Parcel Expedited Max` |
| `ACTWeight*` | Actual weight | `1.18` |
| `UOM_ACTWeight*` | Weight unit | `LB` |
| `BILLWEIGHT*` | Billed weight | `1.18` |
| `UOM_BillWgt*` | Billed weight unit | `LB` |
| `Quantity*` | Package count | `1` |
| `UOM_Quantity*` | Quantity unit | `EA` |
| `Pricing_Zone*` | DHL zone | `3` |
| `DIM_Weight`, `DIM_Length`, `Dim_width`, `DIM_height`, `UOM DIM_WT`, `UOM_Dims` | Dimensional weight fields | |

### Charges — base

| Column | Description |
| :- | :- |
| `Charge*` | Base freight charge |
| `ZFuel*` | Fuel surcharge |
| `Min_PickupChg*` | Minimum pickup charge |
| `CustRef*` / `CustRef2*` | Customer-supplied refs |

### Charges — special service (ZZWS)

Fields `ZZWS1PRI_Dropoff*` through `ZZWS9PRI_NEW*` carry special-service charges (dropoff, sort, stamp, machine, manifest, BPM, and reserved slots).

### Charges — surcharges (ZSC)

| Column | Description |
| :- | :- |
| `ZSC1_Content_Endorsement*` | Content endorsement fee |
| `ZSC2_Unassignable_Addrs*` | Unassignable address fee |
| `ZSC3_Special_Handling*` | Special handling fee |
| `ZSC4_Late_Arrival*` | Late arrival fee |
| `ZSC5_USPS_Qualif*` | USPS qualification fee |
| `ZSC6_Client_SRD*` | Client-specific rate decision fee |
| `ZSC7_SC_Irreg*` | Surcharge irregularity fee |

### Charges — returns and taxes (ZRM)

| Column | Description |
| :- | :- |
| `ZRM1_Ret_Unassn_Chg*` | Unassignable return charge |
| `ZRM2_Ret_Unprocess_Chg*` | Unprocessable return charge |
| `ZRM3_Ret_Recall_Disc_Chg*` | Recall discount return charge |
| `ZRM4_Ret_Dup_Mail_Chg*` | Duplicate mail return charge |
| `ZRM5_Ret_Cont_Assur_Chg*` | Contract assurance return charge |
| `ZRM6_Move_Update_Return*` | Move update return |
| `ZRM7_GST_Tax` / `ZRM8_HST_Tax` / `ZRM9_PST_Tax` | Canadian taxes |
| `ZRM10_VAT_Tax` | VAT |
| `ZRM11_Duties` | Duties |
| `ZRM12_Tax` | Other tax |
| `ZRM13_Paper_Invoice_Fee*` | Paper invoice fee |
| `ZRM14_Screening_Fee*` | Screening fee |
| `ZRM15_Non_Auto-Flats` | Non-auto flats charge |
| `ZRM16_ORM_D` | ORM-D hazardous fee |

### Reserved

| Column | Description |
| :- | :- |
| `Reserved_Future_Use_1`–`6` | Reserved for future DHL use; always empty today |
| `Original DelCon` | Original delivery confirmation |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.