Check your customers' EORI numbers with HMRC
A declaration made with an EORI number that is no longer valid gets rejected, usually when the goods are already waiting. This recipe checks every customer’s GB EORI number with HMRC once a week, so a person hears about a lapsed or mistyped number before it is used.
Use this templateNeeds an AI connection.
It uses HMRC’s public Check an EORI Number service, which needs no connection.
What HMRC tells you
Section titled “What HMRC tells you”| Outcome | What it means |
|---|---|
valid |
HMRC holds it as a valid GB EORI number |
not_valid |
HMRC does not hold it as a valid number |
wrong_format |
Not GB followed by 12 to 15 digits, so it was not sent |
xi_not_checked |
A Northern Ireland number, which HMRC’s service does not check |
A valid number comes back with the trader’s name and address only when the trader agreed to let HMRC share them.
1. Keep your customers in a table
Section titled “1. Keep your customers in a table”Create a reference table of customers with a column for each one’s EORI number. If your customers live in your TMS, read them from there instead.
2. Read them on a schedule
Section titled “2. Read them on a schedule”Start with a Schedule trigger and Read Reference Table. Leave At least at 0 if an empty table is fine.
3. Check every number in one step
Section titled “3. Check every number in one step”Add Check EORI numbers and pick the table’s rows as EORI numbers. The tag reads one column of the rows; choose the EORI column on it. Empty cells are skipped and a number that appears twice is checked once.
Give the whole list to one step rather than one step per customer inside For each item. The block sends 10 numbers per request and keeps under HMRC’s limit of 3 requests per second, which separate steps running side by side cannot do. One step takes up to 500 numbers.
To check a single customer when you add them, type or pick their one number as Text instead.
4. Send the failures to a person
Section titled “4. Send the failures to a person”Connect Some not valid to Checklist. Under Comparison, choose Check every row of a list… and pick the block’s Results. Set Name rows by to eori, so the review shows which number failed. Add the column Valid, compared with the fixed value Yes. Set Ask a person to When a check fails. See Reconcile two documents or lists.
All valid needs nothing after it, so a week with no problems ends there.
What goes wrong
Section titled “What goes wrong”- Northern Ireland numbers. HMRC’s service checks GB numbers only, so XI numbers always come back as
xi_not_checkedand reach the Checklist. Check them with the European Commission’s EORI validation service, or keep them in a separate column. - A valid number without a name. Name and address are optional for the trader to share. Their absence says nothing about the number.
- Rate limits and outages fail the step and can be retried. A request times out after 20 seconds.
- A refused check. HMRC can refuse some made-up or test numbers with HTTP 403. The step fails and says so. Check the numbers and run the step again.
Try it
Section titled “Try it”The service is public, so a draft run calls it for real and you can try this with your own customers’ numbers straight away.