<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ttzevol</title>
    <description>The latest articles on DEV Community by ttzevol (@ttzevol).</description>
    <link>https://dev.to/ttzevol</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F984419%2F0dae09e6-3ded-49e9-9582-14e248ad2cf3.png</url>
      <title>DEV Community: ttzevol</title>
      <link>https://dev.to/ttzevol</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ttzevol"/>
    <language>en</language>
    <item>
      <title>Air Waybill PDFs to Validated JSON: A Narrow API for Freight Developers</title>
      <dc:creator>ttzevol</dc:creator>
      <pubDate>Wed, 04 Nov 2026 09:04:55 +0000</pubDate>
      <link>https://dev.to/ttzevol/air-waybill-pdfs-to-validated-json-a-narrow-api-for-freight-developers-phn</link>
      <guid>https://dev.to/ttzevol/air-waybill-pdfs-to-validated-json-a-narrow-api-for-freight-developers-phn</guid>
      <description>&lt;p&gt;If you build cargo TMS, forwarder portals, or customs pre-alert pipelines, you already know the gap: the airline or agent emails a &lt;strong&gt;MAWB/HAWB PDF&lt;/strong&gt; (or someone snaps a phone photo), and your system needs structured fields—AWB number, airports, pieces, weights—not another blob in object storage.&lt;/p&gt;

&lt;p&gt;Generic “upload any document” tools and brittle regex/templates fail the same way: carrier layouts drift, house forms look nothing like master forms, and a wrong check digit silently lands in your database. You do not need a general document AI. You need &lt;strong&gt;one document type → one schema → rules that fail loudly&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That is what &lt;a href="https://getdocapi.com" rel="noopener noreferrer"&gt;DocAPI&lt;/a&gt; is for.&lt;/p&gt;

&lt;h2&gt;
  
  
  The painful part is not “reading text”
&lt;/h2&gt;

&lt;p&gt;OCR-ish extraction alone is not enough for air waybills. An 11-digit AWB has an IATA &lt;strong&gt;Mod-7&lt;/strong&gt; check digit. Chargeable weight is usually at least gross. Departure and destination should be real &lt;strong&gt;IATA&lt;/strong&gt; three-letter codes when the form prints them. Piece counts get misread on multi-copy scans.&lt;/p&gt;

&lt;p&gt;Regex and per-airline templates break the week a new forwarder form shows up. Chat-style extraction is fine for demos; production queues need &lt;strong&gt;stable JSON keys&lt;/strong&gt;, validators, and a &lt;code&gt;needs_review&lt;/code&gt; flag so bad rows do not auto-post.&lt;/p&gt;

&lt;h2&gt;
  
  
  What DocAPI does
&lt;/h2&gt;

&lt;p&gt;DocAPI is a &lt;strong&gt;narrow document → JSON API&lt;/strong&gt; aimed at developers—not a no-code inbox product. Same idea as category peers like FormX or Parseur (fixed document types, structured output), but scoped to &lt;strong&gt;air waybills only&lt;/strong&gt; for v1.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One endpoint&lt;/strong&gt; for Master (MAWB) and House (HAWB)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One schema&lt;/strong&gt; for both (&lt;code&gt;awb_level&lt;/code&gt; tells you which)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rule validation&lt;/strong&gt; on the extracted fields, not optional garnish&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Upload a PDF or common image (&lt;code&gt;file=&lt;/code&gt; multipart). You get back a single JSON object per document: parties, airports, flight hints when present, pieces, gross/chargeable kg, per-field confidence, validation results, and &lt;code&gt;needs_review&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It does &lt;strong&gt;not&lt;/strong&gt; replace EDI/FWB when you already have clean messages. It fills the PDF/scan gap—pre-alerts, emailed copies, phone photos—where structured EDI never arrives. Courier parcel labels (DHL/UPS/FedEx tracking stickers) and ocean B/L are out of scope for v1.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fields and validators (high level)
&lt;/h2&gt;

&lt;p&gt;Core keys include &lt;code&gt;document_type&lt;/code&gt; (&lt;code&gt;air_waybill&lt;/code&gt;), &lt;code&gt;awb_level&lt;/code&gt; (&lt;code&gt;mawb&lt;/code&gt; | &lt;code&gt;hawb&lt;/code&gt; | &lt;code&gt;unknown&lt;/code&gt;), &lt;code&gt;awb_number&lt;/code&gt; (airline 11-digit &lt;code&gt;XXX-XXXXXXXX&lt;/code&gt;), optional &lt;code&gt;hawb_number&lt;/code&gt;, shipper/consignee names, &lt;code&gt;airport_dep&lt;/code&gt; / &lt;code&gt;airport_dest&lt;/code&gt;, pieces, &lt;code&gt;gross_kg&lt;/code&gt; / &lt;code&gt;chargeable_kg&lt;/code&gt;, plus &lt;code&gt;field_confidence&lt;/code&gt; and &lt;code&gt;validations&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Built-in checks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;AWB Mod-7&lt;/strong&gt; — last digit of the 11-digit number must match the IATA serial-mod-7 rule. Invalid candidates are rejected or replaced when a valid number is still recoverable from the page text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;chargeable_kg &amp;gt;= gross_kg&lt;/code&gt;&lt;/strong&gt; — usual volumetric pricing constraint; failures flag review.&lt;/li&gt;
&lt;li&gt;Low confidence or failed checks set &lt;strong&gt;&lt;code&gt;needs_review: true&lt;/code&gt;&lt;/strong&gt; so you can route to a human queue instead of writing garbage downstream.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Marketing line, honestly: dedicated AWB extraction plus rule validation on general AI models—without asking you to train a custom model or maintain carrier templates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it in a few minutes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Playground: &lt;a href="https://getdocapi.com/playground.html" rel="noopener noreferrer"&gt;https://getdocapi.com/playground.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs: &lt;a href="https://getdocapi.com/docs.html" rel="noopener noreferrer"&gt;https://getdocapi.com/docs.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;API base: &lt;code&gt;https://docapi-awb.onrender.com&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Get a free API key (100 extractions / UTC month) from the &lt;a href="https://getdocapi.com/playground.html" rel="noopener noreferrer"&gt;playground&lt;/a&gt;, or buy a prepaid pack on &lt;a href="https://getdocapi.com/pricing.html#packs" rel="noopener noreferrer"&gt;pricing&lt;/a&gt;. Every extract call needs a Bearer token:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-sS&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"https://docapi-awb.onrender.com/v1/extract/awb"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer sk_live_YOUR_KEY"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-F&lt;/span&gt; &lt;span class="s2"&gt;"file=@./sample-mawb.pdf;type=application/pdf"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Accepts PDF and common images (e.g. &lt;code&gt;.pdf&lt;/code&gt;, &lt;code&gt;.png&lt;/code&gt;, &lt;code&gt;.jpg&lt;/code&gt;). Keep files under ~20 MB for the current host. Check balance with &lt;code&gt;GET /v1/me&lt;/code&gt; using the same Bearer header.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cold start note:&lt;/strong&gt; the public API runs on a free Render host. The &lt;strong&gt;first request after idle can take ~30–60 seconds&lt;/strong&gt; while the service wakes up. Subsequent calls are much faster. Plan a health ping or timeout accordingly in CI and demos.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pricing (high level)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Free:&lt;/strong&gt; 100 extractions / month (playground + API, same schema and validators)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PAYG:&lt;/strong&gt; $0.12 per successful AWB after free quota&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prepaid packs:&lt;/strong&gt; $12 → 100 docs, $50 → 500 docs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Details and checkout: &lt;a href="https://getdocapi.com/pricing.html" rel="noopener noreferrer"&gt;https://getdocapi.com/pricing.html&lt;/a&gt;. Bill per successful air waybill document, not per page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who should care
&lt;/h2&gt;

&lt;p&gt;Freight/logistics backend engineers who already ingest AWB PDFs weekly and want a boring HTTP contract: upload file, get validated JSON, branch on &lt;code&gt;needs_review&lt;/code&gt;. If your lane already has perfect FWB, keep it. If humans still re-key from scans, this is the slice of the problem DocAPI targets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Site: &lt;a href="https://getdocapi.com" rel="noopener noreferrer"&gt;https://getdocapi.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs: &lt;a href="https://getdocapi.com/docs.html" rel="noopener noreferrer"&gt;https://getdocapi.com/docs.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Playground: &lt;a href="https://getdocapi.com/playground.html" rel="noopener noreferrer"&gt;https://getdocapi.com/playground.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Pricing: &lt;a href="https://getdocapi.com/pricing.html" rel="noopener noreferrer"&gt;https://getdocapi.com/pricing.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Support: &lt;a href="mailto:support@getdocapi.com"&gt;support@getdocapi.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feedback from forwarder and TMS developers welcome—especially if you process Asia↔US/EU pre-alert AWBs and care about Mod-7 and weight sanity more than flashy demos.&lt;/p&gt;

</description>
      <category>documentprocessing</category>
      <category>json</category>
      <category>api</category>
      <category>logistics</category>
    </item>
  </channel>
</rss>
