The anatomy of an RTD line
If you have ever tried to build a parser for the IATA Cargo-IMP FWB message, you know that some sections are straightforward and some are not. The AWB number section is a simple 11-digit field. The routing section is three or four IATA airport codes. But then there is RTD — the Rate Description section — and everything changes.
RTD is where the commercial details of the shipment live: how many pieces, how much they weigh, what rate class applies, what the commodity code is, and what the total charge comes to. It sounds simple until you learn that a single AWB can have up to 11 separate RTD line items, each containing up to 12 distinct sub-elements, with conditional fields that appear or disappear based on the rate class, and free-text nature-of-goods descriptions that can span multiple continuation lines.
This article explains why RTD is the most complex section in the FWB standard, what makes it hard to parse reliably, and how KabyTech's approach achieves 97%+ extraction accuracy on RTD data.
Each RTD repetition (line item) contains the following sub-elements, as defined in the IATA Cargo-IMP standard:
- Number of Pieces (P) — Integer count of pieces for this line item. Mandatory.
- Rate Class Code (RCP) — A one or two character code indicating the rate type. Common values: M (minimum), N (normal), Q (quantity), C (specific commodity), U (unit load device), E (express), S (surcharge). Mandatory.
- Commodity Item Number — A 4-7 digit IATA commodity code, required when rate class is C (specific commodity). Conditional.
- Chargeable Weight (W) — The weight used for charge calculation, which may differ from gross weight due to volumetric calculations. Mandatory.
- Rate/Charge (R/C) — The rate per kilogram or per unit, expressed as a decimal. Mandatory for most rate classes.
- Total (T) — The computed charge for this line item (weight x rate). Mandatory.
- Nature and Quantity of Goods (NG) — Free-text description of the goods. Can span multiple continuation lines (up to 11 lines of 20 characters each). Mandatory for at least the first RTD line.
- Volume Code — MC (cubic meters) or CF (cubic feet). Conditional, appears when volumetric weight applies.
- Volume Amount — Numeric volume measurement. Conditional, paired with volume code.
- ULD Type — IATA ULD type code (e.g., AKE, PMC, PAG). Conditional, appears when rate class is U.
- ULD Serial Number — The specific ULD identifier. Conditional.
- No Value Declared indicators (NV/NC) — "NVD" for no value for carriage, "NCV" for no value for customs. These technically belong to separate sub-sections (RTD/NV and RTD/NC) but are logically part of the rate description block.
Why RTD is hard: the five parsing challenges
1. Variable repetition counts
A simple shipment — one commodity type, one rate class — has a single RTD line. But a consolidated shipment might have 8, 9, or even the maximum 11 RTD lines. The parser must correctly identify where one RTD repetition ends and the next begins, without any explicit delimiter between them in many AWB document formats.
In raw FWB Cargo-IMP text messages, the line structure provides some guidance. But in scanned or PDF-based AWBs, the RTD data often appears as a table where row boundaries are determined by visual spacing rather than explicit markers.
2. Conditional fields change the structure
The presence or absence of fields depends on the rate class code. A rate class M (minimum) line has no commodity number and may have no weight field. A rate class U (ULD) line includes ULD type and serial number fields that do not exist in other rate classes. The parser must first identify the rate class, then determine which fields to expect.
3. Nature of goods continuation lines
The nature-of-goods description (NG) for each RTD line can span up to 11 continuation lines. The parser must determine whether a line of text is a continuation of the previous NG description or the start of a new RTD repetition. Consider this example from a real AWB: a shipment of "FRESH DURIAN MONTHONG GRADE AA PACKED IN STYROFOAM BOXES WITH GEL PACKS". That description spans three lines on a standard AWB form.
4. Numeric precision and formatting variance
Weight and rate fields appear in different numeric formats across AWB documents. Some use periods as decimal separators; others use commas. The total charge field is especially problematic because it serves as a cross-check: total should equal chargeable weight multiplied by rate. But rounding rules vary between carriers.
5. Multi-currency and unit mismatches
RTD charges can be expressed in different currencies across different line items within the same AWB. More commonly, the weight unit (kilograms vs. pounds) is declared once in the CVD section but must be consistently applied across all RTD lines.
How KabyTech handles RTD
Our approach to RTD parsing uses three layers of extraction logic:
Layer 1: Structure detection
Before extracting any values, we analyze the visual or textual structure of the RTD block to identify repetition boundaries. For text-based FWB messages, this uses the standard IATA line identifiers. For scanned/PDF documents, we use a layout analysis model that identifies the tabular structure of the rate description area and maps each visual row to an RTD repetition.
Layer 2: Rate-class-aware extraction
Once repetition boundaries are established, we extract the rate class code first. This determines the field template for the rest of the line. We use a specialized character recognition model for the rate class field because it is a single character whose misidentification cascades into downstream extraction failures. Our rate class recognition accuracy is 99.4%.
Layer 3: Cross-validation
After extracting all RTD lines, we run three validation checks:
- Arithmetic validation — Does chargeable weight times rate equal total (within rounding tolerance)?
- Sum validation — Do the RTD line totals sum to the weight charge in the PPD/COL section?
- Piece count validation — Do the piece counts across all RTD lines sum to the total pieces declared in the AWB header?
When a validation check fails, the system flags the specific RTD line for human review rather than silently passing incorrect data downstream. In our production data across Thai customers, approximately 2.3% of AWBs require human review of at least one RTD field.
RTD in the real world: Thai air freight
Thai air freight has some specific characteristics that make RTD parsing especially important. Perishable exports (fruits, seafood, orchids) frequently use specific commodity rates (rate class C), which means the commodity item number field is present and must be correctly extracted. Agricultural consolidations often have 5-8 RTD lines for different product types within a single shipment. And the nature-of-goods descriptions for Thai agricultural products tend to be long and detailed because they include grade designations, packaging descriptions, and sometimes Thai-language text mixed with English.
This is exactly the kind of complexity where automated parsing delivers the most value. A human operator spending 5 minutes per RTD line on an 8-line AWB is spending 40 minutes just on rate description data. KabyTech extracts all 8 lines in under 2 seconds, with accuracy that matches or exceeds manual entry.
Why RTD accuracy matters
Incorrect RTD parsing leads to charge discrepancies, CASS settlement errors, and revenue leakage. For Thai forwarders processing hundreds of AWBs monthly, even a small percentage of RTD errors can result in significant financial impact. KabyTech's three-layer approach — structure detection, rate-class-aware extraction, and cross-validation — achieves 97%+ accuracy on RTD data, eliminating the most common source of AWB processing errors.