Validation
AWB check digit (Mod-7) and weight validation
Generic OCR can misread a digit. DocAPI treats IATA Mod-7 check-digit validation and chargeable-weight sanity checks as part of the product—so your cargo TMS gets a failed-check signal, not a quiet wrong AWB number.
What is the AWB Mod-7 check digit?
An airline air waybill number is typically written as XXX-XXXXXXXX: a 3-digit airline prefix plus an 8-digit serial that ends with a check digit. Under the common IATA rule, the check digit is the remainder when the first seven digits of the serial (the number without the check digit) are divided by 7.
Example
AWB 071-12760786
- Prefix:
071 - Serial including check digit:
12760786 - Serial without check digit:
1276078 1276078 mod 7 = 6→ check digit6matches
How DocAPI uses it
- Every successful extract returns
validations.awb_check_digit_ok(boolean). - Invalid candidates from the model can be rejected or replaced when OCR text still contains a Mod-7-valid number.
- Failed Mod-7 (or low confidence) contributes to
needs_review: true.
"validations": {
"awb_check_digit_ok": true,
"chargeable_gte_gross": true
},
"needs_review": false
Weight rule: chargeable ≥ gross
Air cargo rating usually bills the greater of gross weight and volumetric (chargeable) weight. When both fields are present, DocAPI checks chargeable_kg ≥ gross_kg. A failure does not invent a new weight—it flags review so ops can decide.
air waybill check digit validation
Use Mod-7 as a gate before writing awb_number into your system of record.
air waybill chargeable weight extract
Extract both weights, then validate the usual inequality in the same response.
Why this beats “paste into ChatGPT”
Chat demos don’t ship a stable HTTP contract, Mod-7 boolean, or needs_review for your queue. An AWB OCR API for production needs failed-check signals as first-class fields—see the air waybill to JSON API page.