web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Making Tax Digital - UK taxation

(0) ShareShare
ReportReport
Posted on by 20

Create new Test User generates 401 web service error when trying to generate a new test user.

{"code": "INVALID_CREDENTIALS", "message": "Invalid Authentication information provided"}

The client ID and secret was copied and pasted to the Sandbox HMRC in the web applications
but i can not create a test user to go to the next step of getting an authentication code.
2806.pastedimage1586951577854v1.png
Messages
5076.pastedimage1586951678505v2.png

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,069 Super User 2025 Season 2 on at

    Moved to the Dynamics 365 Finance forum.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,069 Super User 2025 Season 2 on at

    Hi Philip,

    The Server Token field also needs a value. Have a look at the documentation: docs.microsoft.com/.../emea-gbr-mtd-vat-integration

  • Philip.Potgieter Profile Picture
    20 on at

    Thanks Andre,

    I have studied that document now for 2 days and I'm missing something.. you can not request a token without the authorization code, and you can't get the authorization code if you don't have a test user. I cannot create a test user that is when i get the Issue, when I'm supposed to get user login credentials back from HMRC. This is specifically on the Sandbox HMRC web application. so somewhere I'm doing something wrong.

    https://docs.microsoft.com/en-us/dynamics365/finance/localizations/emea-gbr-mtd-vat-integration#obtain-an-authorization-code-for-the-sandbox-environment

    I have a HMRC login i created and i copied the Client ID and Secret to the Sandbox HMRC and then i try to create a test user so i can get the VRN and system test user and password info.txt so i can get the access code and token.

  • Suggested answer
    Philip.Potgieter Profile Picture
    20 on at

    This information (step 1 and 2) is omitted from any documentation for when setting it up the first time:

    The registered HMRC user and the test user is not the same record and new test user must be created the first time.

    1. https://developer.service.hmrc.gov.uk/api-test-user
    2. When user is created, copy all the information from this page, user ID, password and VAT Registration Number (VRN) - 9 digit number
    3. Input the VAT registration number into D365 Organization Administration -> Legal Entity -> Registration ID’s -> Registration ID -> VATID for GBR and add it to the Tax exempt number import and export on the legal entity.
    4. Request Authorisation code using above username and password
    5. Request token using authorisation code
  • Suggested answer
    Steve Byrne Profile Picture
    225 on at

    Hi Philip,

    HMRC has recently changed the process for creating a TEST User. It is no longer created from within D365FO Electronic massages [as it was for the last year or so]. Now you need to create the TEST User from within HMRC's site.

    Using this URL: developer.service.hmrc.gov.uk/api-test-use

    Select the Organisation option > select Create and the necessary credentials will be created for you. Then use them to get the Authorisation code and Obtain access token.

    Regards,

    Steve

  • YOG Profile Picture
    414 on at

    Hi Philips,

    Agree with Steve's Comment.

    Process has changed. Test user has to be created from HMRC site.

    developer.service.hmrc.gov.uk/.../user

    It works for me! so should work for you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 478 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans