National Insurance Test Support API
Date | Amount |
---|---|
Version and status | |
Available in Sandbox | Yes |
Sandbox base URL | https://test-api.service.hmrc.gov.uk |
Available in Production | No |
Overview
Lets you set up test data for the National Insurance API.
Versioning
When an API changes in a way that is backwards-incompatible, we increase the version number of the API. See our reference guide for more on versioning.
Errors
We use standard HTTP status codes to show whether an API request succeeded or not. They are usually in the range:
- 200 to 299 if it succeeded, including code 202 if it was accepted by an API that needs to wait for further action
- 400 to 499 if it failed because of a client error by your application
- 500 to 599 if it failed because of an error on our server
Errors specific to each API are shown in the Endpoints section, under Response. See our reference guide for more on errors.
Endpoints
/national-insurance-test-support/sa/{utr}/annual-summary/{taxYear}
Create National Insurance summary test data
POST
Lets you create National Insurance contributions test data
Path parameters
Name | Description |
---|---|
utr
string
required
|
The 10 digit self-assessment UTR for the individual.
For example: |
taxYear
string
required
|
The tax year for the National Insurance contribution being created. Tax year in the format
For example: |
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. application/vnd.hmrc.1.0+json
|
Content-Type
required
|
Specifies the format of the request body, which must be JSON. application/json
|
Authorization
required
|
An OAuth 2.0 Bearer Token.
For example: Bearer 59fc92c1cdf0b8ef1f138a702effdbd2
|
See also fraud prevention.
Request
{ "scenario": "HAPPY_PATH_1" }
Name | Description |
---|---|
scenario
string
optional
|
The scenario to create test data for Limited to the following possible values: HAPPY_PATH_1
- Standard happy path test scenario (default)
HAPPY_PATH_2
- Happy path test scenario with different values
|
Responses
HTTP status 201 (Created)
Example response for scenario HAPPY_PATH_1
{ "class1": { "totalNICableEarnings": 10 }, "class2": { "totalDue": 20 }, "maxNICsReached": false }
Example response for scenario HAPPY_PATH_2
{ "class1": { "totalNICableEarnings": 17 }, "class2": { "totalDue": 319.57 }, "maxNICsReached": true }
Name | Description |
---|---|
class1
object
required
|
|
totalNICableEarnings
number
required
|
Total Class 1 earnings subject to National Insurance contributions between the Primary Threshold and the Upper Earnings Limit
For example: |
class2
object
required
|
|
totalDue
number
required
|
Total Class 2 National Insurance contributions due
For example: |
maxNICsReached
boolean
required
|
A flag indicating whether the maximum National Insurance contributions has been reached
For example: |
Close Section