A major trading and distribution company in the UAE was processing over 400 inbound shipments every month through Jebel Ali Port and Dubai Airports for consumer goods, electronics, fashion, and food items originating in 15+ countries. Their customs documents team was manually working: reading supplier invoices and packing lists, pulling out shipment information, picking HS codes, completing certificates, calculating duties and VAT, filing declarations, and shoving everything into Dubai Customs’ Mirsal 2 system. The staffing-intensive system was slow and left the company vulnerable to classification mistakes, customs queries, penalty fees, and unnecessary duty leakage.
The challenging part was not in entering the documents. It’s the judgment. Supplier documents were in all sorts of different languages, formats, and quality. The classification of HS codes was based on what a product was in reality, and not only what a supplier called it. Insufficient or poor supporting documentation resulted in interactions with customs and suppliers. Every additional day at port accrued storage and penalty charges.
At aTeam Soft Solutions, we developed an AI agent for customs document intelligence, HS code suggestion, declaration creation, Mirsal 2 submission, response to customs-query assistance, and post-release coordination. The outcome was a turnaround in operations where the average import clearance time reduced from 5–8 days to 18–36 hours, declaration errors reduced drastically, HS classification became more harmonized, and the annual savings surpassed AED 3.2 million.
When we analyzed the client’s customs workflow, we saw the same pattern that we see in many regulated line-of-business environments: a small, tenured team was manually holding together a massive process with manual effort, memory, and repetition. It worked, but only until volume, variation, and risk grew too big.
The business was a high-volume importer of consumer goods, electronics, fashion, and food into Dubai. Each shipment created a chain of documents that needed to be in order before the customs clearance could run undisturbed. A normal consignment consists of 8 to 15 documents, like a commercial invoice, packing list, bill of lading or airway bill, certificate of origin, insurance certificate, product compliance documents, and specific approvals or no objection certificates related to the category. Food items that could require documentation from the Dubai Municipality. ESMA-related compliance support may be necessary for electronics. Textiles, as with other product categories, have their own certificate logic.
Five customs document experts were accountable for converting all that into a neat customs declaration bundle.
The procedure typically started when suppliers forwarded documents by email, WhatsApp, or via freight and forwarding channels. A few vendors provided relatively clean English-language commercial invoices at the line-item level that mapped fairly well to the importer’s internal product master. Some of them didn’t. Chinese suppliers frequently send invoices with content in Mandarin and English labeled only partially. Different invoice templates were applied by European suppliers per country. Some papers were electronically created. Some of them were low-quality scans with stamps, corrections written by hand, and fields that were not lined up consistently.
Before any declaration could be made, someone had to open each file, determine which shipment it was, check the supplier, read the item descriptions, take out quantities, values, country of origin, weights, shipping references, and certificate details, and then reconcile all of that with the internal transaction record.
That, by itself, took time. But the actual bottleneck was HS classification.
Every line item had to have an appropriate Harmonized System code, and that code determines the duty treatment. If the code was wrong, the penalty was severe in both directions. Misclassification or underclassification charged at a lesser rate puts the business at risk of incurring audits and penalties. Over-classification meant that the company was paying too much in duties and taxes, quietly. And neither was acceptable. With more than 12,000 active SKUs and new products added every month, classification was not a stale, one-time master-data exercise. It was a persistent operational decision issue.
In practice, customs experts were frequently making classification decisions with a combination of historical memory, supplier context, internal SKU records, tariff knowledge, and manual research. When a product description was ambiguous, like “Electronic Device Type B Model XY-500,” the filing person managing the file had to guess what the product actually was. Is it a communications accessory, a smart home device, a power module, or a consumer electronics subassembly? From the wording alone, the customs database was unable to provide such an answer.
After the team had reviewed the documents and assigned HS codes, they calculated the duties and the VAT if applicable, filled out the declaration fields, verified that the values corresponded to the transaction records, joined supporting documentation, and got the submission ready to send to Mirsal 2. They pursued suppliers if anything was missing. If a certificate was ambiguous, they follow up. If the consignment covered several product categories with distinctive compliance requisites, the file was becoming complicated.
Turnaround times from receipt of supplier shipping documents to a customs-ready submission averaged 3–5 business days. Clearance was generally 5-8 days, including customs processing for end-to-end clearance. Each extra day at the port costs about the same as money. The client estimated AED 3,000-8,000 per day in penalty and storage costs by container type, location, and shipment profile.
Errors also generate delay loops as well. About 6% of customs declarations had problems sufficiently serious to prompt customs queries, correction work, or delay. Some of those issues were related to incomplete documents. Some of those are from non-uniform values. Some of which are from misclassification. Some of them were from supporting certificates, disguising what customs wanted.
The team was already strong. The process was the issue.
What made this matter so much more for aTeam Soft Solutions was that the customs team’s work was more than just clerical. It was a regulated decision support system. Any automation that set aside that fact would not work. The answer needed to facilitate extraction speed, yet it needed to accommodate good classification judgment, improved completeness control, and enhanced auditability.
The customer had previously implemented patchwork remedies, but each one addressed only a single layer of the issue.
The submission was processed through Dubai Customs’ Mirsal 2 system. It made no declaration preparation. It worked on the premise that the company already had the correct values, codes, paperwork, and supporting logic all lined up. So the most labor-intensive aspect of customs processing work continued to take place outside the submission platform.
They also reviewed the customs brokerage software. These systems enhanced the way records were kept and the command over workflows, yet they still depended on manual input of data from supplier documents received. They didn’t eliminate the need to read diverse invoices and interpret supplier paperwork or make a decision with line-by-line classification.
In theory, HS code databases were helpful, but you needed very precise descriptions of the product. The supplier data in the real world that this client was getting was anything but precise. A supplier might have a generic commercial label, a partial translation, or a model number that only someone who knew the product family could be familiar with. Databases don’t have reason from context. They return what is like the text you passed them. That’s not enough to deal with high-volume import business.
Template-based document tools were also the wrong approach. With more than 200 suppliers generating multiple layouts, languages, and document formats, a template-based system would have turned into a maintenance project in its own right. For each new supplier or layout change, there would be more upkeep.
That’s why the client required an actual AI agent for customs preparation, and not simply OCR, nor simply form automation. It needed to be able to read shipping documents, extrapolate product meaning from these ambiguous descriptions, proactively recommend HS codes with a confidence level, identify missing supporting documents, and assemble a clean customs package that experts could quickly validate. This was a true AI customs clearance automation use case, particularly for a company doing business at this volume in the Middle East import market.
We built the project in stages, as the work of customs is very sensitive to precision. A system that speeds along but classifies poorly or files incomplete declarations just makes mistakes faster. So we began with document intelligence and guided review. and started moving into declaration automation, then submission and tracking, and then into compliance optimization.
In the first stage, we established a centralized intake process for all shipping documents. Suppliers, freight teams, and internal workers could email, manually upload, or submit them via monitored channels. The AI agent picked up the incoming files and deposited them into a regimented processing queue rather than leaving them scattered in inboxes and on file shares.
Thereafter, the system processed each document with multilingual OCR and document reasoning. It captured shipment-level and line-level data: supplier information, item descriptions, quantities, values, weights, origin information, transport references, shipping terms, and compliance document metadata. This was important because the customs specialists had previously been spending a disproportionate amount of their time just transcribing and reconciling these basics.
The most important specification in this stage was the HS code recommendation.
We did not consider HS classification as pure text matching. The AI agent analyzed the product description, internal SKU history, supplier trends, country of origin, any product specifications, and, where possible, images or the structured attributes. It then recommended HS codes with confidence values. High-confidence items could proceed with minimal review. Lower-confidence items were explicitly flagged, and the top candidate classifications, along with the duty implications of each, were also displayed on the dashboard. That made for a much more useful human review. Experts were no longer beginning with a blank field. They were confirming a rationalized shortlist.
This stage was also intended to be learned from corrections. Each time a customs expert modifies the recommended code, that modification is fed back into the classification memory and related-product logic. As time passed, the AI agent improved consistency within recurring product families, particularly for suppliers with descriptions that were vague but followed a stable pattern.
We saw from the beginning that even this stage was adding value before submission automation. But the team was able to move more quickly, as the process of reading documents and conducting first-pass classification was no longer completely manual.
When the extraction and classification layer was stable, we proceeded to declaration preparation.
The AI agent compiled the customs declaration bundle in the format wanted for Mirsal 2 and associated customs procedures. It filled in fields with data extracted, computed duties and VAT calculations based on the latest tariff schedule, and compared shipment values against transaction records to fulfill customs valuation requirements.
This stage also brought a full control check. The system confirms that all the needed supporting documentation is available and authentic before the declaration can be made ready. In the event a certificate of origin is missing, ambiguous, or possibly expired, the shipment is halted. If a necessary compliance certificate for a regulated category is missing, it surfaced there before the file went to customs. For a document expected from the supplier, the AI agent generated and dispatched a structured request instead of depending on end-user manual follow-up.
We made the review interface checklist-based because customs officers required certainty and traceability rather than black-box automation. All critical fields of the declaration were displayed with the suggested value, as well as a reference to the source document from which the value was extracted. If the expert desired to verify the source, value, quantity, or certificate number, the proof was immediately accessible. Clean declarations translate into one-click approvals. Detailed scrutiny was still given to complicated files, but even then, the process was significantly quicker because the groundwork had already been done.
In this phase, the team switched from an entirely manual drafting of declarations to a controlled validation. This is when a customs process begins to act as an actual customs document AI agent in a Dubai solution rather than just a document-capture utility.
When the preparation of the declaration was stable, we extended the AI agent to submission and follow-up.
The approved declarations were sent to Mirsal 2 via APIs when possible and through portal automation when needed. We then built Playwright-based automation for the portal layer, but we did build it with resilience in mind due to the changing customs submission environments. The system also monitored even the customs status updates in real time: submitted, under review, queried, assessed, and released.
When customs inquiries arrived, rather than just marking the shipment as held, the AI agent. It drafts replies based on shipment records, attached documents, and internal transaction references. That helped cut down turnaround time drastically, since experts were peer reviewing an already drafted response instead of creating one from scratch.
We also interfaced the workflow with duty payment and with logistics coordination. Payment workflow could be initiated immediately without delay after customs evaluation is confirmed. Upon release, the system proceeded to the next phase of its operation by creating delivery orders and transport-coordination processes. It mattered because faster document work leads to real savings only if the downstream physical flow is speeding up as well.
At this point in time, the customs team wasn’t simply preparing paperwork more efficiently. The AI agent was managing operational handoffs that frequently generate invisible delays in import clearance.
The latter stage was aimed at enhancing the economics and robustness of the import system.
We implemented an optimization layer that constantly monitored classification and trade-treatment possibilities. That did not mean reclassification on an aggressive or risky basis. It was a way to find out where there were several legitimate interpretations of HS, and to make sure that the company was not defaulting to a higher cost code just out of habit. For unclear situations, the system continued to keep a human customs expert in the decision loop.
Also, we implemented the Free Trade Agreement logic. The AI agent searched for shipments that could qualify for preferential duties under GCC arrangements, CEPA-related structures, and other applicable trade regimes. It was then checked if the right accompanying supporting origin documentation was available. This led to real savings as the company had some valid FTA (Free Trade Agreement) opportunities that were missed due to timing or visibility issues on documentation.
Another significant improvement added is audit readiness. Each classification decision, the referenced supporting documentation, corrections, and submissions were all stored in a structured way that could be retrieved. This put the client in a much stronger position for customs audit review, as they could produce not just the ultimate declaration but also the reasoning path behind it.
At this point, the project turned from speedy clearance into a real agentic AI import documentation UAE system: one that did more than just handle processed documents but also enhanced compliance quality, trade treatment capture, and operational control.
The backend was developed in Python with FastAPI, while asynchronous document processing, extraction, classification, completeness check, and status monitoring were managed by Celery with Redis. Shipment records, classification history, customs workflow states, and audit metadata were stored in PostgreSQL. Elasticsearch enabled fast searches on products, suppliers, HS codes, and prior shipment/classification matches.
We used a combination of Google Cloud Vision and Tesseract for document reading to accommodate multiple languages’ OCR and different levels of scan quality. Document understanding, line-item reasoning, and HS code recommendation logic were handled by Claude. This distinction was critical: OCR pulls out the text, while the AI agent interprets what that text means in the context of product and customs.
We employed Playwright for Mirsal 2 portal automation, but instead of using fragile scripts, we encapsulated it in a submission framework with a health check. The system executed daily tests to monitor for changes in required fields, validation rules, or behaviors of the interface. When a change is detected, submissions that are affected can be routed to manual review rather than silently failing.
The React application dashboard was built for customs specialists, not just for generic analysts. It showcased shipment information that had been extracted, classification recommendations, completeness indications, references to source documents, customs status, and outstanding actions in a single working interface. Without leaving the workflow, specialists were able to validate, override, approve, respond to queries, and evaluate duty impacts.
At aTeam Soft Solutions, we consider this architecture a must for any HS code classification AI solution delivery. A model is not sufficient. The system needs to integrate document intake processing, reasoning, human review, submission to customs, handling of exceptions, and an audit log.
HS classification was the most challenging issue in the system, since it is not a pure text problem. A smart watch can function as a watch, a communication device, or a health-monitoring product, depending on what it really is, how it is defined, and how the customs rules are applied to its principal function. The same supplier description can validly correspond to more than one interpretation.
We solved that by making the AI agent classification logic multi-factor. It took into account product function, material composition, marketing classification, supplier industry, previous classification history, country of origin, and context of related items. For ambiguous products, the system intentionally showed multiple plausible codes along with duty implications rather than forcing a false-precision solution.
Origin-risk review was yet another hurdle. Some suppliers tried to exploit routing through friendly jurisdictions to obtain preferential treatment when the origin of the claims was questionable. The AI agent cross-verified the certificate of origin details with manufacturer information, shipment route, and product profile to identify anomalies. That shielded the client from compliance risk exposure yet maintained legitimate FTA savings.
The changes made to Mirsal 2 were an ongoing threat to operations. Custom environments change, and changes to forms or their validations may cause automation to break if not actively monitored. That is why we put health checks and graceful fallback behavior into the workflow. The goal was not “automation at all costs.” The goal was automation under control that would know when to stop and escalate.
However, the most important technical takeaway was that the customs context matters as much as the product wording. At the beginning of the project, we approached HS classification too much like NLP. When we introduced contextual factor information such as origin, quantity profile, and operational treatment patterns, accuracy jumped significantly.
The most obvious effect was speed. The average clearance time declined from 5 to 8 days to 18 to 36 hours. This became feasible because the preparation of the customs package was much faster, with fewer errors and less need for follow-up, which reduced friction both inside the company and on the part of customs.
Preparation of documentation for each shipment decreased from 3-4 hours to about 25 minutes. That doesn’t mean customs officers vanished. Instead, they moved from manually pulling data and repetitively formatting it to perform focused validation and handling exceptions.
The accuracy of the HS code classification was 96.5%, which was slightly higher than the client’s historical human average of about 94%, but the greater value was in consistency. And the AI agent did particularly well for unusual or less frequently processed product categories, such as those where human judgment was more variable.
The error rate in declarations was reduced from around 6% to 0.8%, and the customs query rate was reduced by 70%. This had a direct effect on costs. The declarations were quicker and cleaner, which led to fewer idle containers and fewer cycles of clarification repetitions.
The company anticipated saving AED 1.5 million per year from reducing penalty fees and storage charges alone. In addition to that, on one hand, accurate classification, better use of trade treatment, and capture under the FTA brought first-year duty savings of just under AED 800,000.
Even the customs documentation team itself has transformed shape. The process transitioned from five experts performing complete manual preparation to a reduced group focusing on validation, compliance review, and coordination with suppliers. Three employees were redeployed into more valuable roles instead of repetitive form-filling preparation.
The company also further stated that there were no penalties imposed by customs in one year of operation, as opposed to three or four enforcement actions on a yearly basis in the past. For a high-volume importer in Dubai, that kind of compliance stability is as important as speed.
Overall, the total annual saving is estimated to be about AED 3.2 million. With aTeam Soft Solutions, this made the project a compelling illustration of import clearance automation Middle East companies could genuinely count on: speedier processing, improved accuracy, more robust auditability, and better trade-economics results, all at once.
We implemented the solution in Python using FastAPI for backend coordination, Celery and Redis for asynchronous execution, PostgreSQL for workflow and audit information, Elasticsearch for product and HS history search, Google Cloud Vision combined with Tesseract for multilingual OCR, Claude for document understanding and classification reasoning, Playwright for Mirsal 2 automation, React.js for customs operations dashboard, and AWS EC2, RDS, S3 and Lambda for hosting, storage and event-based processing.
The biggest takeaway was that customs intelligence can’t be treated as just the extraction of documents alone. We ended up initially overweighting product description parsing and underweighting operational context. When we added other information, such as origin, product family history, and port-specific procedural regularities, classification quality rose substantially.
We also discovered that a customs team could have confidence in automation if it showed its reasoning on work. Experts were more likely to accept a recommendation when they were able to view the source documents, the alternative classifications, and the implications on duties. Explainability was not more than just a nice-to-have feature. That was what made the leap to adoption feasible.
Lastly, we found out that the first true ROI is often realizing reduced friction before it occurs in full automation. Quicker document reading, more efficient completeness checks, and fewer customs queries led to significant savings long before full submission automation was fully developed. This is now a standard design pattern for aTeam Soft Solutions when we develop a regulated workflow AI agent.
Many Importers throughout the UAE and the broader Middle East often assume customs delays are a normal part of global trade. In reality, a large significant amount of the delay comes from inconsistencies in documentation, poor classification processes, and segmented preparation processes that take place prior to customs receiving the file.
At aTeam Soft Solutions, we develop systems in which an AI agent reads shipment documentation, suggests compliant classifications, constructs declaration packages, monitors customs progress, and escalates only a handful of cases that really require expert intervention. That is what turns the import operations transaction from reactive paperwork into managed clearance execution.