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.
Overview
Royal Mail is unique among the carriers: it provides invoice data and tracking data as separate feeds, so there is no single raw invoice file to download. Trackstar joins the two together and serves a combined line-item file. Each row is one tracked item (one barcode) with its share of the invoice charges. Because the file is assembled by Trackstar, its columns use Trackstar’s normalized naming — lowercase with underscores — rather than Royal Mail’s report column names. The file has 16 columns with a single header row.Shape notes
- One row per tracked item. A Royal Mail sales order can cover many items. The invoice charges for a sales order are divided evenly across the tracked items matched to it, so
gross_costandnet_costare per-item shares and can carry long decimals. source_typemarks direction.outboundfor items sent to a recipient;rtsfor items returned to sender. Returned items also populatereason_for_non_deliveryanddate_return_to_sender.- Two date formats.
invoice_dateuses Royal Mail’sDD.MM.YYYYformat;date_item_deliveredanddate_return_to_senderuseYYYY-MM-DD. - Tracking numbers are S10 barcodes. Two letters, nine digits, and a
GBsuffix (e.g.,AB123456789GB). charge_descriptionin the API. In the invoice line items endpoint, each row’scharge_descriptionis built fromproduct_nameandclass_of_mail(withRTSappended for returns).
Sample rows
Curated subset of columns for readability. The downloadable CSV has all 16 columns.Download
Download full sample CSV (1 header row + 25 data rows, 16 columns)All sample data is synthetic. Account numbers, invoice numbers, tracking numbers, and names are fabricated and do not correspond to any real shipments or customers.
Fields
Each row is one tracked item. All 16 columns appear in every row, in this order.Account and invoice
| # | Column | Description |
|---|---|---|
| 1 | account_number | Royal Mail account number — mapped to account_id |
| 2 | account_name | Account holder name |
| 3 | invoice_number | Royal Mail invoice number — mapped to invoice_id |
| 4 | invoice_date | Invoice date, DD.MM.YYYY — mapped to transaction_date |
| 5 | sales_order_no | Royal Mail sales order number; groups the items billed together |
Product and item
| # | Column | Description |
|---|---|---|
| 6 | product_code | Tracked product code (TPS, TPN, TSS, TSN, TRS, TRN) |
| 7 | product_name | Human-readable product name |
| 8 | class_of_mail | Service class (e.g., Tracked 24, Tracked 48) |
| 9 | volume | Number of items in the sales order |
| 10 | tracking_number | Item barcode (S10 format, e.g., AB123456789GB) |
Costs and delivery
| # | Column | Description |
|---|---|---|
| 11 | gross_cost | This item’s share of the gross (VAT-inclusive) cost |
| 12 | net_cost | This item’s share of the net (ex-VAT) cost |
| 13 | source_type | outbound or rts (return to sender) |
| 14 | reason_for_non_delivery | Reason the item was not delivered (returns only) |
| 15 | date_return_to_sender | Date the item was returned, YYYY-MM-DD (returns only) |
| 16 | date_item_delivered | Delivery date, YYYY-MM-DD (outbound only) |