-
Notifications
You must be signed in to change notification settings - Fork 19
Creating Test Users in the Sandbox
Jacob Brownlow edited this page Nov 25, 2021
·
5 revisions
As of 25th Nov 2021, the below setup is working:
-
Setup vendor application on the Developer Hub for the Sandbox environment
-
Subscribe your vendor application to the VAT APIs you are trying to test:
• VAT (MTD) API
and the following:
• Create Test User API
-
Create a user using the
/organisationsCreate Test User endpoint (Documentation)
Alternatively use the Create Test User frontendExample response
{ "userId": "571213830501", "password": "aJ9so7mildjq", "userFullName": "Claude Venables", "emailAddress": "claude.venables@example.com", "organisationDetails": { "name": "Company UHNS5I", "address": { "line1": "16 Portobello Road", "line2": "Nottingham", "postcode": "TS5 1PA" } }, "vrn": "966673662", "vatRegistrationDate": "2018-05-02" }
-
Grant authority for your vendor application to act on behalf of the user (Documentation)
Navigate to the grant authority URL
- Use your application
client_id - Use your application
redirect_uri
https://test-api.service.hmrc.gov.uk/ oauth/authorize?response_type=code &client_id= &scope=read:vat+write:vat &redirect_uri=Login with the user's
userIdandpasswordto grant authority - Use your application
-
Retrieve access token with
/oauth/tokenendpoint (Documentation)Example response:
{ "access_token": "661a961bacea332f852d397a2dafc83", "refresh_token": "dbebf893f08bcb18bb91311a6a952881", "expires_in": 14400, "scope": "read:vat write:sent-invitations write:vat", "token_type": "bearer" }
-
Using the vat-api (Documentation)
- Use user's Authorization
access_tokenreturned in step 3 - Use user's
vrnfrom step 1
- Use user's Authorization