In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Use Alteryx to Check VAT# on UK VAT Site

zqlcancer
8 - Asteroid

Hi

 

I used a marco shared by David through below link to check VAT number on UK VAT site. It has been working correctly for several months but I have had issues since last week as this marco now returns no data.

 

I am attaching the original marco shared in that link again. Can anyone help to try at their end and let me know if it still works?

 

Post Brexit UK VAT ID Validation - Page 2 - Alteryx Community

 

 

11 REPLIES 11
DavidSkaife
14 - Magnetar

Hi @zqlcancer 

 

This link may shed some light on it, HMRC have depreciated version 1 of the VAT Check API on the 17th Feb and you now need to register and go via authentication -  https://developer.service.hmrc.gov.uk/api-documentation/docs/api/service/vat-registered-companies-ap...

zqlcancer
8 - Asteroid

Thanks for sharing, I just noticed that. But it is strange that one of my colleague said she can still use it. 

zqlcancer
8 - Asteroid

OK,I have successfully registered and get my Client ID and Client Secret number. But I am not quite sure where to put these information.

 

@DavidSta , is it ok for you to advise how to change your old workflow to compliance with new API change of UK VAT Verification site?

DavidSkaife
14 - Magnetar

Hi @zqlcancer 

 

Having a read through the HMRC documentation there is a lot of guidance on what you need to do - looks like you need to use the Sandbox version first before they allow access..

 

Looking at it a brief overview of what you'll need to do is this:

  • use your Client ID and Secret to make an API call to obtain the Access Token
  • use the Access Token to make an API call to obtain the VAT info
  • do this in one workflow, which means that each time you run it you will generate a new Access Token

There is a really good article on obtaining an access token here - https://www.thedataschool.co.uk/erlina-cahyadi/retrieving-an-access-token-through-oauth-on-alteryx/

 

This article then explains how to use the token to access the data - https://www.thedataschool.co.uk/erlina-cahyadi/getting-api-authorization-with-basic-authentication-o...

zqlcancer
8 - Asteroid

@DavidSkaife 

 

I followed HMRC API documentation and successfully receive an access token in sandbox environment. But when I tried to use this access token to issue a Get request, I received an error message saying “{"code": "RESOURCE_FORBIDDEN", "message": "The application is not subscribed to the API which it is attempting to invoke"}”.

 

Could you please help to check my attached workflow and let me know what I did wrong? Please be noted I include fake access token in the sample just for reference.

 

access token.jpg

DavidSkaife
14 - Magnetar

Hi @zqlcancer 

 

On an initial look there is nothing wrong with your workflow, and looking at the error message i'd say the problem is on HMRC end - it's basically saying the code you're sending isn't authorised..

 

Are you doing the below as well?

 

Screenshot 2025-04-15 123104.png

 

Other things i can suggest - build the workflow out so it runs through the obtaining of the access token and passes that as a parameter to the main API call, that way you won't lose anything and it will never expire (even though it lasts for 4 hours)

 

Try building the API in something like Postman as well, and see if it works in there

 

Without access to the Developer Hub myself its going to be tricky to troubleshoot further - do the above and see how you get on

zqlcancer
8 - Asteroid

@DavidSkaife 

The pic you used should refer to the first step "Request an OAuth 2.0 access token with the required scope", I did it and received the access token which I used in step 2 "Issue a GET request". 

 

Do you suggest me combine all 2 steps in 1 workflow? If this is the case, I have done so but received same error message. If your guess is that the issue is on HMRC end perhaps I can apply for production credential key and try in production environment. 

DavidSkaife
14 - Magnetar

Hi @zqlcancer 

 

I'd suggest trying the process in another tool first, to make sure its not anything going wrong on your side

zqlcancer
8 - Asteroid

@DavidSkaife , do you mean to try another tool other than Alteryx?

Labels
Top Solution Authors