×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Webservice validate UK EORI-numbers

Webservice validate UK EORI-numbers

Webservice validate UK EORI-numbers

(OP)
Hi,

After Brexit EORI-numbers can no longer be validated by the EU validator. Therefore I want to use https://api.service.hmrc.gov.uk/ to validate EORI-numbers from the UK (GB...etc.).

I've already registered at GOV.UK, but I cannot find good examples or documentation to get started using VFP.

Has anyone perhaps already tried to check UK EORI numbers using the API?

Regards, Gerrit

Today is only yesterday's tommorrow - Uriah Heep

RE: Webservice validate UK EORI-numbers

Square brackets for italics in your signature Gettit?

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: Webservice validate UK EORI-numbers

(OP)
Hi Griff,

Better now?

Regards, Gerrit

RE: Webservice validate UK EORI-numbers

No.

You need to do it like this:

[i]Today is only yesterday's tommorrow - Uriah Heep[/i]

which will be rendered like this:

Today is only yesterday's tommorrow - Uriah Heep

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Webservice validate UK EORI-numbers

(OP)
Hi Mike,

At least I could fix this “issue”.

Regards, Gerrit

RE: Webservice validate UK EORI-numbers

Of course, none of this helps with your real question. I'm sorry I can't help with that. I know that HMRC have a page where you can interactively check a given number, but you presumably want to do it automatically and in bulk.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Webservice validate UK EORI-numbers

(OP)
Hi Mike,

Automatically yes, in bulk no.

It’s difficult - at least for me - to get started. I guess I will have two challenges, the authentication and the webservice itself.

Regards, Gerrit

RE: Webservice validate UK EORI-numbers

Gerrit,

This is a very crude call to the Web Service and response interpretation, but it demonstrates the fundamentals. Fortunately, the EORI check service is open so it's easy to set up.

CODE --> VFP

LOCAL HTTP AS MSXML2.ServerXMLHTTP60

m.HTTP = CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")

LOCAL GBEORI AS String

m.GBEORI = "GB018384932372"		&& this is valid
* m.GBEORI = "GB925473846288"		&& this is not valid

LOCAL APIParameters AS String

TEXT TO m.APIParameters TEXTMERGE NOSHOW
{
 "eoris": [
    "<<m.GBEORI>>"
    ]
}
ENDTEXT

LOCAL IsValid AS Logical

m.HTTP.open("Post", "https://test-api.service.hmrc.gov.uk/customs/eori/lookup/check-multiple-eori", .F.)
m.HTTP.setRequestHeader("Accept", "application/vnd.hmrc.1.0+json")
m.HTTP.setRequestHeader("Content-Type", "application/json")
m.HTTP.send(m.APIParameters)

IF BETWEEN(m.HTTP.status, 200, 299)

	m.IsValid = '"valid":true' $ m.HTTP.responseText

ELSE

	m.IsValid = .NULL.

ENDIF

? m.GBEORI, m.IsValid 

RE: Webservice validate UK EORI-numbers

(OP)
Hi António,

Thank you very much for posting this solution.

Apparently authentication is not required after all. The HMRC online information was confusing for me.

I'm already using your solution to validate EU EORI-numbers and will add this for UK validations.

Regards from Holland!

Gerrit

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close