Making Tax Digital Testing - Invalid Client ID

Hello,
We are trying to test out, and get to grips with, the MTD development in Business Central (On Premise) - We are following the Microsoft online guides but whenever we try to "request Authorisation code" on Oauth2 setup (using the test api https://test-api.service.hmrc.gov.uk/) for the HMRC sandbox we get the error {"error":"invalid_request","error_description":"client_id is invalid"}

If we point the service to the live endpoint https://api.service.hmrc.gov.uk/ the client ID is correct - the issue is that we want to test it with the test-api endpoint but we cannot.

The Client ID and secret are the ones published by Microsoft on Partnersource but there doesn't seem to be a different client id for the live/test environments

Any suggestions would be appreciated!

Answers

  • patricksoutarpatricksoutar Posts: 4Member
    I believe in order to use any of the testing features you need to register at https://developer.service.hmrc.gov.uk/developer/registration.

    Then you will have to create your own 'application', which is a way to have your own test environment that you can select available endpoints for, including VAT (MTD).

    Once you have created this 'application', you will then have a unique client ID and secret which is what I have used to put in to my test environment which happens to be NAV (not BC).

    From there you can then request a token, however before you do this you should use the Support API to generate a test user, which will generate an ID/Password so you can log in when requesting the token in order to grant authorisation, and it will give you, providing you select Organisation (not individual) a VAT number along with other details you may need.
  • patricksoutarpatricksoutar Posts: 4Member
    I have an update on this. Creating the test users from the links does not work as it is a 'basic' test user. You must use the API to generate your test user.

    This can easily be done using the application Postman if you are not familiar with generating on-the-fly api calls.

    API Reference:
    https://developer.service.hmrc.gov.uk/api-documentation/docs/api/service/api-platform-test-user/1.0#_create-a-test-user-which-is-an-organisation_post_accordion
Sign In or Register to comment.