Skip to content

Logistics21 July 2026

AI for customs paperwork in Algeciras

Xora Intelligence9 min read
A worker at the Port of Algeciras checks the containers with a tablet

It is half past eight in the morning in an office ten minutes from the port. On the customs agent's desk there are two screens and a folder. In her inbox, an importer has sent the commercial invoice as a PDF, the packing list and the certificate of origin for a container arriving tomorrow. All three are in English and each one lays out the data in its own way. She has to pull out the items, weights, values and tariff codes, key them into the DUA and submit it before the lorry turns up at the terminal. The phone rings: a haulier wants to know where his cargo is. It rings again.

That half hour repeats dozens of times a day in the Campo de Gibraltar, and it is not done by an intern: it is done by the person who knows about tariffs. Here we explain which part of that work artificial intelligence can take on in a customs agency, a freight forwarder or a haulage company, which part stays with you, and where it makes sense to start.

Why this makes sense right here

The Port of Algeciras is not just any port. According to the 2025 review by Puertos del Estado and the Bahía de Algeciras Port Authority, it handled 4.73 million TEU in 2025 (0.54% more than the year before) and passed 100 million tonnes, which keeps it as Spain's second container port, behind Valencia.

Behind that figure there is a whole ecosystem: customs agencies, freight forwarders, road haulage companies, warehouse operators, shipping agents and logistics operators. Many of them are SMEs. According to the INE Central Business Directory, on 1 January 2025, 81.6% of Spanish companies had two employees or fewer. In an office like that, the person who clears the goods is the same one who answers the phone, chases the missing document and keys in the DUA. There is nobody to hand the paperwork to, because there is nobody else.

That is where AI adds something real, and not as a slogan. If you want to see how we approach it in the area, have a look at the page on AI automation in Algeciras.

What paperwork does a freight forwarder or customs agency really handle?

Before talking about AI, it is worth looking at the problem as it is. A customs office or freight forwarder lives on moving documents, not just boxes. In a normal operation, the following cross the desk:

  • DUAs (the Single Administrative Document, or customs declaration) for imports and exports.
  • Commercial invoices from the foreign supplier, each with its own format and language.
  • Packing lists: what is in each package, with weights and measurements.
  • Certificates of origin, health or conformity certificates, depending on the goods.
  • Bills of lading and CMR consignment notes for the road leg.
  • Loose emails from the client, the vessel, the terminal and the haulier, each with a different piece of data.

The problem is not that there are many. The problem is that the information is trapped in PDFs, scans and emails, placed differently in each document, often in another language, and it has to be re-typed by hand into the management software, the DUA or the ERP. That re-typing is slow, it is where the one-digit errors creep in that later cost you a customs incident, and it takes time away from what really needs judgement: classifying an item correctly, assessing a customs procedure, dealing with an inspection.

What can AI do with those documents?

This is where the concrete part comes in. Today AI is good at reading a document, understanding what type it is and pulling out the data that matters, even if each supplier lays it out differently.

In practice, a data extraction system does this: it receives the commercial invoice and the packing list (whether they arrive as a PDF, a photo or a scan), recognises that one is an invoice and the other a contents note, and finds the fields you need: supplier, invoice number, incoterm, currency, items, quantities, weights, values. Instead of typing it, you have it already filled in and only need to check it. The person stops copying and starts validating, which is what they know how to do and what the machine should not do alone.

This is not guesswork: it is the same kind of work we describe in our invoice automation service and in the article on how to automate invoices with AI, applied to the documents of international trade. The difference in customs is that there are more document types and that a misread figure has regulatory consequences, so human review is not optional: it is part of the design.

A couple of things worth being clear about, so we do not sell you smoke:

  • The AI proposes, you confirm. The final tariff classification, the valuation and the responsibility to the Tax Agency (Agencia Tributaria) remain the professional's. The system saves you the typing and the searching, not the decision.
  • The more repetitive a flow is, the better it works. If the same importer sends you the same type of invoice every week, the system learns that pattern and hardly ever fails. An odd document that turns up once a year will still need your attention, and that is as it should be.

And what about customers from other countries?

Goods from half the world come in and out through Algeciras, and a good share of your clients or correspondents do not speak Spanish. Two fronts eat up the phone and the inbox: those asking where their goods are and those asking what they need to clear them.

A well-built conversational assistant covers that first level at any hour and in several languages. The customer writes in English, French or Arabic and gets an answer straight away: what state their file is in, which document is missing, what the deadline is. It does not solve the complicated incident; that still goes up to a person. But it takes away the flood of "any news on my container?" messages that today interrupts whoever is clearing something else. If what overwhelms you is not the paperwork but the phone outside office hours (the ship that docks at dawn, the client on the other side of the Strait, the Gibraltar border just reopened), we cover that separately in 24-hour AI customer service for Algeciras freight forwarders.

Cargo tracking is the clearest example. If the shipment status already lives in some system (yours, the terminal's, the vessel's), that assistant can look it up and reply without anyone looking at a screen. The condition is that the systems allow themselves to be queried. And that brings us to the underlying problem.

Systems that do not talk to each other

A logistics office has, if it is lucky, a file management program, a customs module, the accounting or ERP, the usual spreadsheet and email. If it is less lucky, each one is an island. The data you already typed into the customs program you type again into the invoice, and once more into the tracking Excel.

Integration is what makes that data travel by itself. When the file number, the container and the client are connected across systems, the status is updated in one place and appears in all of them, the assistant can answer without intervention, and the re-typing between programs disappears. You do not always need to change software: many times it is a matter of building bridges between what you already have. That is exactly what we do in systems integrations, and it is usually what frees up the most time, more than any flashy chatbot.

Mandatory e-invoicing: a good moment to tidy up the paperwork

There is also a calendar reason to get organised now. Royal Decree 238/2026 develops the mandatory electronic invoice between businesses in Spain. Once the invoice stops being a loose PDF and becomes a structured document that your systems have to issue and receive, having an orderly document flow stops being a convenience and becomes a condition for doing business.

The good news is that the effort pays off in both directions. The same work that prepares you for e-invoicing (structuring the data, connecting the systems, no longer typing by hand) is what lets you automate document extraction and tracking. They are not two projects: they are the same one. It also holds for your smaller clients: the shop in La Línea that now imports through the crossing has the same problem in miniature, and we cover it in open border in La Línea: invoices and paperwork.

And tidying up invoicing hits cash flow directly. According to the CEPYME Late Payment Observatory, the average payment period in Spain was 80.5 days in 2025, well above the 60-day maximum set by Law 3/2004 on combating late payment. In a sector where every operation leaves a chain of invoices, issuing earlier, without errors and with automatic follow-up of pending payments means money coming in weeks sooner. Not because the customer magically pays faster, but because the invoice goes out the day it should and the due-date reminder does not depend on somebody remembering.

Where do you start without making a mess of it?

The temptation is to automate everything at once. Do not. What works in a small logistics office is the opposite:

  1. Pick the document that costs you the most time. Usually it is the supplier invoice or the packing list, because they arrive daily and in different formats. Start with one.
  2. Measure it first. How long it takes you today to move that data by hand, and how many files a day. Without that starting figure, nobody can later show you whether the change worked.
  3. Connect two systems first, not seven. The one that holds the file and the one that invoices, for example. Make sure that bridge works and stands up to real cases before building the next.
  4. Keep human validation in. Not as a patch, but as part of the design: the AI prepares, the person confirms whatever has consequences in customs.

How long does all this take? It depends on what is underneath. An office with a management program with an open API is not the same job as three closed programs and a notebook. We give you the timeline once we have seen what needs building; before that it would be an invented number. If you like, tell us your case and we will look at it with your actual documents and systems, not with a generic example.

Frequently asked questions

Will the AI classify tariff items on its own? No, and it should not. The AI can read the documents, propose the data and help you find information, but the final classification and the responsibility to the Tax Agency belong to the professional. The system takes away the typing and the searching, not the judgement.

I use closed customs software. Do I have to change it? Not necessarily. In many cases it is a matter of building bridges between what you already have, not throwing it away. If the program lets data in and out, it can be connected; if it is completely closed, we first have to work out how the information gets through. That is sorted out in the first meeting.

Can the assistant serve my foreign customers? Yes. It can work in several languages and cover the first level (file status, outstanding documents, where the goods are) at any hour. Incidents that need judgement still go up to a person.

Is this only for large logistics operators? No. In fact it makes more sense the smaller the office, because that is where there is nobody to hand the paperwork to. The more repetitive and daily a flow is, the better it works to automate it.

Tell us what you need and we will say whether we can do it, how we would approach it and what it would cost. If it is not for us, we will tell you that too.

Found it useful? Share it with someone who needs it

Xora IntelligenceAI consultancy and custom software in Los Barrios (Cádiz). We write about what we build for businesses in the province. If you have a question about your case, write to us.

Keep readingRelated articles

The whole blog

Bay of Gibraltar · photo by Cabeza2000 (CC BY-SA 4.0)

Shall we talkabout your business?

Tell us which tasks take up most of your time. We will tell you whether they can be automated and how we would do it. If we can't help, we will tell you that too.