Technical Case Study · Logistics & Customs

Two hours every morning, before a single truck could move

A customs agency on the Morocco import route was opening 20 to 30 bills of lading a day by hand. The documents still arrive by email. Nobody downloads them any more.

See the bill of lading data extractor behind this workflow

The problem

The challenge

Every morning this agency received 20 to 30 bills of lading for inbound shipments, mostly from Morocco. Someone opened each email, downloaded the PDF, read off the containers, seals and weights, and keyed them into the customs management system. Two hours of the team's day went into that before any freight could be authorised to move — and the errors that mattered were the ones nobody caught, because a container number that looks plausible is a container number that gets typed.

The solution

The SunnyExtract pipeline

Nobody downloads a PDF now. The clients' emails are forwarded straight into the pipeline, the engine works out which attachment is the bill of lading, and it pulls the five fields this agency's declaration turns on: container and seal numbers, consignee, gross weight and net weight. The structured result flows back into the agency's own customs management system — which the agency operates and our team also built, so there is no export step and no file to move. The rule that decides is concrete: if the gross weight on the bill of lading differs from the packing list by 15 kg or more, the document stops and waits for the customs expert — one kilo over that threshold is a discrepancy that strands the container at the border for an inaccurate declaration.

system_payload.json
{
  "document_type": "bill_of_lading",
  "port_of_loading": "Casablanca",
  "containers": [
    {
      "container_id": "MSKU1234565",
      "seal_id": "SL-998877",
      "gross_weight_kg": 24500.00
    }
  ],
  "validation": {
    "weight_match_packing_list": true,
    "status": "matched_for_declaration"
  }
}

Outcomes

Operational impact

The two-hour keying run is now a review

The morning run that cost two hours of keying is now a validation the team reviews.

The wait is a check now, not a morning

Once the figures agree, the agency files its declaration from its own customs system. The release still comes from customs — the truck now waits on that, not on a keyboard.

A mismatch stops the document

A gross weight 15 kg or more off the packing list, or a container number that is not on it, is held for the customs expert. What the check cannot see is still a person's job.

Request a private workflow review

Tell us how your document workflow works today. We review every request manually and prepare demos around real operational needs.

Request private workflow review

We use analytics cookies (Google Analytics) to understand how the site is used and improve it. They only run if you accept. Cookie policy