An air-freight shipment rarely arrives as one clean record. It arrives as an air waybill from the carrier, a packing list from the shipper, a shipping label attached to the handling unit and a customs declaration prepared for the border. Each document can be extracted correctly and the shipment can still be wrong.
The operational unit is the shipment, not the document. Weight, quantity and consignee appear across several artifacts because each party has a different job. The useful automation does not return four independent JSON objects. It decides whether those four objects describe the same movement of goods, then exposes every material disagreement before the cargo advances.
That changes the design target for air waybill OCR. Field accuracy remains necessary, but the release gate becomes cross-document agreement with evidence.
Four documents describe four responsibilities
The documents overlap, but they are not interchangeable. Treating one as the master for every field hides why the others exist.
| Document | Operational authority | Fields worth reconciling |
|---|---|---|
| Air waybill | Carrier contract and routing record | AWB number, shipper, consignee, origin, destination, pieces, gross weight |
| Packing list | Physical contents declared by the shipper | Packages, item quantities, net weight, gross weight, dimensions |
| Shipping label | Handling identity on the physical package | Tracking identifier, consignee, destination, package sequence, weight |
| Customs declaration | Regulatory declaration of the cross-border goods | Declarant, consignee, packages, gross/net weight, commodity lines, value |
The air waybill can say three pieces while the packing list enumerates four cartons. The label can point to the right destination but carry a consignee spelling that resolves to a different legal entity. The customs declaration can contain the expected commodity lines but a gross weight copied before the final pallet was added. None of those failures is visible inside a single-document schema.
Build a shipment identity before comparing fields
Reconciliation starts with grouping. Comparing every air waybill with every packing list in a batch creates false mismatches and occasionally false agreement. Establish a shipment identity from strong references first, then use weaker signals only to support or challenge the grouping.
- Primary references — normalized AWB number, carrier tracking identifier or an owned shipment ID supplied by the upstream system.
- Party signals — resolved shipper and consignee entities, not raw OCR strings.
- Route signals — origin, destination and planned movement date within a declared tolerance.
- Physical signals — piece count, package sequence, dimensions and weight ranges.
Do not let a fuzzy name match override a conflicting AWB number. Store the grouping decision, its evidence and the policy version. A reviewer must be able to tell whether the system found a genuine discrepancy or simply joined the wrong documents.
Normalize units without erasing the source
Weight is the obvious reconciliation field and the easiest one to compare badly. One document may use kilograms, another pounds, and a label may round to the nearest whole unit. A packing list may report net item weight while the air waybill reports chargeable or gross weight.
Preserve both layers:
{
"field": "gross_weight",
"source": {"value": "482.5", "unit": "KG", "document": "air_waybill", "page": 1},
"normalized": {"value": 482.5, "unit": "kg"},
"comparison": {"target": 482.3, "delta": 0.2, "tolerance": 0.5, "status": "match"}
}
The source value is evidence. The normalized value is a comparison tool. Keep conversion rules versioned, and define tolerances by field and workflow. A 0.2 kg delta may be harmless for a pallet and material for a controlled pharmaceutical package.
Quantity needs a hierarchy
“Quantity” can mean commodity units, inner packs, cartons, handling units or pieces tendered to the carrier. Comparing four bare integers is meaningless unless the schema records the level.
A useful model separates:
- Item quantity — commercial units per commodity line.
- Pack quantity — inner or case packaging that groups the items.
- Package quantity — cartons, crates or drums declared on the packing list and customs entry.
- Handling-unit quantity — pieces accepted by the carrier and represented by shipping labels.
Then reconciliation can state a real rule: four cartons on the packing list must map to labels 1/4 through 4/4, while the air waybill may legitimately show one pallet as the tendered piece. A simple equality check would reject the correct shipment.
Resolve the consignee as an entity
Names vary across documents. “Northwind Retail Ltd”, “Northwind Retail” and a warehouse trading name may all be valid representations of one consignee. They may also be three different entities in a corporate group.
Entity resolution should use bounded attributes: registered name, address, tax or importer identifier, customer master ID and approved aliases. Return the matched entity and the evidence that supported it. Never hide the original text. A review screen should show the four source spans side by side because the meaningful discrepancy may be one digit in a postal code or importer number.
This is where a retail document workflow becomes more than extraction. Purchase, fulfillment and receiving records can supply the expected entity and quantities, but the shipment documents still need to prove what was actually tendered and declared.
Use rules that produce findings, not a blended score
A single “shipment confidence: 0.91” is hard to act on. It can conceal a perfect route match beside a severe consignee conflict. Emit explicit findings with severity, affected documents and evidence.
| Rule | Pass condition | Material failure |
|---|---|---|
| Shipment reference | All required artifacts resolve to the same shipment ID | Document grouped to another movement |
| Piece coverage | Every expected handling unit has one valid label | Missing or duplicate package |
| Weight agreement | Comparable weight types agree inside policy tolerance | Undeclared package or stale declaration |
| Consignee identity | All artifacts resolve to the approved receiving entity | Misdelivery or customs-party mismatch |
Keep not_comparable separate from mismatch. Net weight and chargeable weight are not contradictory; they are different measures. Missing evidence is not a pass either. The system should say which comparison could not be made and what document or field is required next.
The evidence model is the audit trail
Every resolved value and every finding should point back to document, page and region. That lets a reviewer verify the system without searching four PDFs and lets a later audit reconstruct which bytes supported the shipment decision.
{
"shipment_id": "shp_7f2...",
"decision": "hold",
"findings": [{
"rule": "piece_coverage",
"severity": "high",
"expected": 4,
"observed": 3,
"sources": [
{"document": "packing_list", "page": 1, "region": [0.61, 0.32, 0.83, 0.38]},
{"document": "air_waybill", "page": 1, "region": [0.09, 0.52, 0.24, 0.57]}
]
}]
}
Use the same bounded evidence contract described in our bounding-box API guide. Store references under the shipment's tenant, access and retention controls rather than copying raw document text into an unrestricted log.
Design the exception path before automation
A material mismatch should hold the shipment decision, not merely color a dashboard red. Assign an owner, state what can be corrected, preserve the original values and require a reason when a reviewer overrides a finding.
Typical actions differ by failure:
- Missing label — request the absent handling-unit image or rescan the physical package.
- Weight mismatch — confirm weight type and unit, then request an amended source document rather than editing extracted evidence.
- Consignee conflict — resolve against the approved master record and escalate changes to the importer or delivery party.
- Customs discrepancy — stop release until the declarant supplies a corrected filing or documented disposition.
The human action becomes part of the audit trail: who decided, which evidence they viewed, what changed and whether the shipment was released, reworked or cancelled.
Test the packet, not four extraction demos
A credible evaluation set contains complete shipment packets and deliberately inconsistent variants. Start with real document families, remove sensitive data, then perturb one operational fact at a time: add a carton, change the consignee identifier, convert a weight incorrectly or duplicate a label sequence.
Measure:
- Grouping precision and recall — whether documents were attached to the correct shipment.
- Comparable-field coverage — which planned checks had enough evidence to run.
- Finding precision and recall — whether injected discrepancies were detected without inventing conflicts.
- Decision latency — time from the final required artifact to release or named exception.
- Reviewer touch time — time spent locating and resolving evidence, not just opening the case.
Include the adjacent bill of lading extraction workflow in multimodal test coverage. Ocean and air freight use different documents, but the same engineering lesson holds: the record becomes operational only when its fields can be checked against the rest of the movement.
Reconcile before the shipment moves
Air waybill OCR can tell you what one carrier document says. Packing list OCR can tell you what the shipper says is inside. Shipping-label extraction can identify the physical handling units, and customs declaration OCR can tell you what was filed.
The value appears when those statements are joined under one shipment identity, normalized without losing evidence and tested by explicit rules. Then the output is not four extractions. It is a decision: the documents agree, the exception is named, or the shipment waits.
