Skip to main content

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_cost and net_cost are per-item shares and can carry long decimals.
  • source_type marks direction. outbound for items sent to a recipient; rts for items returned to sender. Returned items also populate reason_for_non_delivery and date_return_to_sender.
  • Two date formats. invoice_date uses Royal Mail’s DD.MM.YYYY format; date_item_delivered and date_return_to_sender use YYYY-MM-DD.
  • Tracking numbers are S10 barcodes. Two letters, nine digits, and a GB suffix (e.g., AB123456789GB).
  • charge_description in the API. In the invoice line items endpoint, each row’s charge_description is built from product_name and class_of_mail (with RTS appended for returns).

Sample rows

Curated subset of columns for readability. The downloadable CSV has all 16 columns.
account_number,invoice_number,invoice_date,sales_order_no,product_code,product_name,class_of_mail,tracking_number,gross_cost,net_cost,source_type
2684030563,1969461209,31.03.2026,4500000011,TSS,Tracked Small Signed,Tracked 24,RB715114139GB,22.82,19.02,outbound
2684030563,1969461209,31.03.2026,4500000012,TPS,Tracked Parcel Signed,Tracked 24,JW528145125GB,8.7675,7.3075,outbound
2684030563,1969461209,31.03.2026,4500000003,TRN,Tracked Returns,Tracked Returns 48,BJ338375127GB,33.07666666666667,27.563333333333333,rts
2684030563,1969461209,31.03.2026,4500000007,TRS,Tracked Returns Signed,Tracked Returns 24,AQ644428358GB,8.2725,6.895,rts

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

#ColumnDescription
1account_numberRoyal Mail account number — mapped to account_id
2account_nameAccount holder name
3invoice_numberRoyal Mail invoice number — mapped to invoice_id
4invoice_dateInvoice date, DD.MM.YYYY — mapped to transaction_date
5sales_order_noRoyal Mail sales order number; groups the items billed together

Product and item

#ColumnDescription
6product_codeTracked product code (TPS, TPN, TSS, TSN, TRS, TRN)
7product_nameHuman-readable product name
8class_of_mailService class (e.g., Tracked 24, Tracked 48)
9volumeNumber of items in the sales order
10tracking_numberItem barcode (S10 format, e.g., AB123456789GB)

Costs and delivery

#ColumnDescription
11gross_costThis item’s share of the gross (VAT-inclusive) cost
12net_costThis item’s share of the net (ex-VAT) cost
13source_typeoutbound or rts (return to sender)
14reason_for_non_deliveryReason the item was not delivered (returns only)
15date_return_to_senderDate the item was returned, YYYY-MM-DD (returns only)
16date_item_deliveredDelivery date, YYYY-MM-DD (outbound only)