Foreign trade
Validating Mexican customs documents via API
How pedimento validation works in practice: structured reading, every key checked against the Annex 22 catalogs, totals reconciled against line items — flags with citations, via API.

Every import into Mexico produces a pedimento — the customs declaration that records the operation: importer, merchandise, regime, values, duties paid. Your freight forwarder files it, your customs broker reviews it, and your company keeps it, because years later it is your evidence before the tax authority. For a trade or logistics team sitting abroad, the practical question is blunt. Hundreds of these documents cross the operation each month; who verifies them, against what, and where does the result live?
A document made of catalogs
The pedimento is not free text. It is filled with keys: a key for the operation type, keys for the regime, for the attached documents, for units of measure, for merchandise identifiers. Each key family has a closed list of valid values, and those lists — the catalogs — are published in the appendices of Annex 22 of the General Foreign Trade Rules, the same annex that defines how the pedimento is filled out.
That structure is good news for control. Because the valid values are published, much of a pedimento's quality can be verified mechanically. A key that does not exist in its catalog, a unit of measure that does not correspond, totals that do not match the sum of the line items — all of it is detectable by comparing the document against the norm, field by field.
The bad news is scale. Reviewing ten pedimentos a month with care is feasible. Reviewing five hundred, key by key and reconciling totals, is not a job for eyes.
What validation via API looks like
The mechanics have three movements, and each is designed to leave evidence.
Structured reading. The pedimento is read as what it is — header fields, line items, totals — not as a block of extracted text. Every value lands in its field, which is what makes comparison possible at all.
Every key against its catalog. Each coded value is checked against the corresponding Annex 22 catalog. What matches, passes; what does not is marked.
Totals against line items. The document's totals are reconciled against the sum of its lines. When they do not close, the result carries flags — never silence — with the values from both sides, so your team sees the size and location of the gap.
A discrepancy comes with its citation
The output is never "your tariff code is wrong". It is: this field carries this value, and the catalog it was compared against says otherwise. Field, value, catalog — a reviewable piece of evidence, not a verdict. Classification and the decision to rectify belong to your customs broker and your trade team.
That boundary is the difference between a control tool and an opinion. What the validation contributes is narrower and more useful — no formal inconsistency reaches your broker conversation undetected.
Beyond the pedimento: the shipment file
A pedimento rarely travels alone. The operation's file includes master and house bills of lading, co-loader bills, air waybills, arrival notices, mill certificates. These documents get the same structured treatment — read into fields, verified where a verification pack exists for the document type.
Where no verification pack exists, the document is delivered as a transcription, explicitly marked as unverified. Your systems always know which fields were checked against a norm and which were merely read. That distinction is part of the contract, and it is what keeps the output trustworthy.
The API angle matters for foreign teams in particular. Results return as structured data with an audit trail, so validation can sit inside your own pipeline — the TMS, the customs-file archive, the AP workflow — rather than inside someone's mailbox in Mexico. The consumption model is credit-based, and a document that could not be read consumes no credits. An illegible or incomplete PDF is reported as such, not billed.
Why a second control, if the broker already reviewed it
For the same reason you reconcile a bank statement the bank itself issued. The interest in verification belongs to the importer. Brokers and forwarders process high volumes on short deadlines; capture errors exist, and their consequences — a weak file, a clarification before the authority, a miscalculated duty — are absorbed by the importer, not by whoever typed the entry.
A systematic second control over one hundred percent of documents does not replace your broker. It adds what human review cannot give at scale, and it produces the by-product that audits actually consume: a record showing every document was checked, with every flag and its citation. The exceptions surface; the clean documents pass in silence.
This is the shape of Vigía Legal's foreign-trade document control. It belongs to the same discipline as the rest of your Mexican compliance stack — contractor validation and operational controls at your sites. Mechanical checks, run on everything, leaving evidence as they go. Your pedimentos will keep being the central document of your Mexican trade operation. The open question is whether their inconsistencies are found by your process, or by the authority's.
Vigía Legal
Validate each provider's REPSE compliance before the PO and the payment, integrated with your ERP.
Book a demoFrequently asked questions
- What is a pedimento?
- The pedimento is the customs declaration for every import or export operation in Mexico — who imports, what merchandise, under which regime, at what values, and the duties paid. It is also the fiscal backbone of the operation years later, when the tax authority reviews it. It is filled with coded keys, and each key family has a closed catalog of valid values published in Annex 22 of Mexico's General Foreign Trade Rules.
- Does validating a pedimento amount to a customs ruling?
- No. Validation checks that each key belongs to its Annex 22 catalog and that totals reconcile against line items. The output is a list of discrepancies, each with its citation — the field, the value, the catalog it was compared against. Legal conclusions, including tariff classification, remain with your customs broker and your trade team.
- Which documents besides the pedimento can be processed?
- Shipment documents that travel with the operation: master and house bills of lading, co-loader bills, air waybills, arrival notices and mill certificates. Documents with a verification pack are validated; anything without one is delivered as a transcription, explicitly marked as unverified.
- How does the credits model treat unreadable documents?
- A document that could not be read does not consume credits. If a PDF arrives illegible, incomplete, or is not the document type expected, the result says so explicitly and the operation is not charged.
Keep reading