This version is in beta - expect some breaking changes.
Individuals State Benefits (MTD) API
Available in Sandbox | Yes |
---|---|
Sandbox base URL | https://test-api.service.hmrc.gov.uk |
Available in Production | Yes |
Production base URL | https://api.service.hmrc.gov.uk |
Overview
This suite of endpoints allows software packages to:
- list and retrieve state benefits
- create or amend customer added state benefits
- delete customer added state benefits
- create or amend benefits financial data
- mark a state benefit as ignored
For certain scenarios a request may not be made for a tax year which has not yet ended. This includes:
- creating, or amending a customer added state benefit
- ignoring a HMRC held state benefit
- amending state benefit amounts for benefit types which are not Job Seekers Allowance (JSA) or Employment Support Allowance (ESA)
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.
Single errors will be returned in the following format:
{
"code": "FORMAT_FIELD_NAME",
"message": "The provided FieldName is invalid"
}
Where possible, multiple errors will be returned with INVALID_REQUEST
in the following format:
{
"code": "INVALID_REQUEST",
"message": "Invalid request",
"errors": [
{
"code": "RULE_FIELD_NAME",
"message": "The provided FieldName is not allowed"
},
{
"code": "FORMAT_FIELD_NAME",
"message": "The provided FieldName is invalid"
}
]
}
Where it is possible for the same error to be returned multiple times, message
will describe the expected format and paths
will show the fields which are invalid.
Where arrays are submitted a number indicates the object in the array sequence, for example, /arrayName/1/fieldName
An example with single error:
{
"code": "FORMAT_STRING_NAME",
"message": "The provided field is not valid",
"paths": [ "/arrayName/0/fieldName" ]
}
An example with multiple errors:
{
"code": "INVALID_REQUEST",
"message": "Invalid request",
"errors": [
{
"code": "FORMAT_VALUE",
"message": "The field should be between 0 and 99999999999.99",
"paths": [ "/objectName/fieldName1", "/arrayName/0/fieldName2" ]
},
{
"code": "FORMAT_STRING_NAME",
"message": "The provided field is not valid",
"paths": [ "/arrayName/0/fieldName3", "/arrayName/1/fieldName3" ]
}
]
}
Changelog
You can find the changelog in the individuals-state-benefits-api GitHub wiki.
Support
- Raise non-technical or platform-related issues with the Software Development Support Team (SDST).
- Raise technical issues on the individuals-state-benefits-api GitHub page.
Testing
You can use the sandbox environment to test this API. You can use the Create Test User API or it's frontend service to create test users.
It may not be possible to test all scenarios in the sandbox. You can test some scenarios by passing the Gov-Test-Scenario header. Documentation for each endpoint includes a Test data section, which explains the scenarios that you can simulate using the Gov-Test-Scenario header.
If you have a specific testing need that is not supported in the sandbox, contact our support team.
Some APIs may be marked [test only]. This means that they are not available for use in production and may change.
Endpoints
/individuals/state-benefits/{nino}/{taxYear}
This endpoint allows a developer to retrieve a list of all state benefits.
Any HMRC held benefit amounts that have been amended, will result in a duplicate benefit being created within the customerAddedStateBenefits
array. It will have the same benefit ID.
A National Insurance number, a tax year that ended, and benefit ID must be provided.
Authorisation
This endpoint is
user-restricted
and requires an Authorization
header containing an OAuth 2.0 Bearer Token with the read:self-assessment
scope.
Path parameters
Name | Description |
---|---|
nino
string
required
|
National Insurance number, in the format AA999999A.
For example: |
taxYear
string
required
|
The tax year the data applies to, for example, 2020-21. The start year and end year must not span two tax years. The minimum tax year is 2020-21. No gaps are allowed, for example, 2020-22 is not valid. (The minimum tax year in Sandbox is 2019-20.)
For example: |
Query parameters
Name | Description |
---|---|
benefitId
string
optional
|
Unique identifier of the benefit. Must conform to the regular expression
For example: |
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. For example: application/vnd.hmrc.1.0+json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. For example: -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the read:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention.
Response
HTTP status: 200 (OK)
{ "stateBenefits":[ { "benefitType":"incapacityBenefit", "dateIgnored":"2019-04-04T01:01:01Z", "benefitId":"9d51a3eb-e374-5349-aa02-96db92561138", "startDate":"2020-01-01", "endDate":"2020-04-01", "amount":34345.12, "taxPaid":345.34, "links":[ { "href":"/individuals/state-benefits/TC663795B/2020-21?benefitId=9d51a3eb-e374-5349-aa02-96db92561138", "method":"GET", "rel":"self" } ] }, { "benefitType":"otherStateBenefits", "benefitId":"9d51a3eb-e374-5349-aa02-96db92561124", "startDate":"2020-01-01", "endDate":"2020-10-29", "amount":512.56, "taxPaid":342.78, "links":[ { "href":"/individuals/state-benefits/TC663795B/2020-21?benefitId=9d51a3eb-e374-5349-aa02-96db92561124", "method":"GET", "rel":"self" } ] } ], "customerAddedStateBenefits":[ { "benefitType":"statePensionLumpSum", "submittedOn":"2019-04-04T01:01:01Z", "benefitId":"cf87eb89-3d07-1496-89da-cf16d45c934b", "startDate":"2019-11-01", "amount":203.90, "taxPaid":112.12, "links":[ { "href":"/individuals/state-benefits/TC663795B/2020-21?benefitId=cf87eb89-3d07-1496-89da-cf16d45c934b", "method":"GET", "rel":"self" } ] } ], "links":[ { "href":"individuals/state-benefits/TC663795B/2020-21", "rel":"self", "method":"GET" }, { "href":"individuals/state-benefits/TC663795B/2020-21", "rel":"create-state-benefit", "method":"POST" } ] }
{ "stateBenefits":[ { "benefitType":"statePensionLumpSum", "benefitId":"e4bf331e-0e55-297f-9a74-c766674775d4", "startDate":"2019-09-01", "endDate":"2019-09-02", "amount":345.55, "taxPaid":78.88, "links":[ { "href":"individuals/state-benefits/TC663795B/2020-21?benefitId={benefitId}", "rel":"self", "method":"GET" }, { "href":"individuals/state-benefits/TC663795B/2020-21/{benefitId}/ignore", "rel":"ignore-state-benefit", "method":"PUT" }, { "href":"individuals/state-benefits/TC663795B/2020-21/{benefitId}/amounts", "rel":"amend-state-benefit-amounts", "method":"PUT" }, { "href":"individuals/state-benefits/TC663795B/2020-21/{benefitId}/amounts", "rel":"delete-state-benefit-amounts", "method":"DELETE" } ] } ], "links":[ { "href":"individuals/state-benefits/TC663795B/2020-21", "rel":"self", "method":"GET" }, { "href":"individuals/state-benefits/TC663795B/2020-21", "rel":"create-state-benefit", "method":"POST" } ] }
Name | Description |
---|---|
stateBenefits
array
optional
|
|
benefitType
string
required
|
The type of benefit claimed. Limited to the following possible values: incapacityBenefit
statePension
statePensionLumpSum
employmentSupportAllowance
jobSeekersAllowance
bereavementAllowance
otherStateBenefits
|
dateIgnored
string
optional
|
An ISO-8601 compliant date-time representing when the customer requested the data to be ignored.
For example: |
submittedOn
string
optional
|
An ISO-8601 compliant date-time representing when incapacity benefit was submitted.
For example: |
benefitId
string
required
|
Unique identifier of the benefit.
Must conform to the regular expression |
startDate
string
required
|
The date the benefit started in the format YYYY-MM-DD.
For example: |
endDate
string
optional
|
The date the benefit ended in the format YYYY-MM-DD.
For example: |
amount
number
optional
|
The total amount of benefit received. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
taxPaid
number
optional
|
The amount of tax paid on the benefit. The value must be between -99999999999.99 and 99999999999.99 up to 2 decimal places. Only employmentSupportAllowance and jobSeekersAllowance will return negative values.
For example: |
links
array
optional
|
A list of endpoint links that indicate possible actions related to the current resource. |
href
string
required
|
The relative url of the endpoint
For example: |
rel
string
required
|
A label for the endpoint, which describes how it is related to the current resource. The rel will be self where the action is retrieval of the same resource. Limited to the following possible values: self
ignore-state-benefit
amend-state-benefit-amounts
delete-state-benefit-amounts
|
method
string
required
|
The HTTP method type for the endpoint. Limited to the following possible values: GET
PUT
DELETE
|
customerAddedStateBenefits
array
optional
|
|
benefitType
string
required
|
The type of benefit claimed. Limited to the following possible values: incapacityBenefit
statePension
statePensionLumpSum
employmentSupportAllowance
jobSeekersAllowance
bereavementAllowance
otherStateBenefits
|
submittedOn
string
optional
|
An ISO-8601 compliant date-time representing when incapacity benefit was submitted.
For example: |
benefitId
string
required
|
Unique identifier of the benefit.
Must conform to the regular expression |
startDate
string
required
|
The date the benefit started in the format YYYY-MM-DD.
For example: |
endDate
string
optional
|
The date the benefit ended in the format YYYY-MM-DD.
For example: |
amount
number
optional
|
The total amount of benefit received. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
taxPaid
number
optional
|
The amount of tax paid on the benefit. The value must be between -99999999999.99 and 99999999999.99 up to 2 decimal places. Only employmentSupportAllowance and jobSeekersAllowance will return negative values.
For example: |
links
array
optional
|
A list of endpoint links that indicate possible actions related to the current resource. |
href
string
required
|
The relative url of the endpoint
For example: |
rel
string
required
|
A label for the endpoint, which describes how it is related to the current resource. The rel will be self where the action is retrieval of the same resource. Limited to the following possible values: self
amend-state-benefit
delete-state-benefit
amend-state-benefit-amounts
delete-state-benefit-amounts
|
method
string
required
|
The HTTP method type for the endpoint. Limited to the following possible values: GET
PUT
DELETE
|
links
array
required
|
A list of endpoint links that indicate possible actions related to the current resource. |
href
string
required
|
The relative url of the endpoint
For example: |
rel
string
required
|
A label for the endpoint, which describes how it is related to the current resource. The rel will be self where the action is retrieval of the same resource. Limited to the following possible values: self
create-state-benefit
|
method
string
required
|
The HTTP method type for the endpoint. Limited to the following possible values: GET
POST
|
Error scenarios
Scenario | HTTP status | Code |
---|---|---|
The format of the supplied NINO field is not valid. |
400 (Bad Request) |
FORMAT_NINO |
The format of the supplied tax year field is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The format of the supplied benefit ID field is not valid. |
400 (Bad Request) |
FORMAT_BENEFIT_ID |
Tax year range invalid. A tax year range of one year is required. |
400 (Bad Request) |
RULE_TAX_YEAR_RANGE_INVALID |
The specified tax year is not supported. That is, the tax year specified is before the minimum tax year value. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_SUPPORTED |
The client or agent is not authorised. This is because: the client is not subscribed to MTD, the agent is not subscribed to Agent Services, or the client has not authorised the agent to act on their behalf. |
403 (Forbidden) |
CLIENT_OR_AGENT_NOT_AUTHORISED |
The supplied income source could not be found. |
404 (Not Found) |
MATCHING_RESOURCE_NOT_FOUND |
For error scenarios that are common across all APIs, and for error formats, see our reference guide.
Test data
Scenario simulations using Gov-Test-Scenario headers is only available in the sandbox environment.
Header Value (Gov-Test-Scenario) | Scenario |
---|---|
N/A - DEFAULT |
Simulates a list of all state benefit types. |
N/A - DEFAULT |
Simulates a single HMRC held state benefit. |
HMRC_AMENDED_AMOUNTS |
Simulates the response where a HMRC held state benefit amounts have been amended. |
NOT_FOUND |
Simulates the scenario where no data is found. |
This endpoint allows a developer to create any state benefits they believe are missing. A National Insurance number, tax year, benefit type and start date must be provided.
This endpoint can only be used for a tax year that has ended.
Authorisation
This endpoint is
user-restricted
and requires an Authorization
header containing an OAuth 2.0 Bearer Token with the write:self-assessment
scope.
Path parameters
Name | Description |
---|---|
nino
string
required
|
National Insurance number, in the format AA999999A.
For example: |
taxYear
string
required
|
The tax year the data applies to, for example, 2020-21. The start year and end year must not span two tax years. The minimum tax year is 2020-21. No gaps are allowed, for example, 2020-22 is not valid. (The minimum tax year in Sandbox is 2019-20.)
For example: |
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. For example: application/vnd.hmrc.1.0+json
|
Content-Type
required
|
Specifies the format of the request body, which must be JSON. For example: application/json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. For example: -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the write:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Request
{ "benefitType": "incapacityBenefit", "startDate": "2020-08-03", "endDate": "2020-12-03" }
Name | Description |
---|---|
benefitType
string
required
|
The type of benefit claimed Limited to the following possible values: incapacityBenefit
statePension
statePensionLumpSum
employmentSupportAllowance
jobSeekersAllowance
bereavementAllowance
otherStateBenefits
|
startDate
string
required
|
The date the benefit started in the format YYYY-MM-DD
For example: |
endDate
string
optional
|
The date the benefit ended in the format YYYY-MM-DD
For example: |
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention.
Response
HTTP status: 200 (OK)
{ "benefitId": "a1e8057e-fbbc-47a8-a8b4-78d9f015c253", "links": [ { "href": "/individuals/state-benefits/TC663795B/2020-21?benefitId=a1e8057e-fbbc-47a8-a8b4-78d9f015c253", "rel": "self", "method": "GET" }, { "href": "/individuals/state-benefits/TC663795B/2020-21/a1e8057e-fbbc-47a8-a8b4-78d9f015c253", "rel": "amend-state-benefit", "method": "PUT" }, { "href": "/individuals/state-benefits/TC663795B/2020-21/a1e8057e-fbbc-47a8-a8b4-78d9f015c253", "rel": "delete-state-benefit", "method": "DELETE" } ] }
Name | Description |
---|---|
benefitId
string
required
|
Unique identifier of the benefit type
Must conform to the regular expression
For example: |
links
array
required
|
A list of endpoint links that indicate possible actions related to the current resource. |
href
string
required
|
The relative url of the endpoint.
For example: |
rel
string
required
|
A label for the endpoint, which describes how it is related to the current resource. The rel will be self where the action is retrieval of the same resource. Limited to the following possible values: self
amend-state-benefit
delete-state-benefit
|
method
string
required
|
The HTTP method type for the endpoint. Limited to the following possible values: GET
PUT
DELETE
|
Error scenarios
Scenario | HTTP status | Code |
---|---|---|
The format of the supplied NINO field is not valid. |
400 (Bad Request) |
FORMAT_NINO |
The format of the supplied tax year field is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The format of the supplied start date is not valid. |
400 (Bad Request) |
FORMAT_START_DATE |
The format of the supplied end date is not valid. |
400 (Bad Request) |
FORMAT_END_DATE |
The format or value of benefit type is not valid. |
400 (Bad Request) |
FORMAT_BENEFIT_TYPE |
Tax year range invalid. A tax year range of one year is required. |
400 (Bad Request) |
RULE_TAX_YEAR_RANGE_INVALID |
The specified tax year is not supported. That is, the tax year specified is before the minimum tax year value. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_SUPPORTED |
The submission has been made before the tax year it relates to has ended. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_ENDED |
The end date is earlier than the start date. |
400 (Bad Request) |
RULE_END_DATE_BEFORE_START_DATE |
The benefit is listed as starting after the tax year ended. |
400 (Bad Request) |
RULE_START_DATE_AFTER_TAX_YEAR_END |
The benefit is listed as ending before the tax year began. |
400 (Bad Request) |
RULE_END_DATE_BEFORE_TAX_YEAR_START |
An empty or non-matching body was submitted. |
400 (Bad Request) |
RULE_INCORRECT_OR_EMPTY_BODY_SUBMITTED |
The client or agent is not authorised. This is because: the client is not subscribed to MTD, the agent is not subscribed to Agent Services, or the client has not authorised the agent to act on their behalf. |
403 (Forbidden) |
CLIENT_OR_AGENT_NOT_AUTHORISED |
The supplied income source could not be found. |
404 (Not Found) |
MATCHING_RESOURCE_NOT_FOUND |
For error scenarios that are common across all APIs, and for error formats, see our reference guide.
Test data
Scenario simulations using Gov-Test-Scenario headers is only available in the sandbox environment.
Header Value (Gov-Test-Scenario) | Scenario |
---|---|
N/A - DEFAULT |
Simulates success response. |
NOT_FOUND |
Simulates the scenario where no data is found. |
/individuals/state-benefits/{nino}/{taxYear}/{benefitId}
This endpoint allows a developer to amend a previously created customer benefit, if the customer attempts to update a HMRC held benefit then this operation will fail with a forbidden response code. A National Insurance number, tax year and benefit ID must be provided.
This endpoint can only be used for a tax year that has ended.
Authorisation
This endpoint is
user-restricted
and requires an Authorization
header containing an OAuth 2.0 Bearer Token with the write:self-assessment
scope.
Path parameters
Name | Description |
---|---|
nino
string
required
|
National Insurance number, in the format AA999999A.
For example: |
taxYear
string
required
|
The tax year the data applies to, for example, 2020-21. The start year and end year must not span two tax years. The minimum tax year is 2020-21. No gaps are allowed, for example, 2020-22 is not valid. (The minimum tax year in Sandbox is 2019-20.)
For example: |
benefitId
string
required
|
Unique identifier of the benefit type. Must conform to the regular expression
For example: |
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. For example: application/vnd.hmrc.1.0+json
|
Content-Type
required
|
Specifies the format of the request body, which must be JSON. For example: application/json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. For example: -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the write:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Request
{ "startDate": "2020-08-03", "endDate": "2020-12-03" }
Name | Description |
---|---|
startDate
string
required
|
The date the benefit started in the format YYYY-MM-DD
For example: |
endDate
string
optional
|
The date the benefit ended in the format YYYY-MM-DD
For example: |
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention.
Response
HTTP status: 200 (OK)
{ "links": [ { "href": "/individuals/state-benefits/TC663795B/2020-21?benefitId=a1e8057e-fbbc-47a8-a8b4-78d9f015c253", "rel": "self", "method": "GET" }, { "href": "/individuals/state-benefits/TC663795B/2020-21/a1e8057e-fbbc-47a8-a8b4-78d9f015c253", "rel": "amend-state-benefit", "method": "PUT" }, { "href": "/individuals/state-benefits/TC663795B/2020-21/a1e8057e-fbbc-47a8-a8b4-78d9f015c253", "rel": "delete-state-benefit", "method": "DELETE" }, { "href": "/individuals/state-benefits/TC663795B/2020-21/a1e8057e-fbbc-47a8-a8b4-78d9f015c253/amounts", "rel": "amend-state-benefit-amounts", "method": "PUT" } ] }
Name | Description |
---|---|
links
array
required
|
A list of endpoint links that indicate possible actions related to the current resource. |
href
string
required
|
The relative url of the endpoint.
For example: |
rel
string
required
|
A label for the endpoint, which describes how it is related to the current resource. The rel will be self where the action is retrieval of the same resource. Limited to the following possible values: self
amend-state-benefit
delete-state-benefit
amend-state-benefit-amounts
|
method
string
required
|
The HTTP method type for the endpoint. Limited to the following possible values: GET
PUT
DELETE
|
Error scenarios
Scenario | HTTP status | Code |
---|---|---|
The format of the supplied NINO field is not valid. |
400 (Bad Request) |
FORMAT_NINO |
The format of the supplied tax year field is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The format of the supplied benefit ID field is not valid. |
400 (Bad Request) |
FORMAT_BENEFIT_ID |
The format of the supplied start date is not valid. |
400 (Bad Request) |
FORMAT_START_DATE |
The format of the supplied end date is not valid. |
400 (Bad Request) |
FORMAT_END_DATE |
Tax year range invalid. A tax year range of one year is required. |
400 (Bad Request) |
RULE_TAX_YEAR_RANGE_INVALID |
The specified tax year is not supported. That is, the tax year specified is before the minimum tax year value. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_SUPPORTED |
The submission has been made before the tax year it relates to has ended. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_ENDED |
The end date is earlier than the start date. |
400 (Bad Request) |
RULE_END_DATE_BEFORE_START_DATE |
The benefit is listed as starting after the tax year ended. |
400 (Bad Request) |
RULE_START_DATE_AFTER_TAX_YEAR_END |
The benefit is listed as ending before the tax year began. |
400 (Bad Request) |
RULE_END_DATE_BEFORE_TAX_YEAR_START |
An empty or non-matching body was submitted. |
400 (Bad Request) |
RULE_INCORRECT_OR_EMPTY_BODY_SUBMITTED |
An update for a HMRC held benefit is not permitted. |
403 (Forbidden) |
RULE_UPDATE_FORBIDDEN |
The client or agent is not authorised. This is because: the client is not subscribed to MTD, the agent is not subscribed to Agent Services, or the client has not authorised the agent to act on their behalf. |
403 (Forbidden) |
CLIENT_OR_AGENT_NOT_AUTHORISED |
The supplied income source could not be found. |
404 (Not Found) |
MATCHING_RESOURCE_NOT_FOUND |
For error scenarios that are common across all APIs, and for error formats, see our reference guide.
Test data
Scenario simulations using Gov-Test-Scenario headers is only available in the sandbox environment.
Header Value (Gov-Test-Scenario) | Scenario |
---|---|
N/A - DEFAULT |
Simulates success response. |
HMRC_HELD |
Simulates the scenario in which a benefit is HMRC held and therefore cannot be modified or deleted. |
NOT_FOUND |
Simulates the scenario where no data is found. |
This endpoint allows a developer to delete customer submitted state benefits. If the customer attempts to delete a HMRC held state benefit then the operation will fail with a forbidden response. A National Insurance number, tax year and benefit ID must be provided.
This endpoint can only be used for a tax year that has ended.
Authorisation
This endpoint is
user-restricted
and requires an Authorization
header containing an OAuth 2.0 Bearer Token with the write:self-assessment
scope.
Path parameters
Name | Description |
---|---|
nino
string
required
|
National Insurance number, in the format AA999999A.
For example: |
taxYear
string
required
|
The tax year the data applies to, for example, 2020-21. The start year and end year must not span two tax years. The minimum tax year is 2020-21. No gaps are allowed, for example, 2020-22 is not valid. (The minimum tax year in Sandbox is 2019-20.)
For example: |
benefitId
string
required
|
Unique identifier of the benefit type. Must conform to the regular expression
For example: |
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. For example: application/vnd.hmrc.1.0+json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. For example: -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the write:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: a1e8057e-fbbc-47a8-a8b4-78d9f015c253
|
See also fraud prevention.
Response
HTTP status: 204 (No Content)
Error scenarios
Scenario | HTTP status | Code |
---|---|---|
The format of the supplied NINO field is not valid. |
400 (Bad Request) |
FORMAT_NINO |
The format of the supplied tax year field is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The format of the supplied benefit ID field is not valid. |
400 (Bad Request) |
FORMAT_BENEFIT_ID |
The specified tax year is not supported. That is, the tax year specified is before the minimum tax year value. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_SUPPORTED |
Tax year range invalid. A tax year range of one year is required. |
400 (Bad Request) |
RULE_TAX_YEAR_RANGE_INVALID |
The client or agent is not authorised. This is because: the client is not subscribed to MTD, the agent is not subscribed to Agent Services, or the client has not authorised the agent to act on their behalf. |
403 (Forbidden) |
CLIENT_OR_AGENT_NOT_AUTHORISED |
A deletion for a HMRC held state benefit is not permitted. |
403 (Forbidden) |
RULE_DELETE_FORBIDDEN |
The supplied income source could not be found. |
404 (Not Found) |
MATCHING_RESOURCE_NOT_FOUND |
For error scenarios that are common across all APIs, and for error formats, see our reference guide.
Test data
Scenario simulations using Gov-Test-Scenario headers is only available in the sandbox environment.
Header Value (Gov-Test-Scenario) | Scenario |
---|---|
N/A - DEFAULT |
Simulates success response. |
HMRC_HELD |
Simulates the scenario in which a deletion of a HMRC held state benefit is not permitted. |
NOT_FOUND |
Simulates the scenario where no data is found. |
/individuals/state-benefits/{nino}/{taxYear}/{benefitId}/amounts
This endpoint allows a developer to create or amend state benefit amounts.
Where the benefit ID relates to a customer created state benefit, the amount values will updated.
Where the benefit ID relates a HMRC held benefit, this will result in a duplicate benefit being created within the customerAddedStateBenefits
array with the updated amount values. It will have the same benefit ID.
Where a duplicate benefit exists the benefit with the most recent submittedOndate
will be used - older values will be ignored.
A National Insurance number, a tax year, a benefit type and start date must be provided.
This endpoint can only be used within the current tax year for employmentSupportAllowance
and jobSeekersAllowance
benefit types.
Authorisation
This endpoint is
user-restricted
and requires an Authorization
header containing an OAuth 2.0 Bearer Token with the write:self-assessment
scope.
Path parameters
Name | Description |
---|---|
nino
string
required
|
National Insurance number, in the format AA999999A.
For example: |
taxYear
string
required
|
The tax year the data applies to, for example, 2020-21. The start year and end year must not span two tax years. The minimum tax year is 2020-21. No gaps are allowed, for example, 2020-22 is not valid. (The minimum tax year in Sandbox is 2019-20.)
For example: |
benefitId
string
required
|
Unique identifier of the benefit type. Must conform to the regular expression
For example: |
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. For example: application/vnd.hmrc.1.0+json
|
Content-Type
required
|
Specifies the format of the request body, which must be JSON. For example: application/json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. For example: -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the write:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Request
{ "amount": 400.56, "taxPaid": 824.98 }
Name | Description |
---|---|
amount
number
required
|
The total amount of the state benefit. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
taxPaid
number
optional
|
The amount of tax to be paid on state benefit. The value must be between -99999999999.99 and 99999999999.99 up to 2 decimal places.
For example: |
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention.
Response
HTTP status: 200 (OK)
{ "links": [ { "href": "/individuals/state-benefits/TC663795B/2020-21?benefitId=a1e8057e-fbbc-47a8-a8b4-78d9f015c253", "rel": "self", "method": "GET" }, { "href": "/individuals/state-benefits/TC663795B/2020-21/a1e8057e-fbbc-47a8-a8b4-78d9f015c253/amounts", "rel": "amend-state-benefit-amounts", "method": "PUT" }, { "href": "/individuals/state-benefits/TC663795B/2020-21/a1e8057e-fbbc-47a8-a8b4-78d9f015c253/amounts", "rel": "delete-state-benefit-amounts", "method": "DELETE" } ] }
Name | Description |
---|---|
links
array
required
|
A list of endpoint links that indicate possible actions related to the current resource. |
href
string
required
|
The relative url of the endpoint.
For example: |
rel
string
required
|
A label for the endpoint, which describes how it is related to the current resource. The rel will be self where the action is retrieval of the same resource. Limited to the following possible values: self
amend-state-benefit-amounts
delete-state-benefit-amounts
|
method
string
required
|
The HTTP method type for the endpoint. Limited to the following possible values: GET
PUT
DELETE
|
Error scenarios
Scenario | HTTP status | Code |
---|---|---|
The format of the supplied NINO field is not valid. |
400 (Bad Request) |
FORMAT_NINO |
The format of the supplied tax year field is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The format of the supplied benefit ID field is not valid. |
400 (Bad Request) |
FORMAT_BENEFIT_ID |
One or more values have been added with the incorrect format. |
400 (Bad Request) |
FORMAT_VALUE |
Tax year range invalid. A tax year range of one year is required. |
400 (Bad Request) |
RULE_TAX_YEAR_RANGE_INVALID |
The specified tax year is not supported. That is, the tax year specified is before the minimum tax year value. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_SUPPORTED |
The submission has been made before the tax year it relates to has ended. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_ENDED |
An empty or non-matching body was submitted. |
400 (Bad Request) |
RULE_INCORRECT_OR_EMPTY_BODY_SUBMITTED |
The client or agent is not authorised. This is because: the client is not subscribed to MTD, the agent is not subscribed to Agent Services, or the client has not authorised the agent to act on their behalf. |
403 (Forbidden) |
CLIENT_OR_AGENT_NOT_AUTHORISED |
The supplied income source could not be found. |
404 (Not Found) |
MATCHING_RESOURCE_NOT_FOUND |
For error scenarios that are common across all APIs, and for error formats, see our reference guide.
Test data
Scenario simulations using Gov-Test-Scenario headers is only available in the sandbox environment.
Header Value (Gov-Test-Scenario) | Scenario |
---|---|
N/A - DEFAULT |
Simulates success response. |
NOT_FOUND |
Simulates the scenario where no data is found. |
TAX_YEAR_NOT_ENDED |
Simulates the error returned when a benefit that is not employmentSupportAllowance or jobSeekersAllowance is amended in year. |
This endpoint allows a developer to delete state benefit amount values supplied by the customer. A National Insurance number, tax year and benefit ID must be provided.
Where the benefit ID relates to a HMRC held state benefit, any duplicate benefit with amended amounts will be removed from the customerAddedStateBenefits
array.
Where the benefit ID relates to a customer created state benefit, the amount values will be cleared, but the benefit will remain.
This endpoint can only be used within the current tax year for employmentSupportAllowance
and jobSeekersAllowance
benefit types.
Authorisation
This endpoint is
user-restricted
and requires an Authorization
header containing an OAuth 2.0 Bearer Token with the write:self-assessment
scope.
Path parameters
Name | Description |
---|---|
nino
string
required
|
National Insurance number, in the format AA999999A.
For example: |
taxYear
string
required
|
The tax year the data applies to, for example, 2020-21. The start year and end year must not span two tax years. The minimum tax year is 2020-21. No gaps are allowed, for example, 2020-22 is not valid. (The minimum tax year in Sandbox is 2019-20.)
For example: |
benefitId
string
required
|
Unique identifier of the benefit type. Must conform to the regular expression
For example: |
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. For example: application/vnd.hmrc.1.0+json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. For example: -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the write:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: a1e8057e-fbbc-47a8-a8b4-78d9f015c253
|
See also fraud prevention.
Response
HTTP status: 204 (No Content)
Error scenarios
Scenario | HTTP status | Code |
---|---|---|
The format of the supplied NINO field is not valid. |
400 (Bad Request) |
FORMAT_NINO |
The format of the supplied tax year field is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The format of the supplied benefit ID field is not valid. |
400 (Bad Request) |
FORMAT_BENEFIT_ID |
The specified tax year is not supported. That is, the tax year specified is before the minimum tax year value. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_SUPPORTED |
Tax year range invalid. A tax year range of one year is required. |
400 (Bad Request) |
RULE_TAX_YEAR_RANGE_INVALID |
The client or agent is not authorised. This is because: the client is not subscribed to MTD, the agent is not subscribed to Agent Services, or the client has not authorised the agent to act on their behalf. |
403 (Forbidden) |
CLIENT_OR_AGENT_NOT_AUTHORISED |
The supplied income source could not be found. |
404 (Not Found) |
MATCHING_RESOURCE_NOT_FOUND |
For error scenarios that are common across all APIs, and for error formats, see our reference guide.
Test data
Scenario simulations using Gov-Test-Scenario headers is only available in the sandbox environment.
Header Value (Gov-Test-Scenario) | Scenario |
---|---|
N/A - DEFAULT |
Simulates success response. |
NOT_FOUND |
Simulates the scenario where no data is found. |
/individuals/state-benefits/{nino}/{taxYear}/{benefitId}/ignore
This endpoint allows a customer to mark a state benefit as ignored, customer added state benefits can’t be ignored they can only be deleted.
Ignoring a HMRC state benefit will also ignore a duplicate benefit containing amended amounts, if one exists.
A National Insurance number, tax year and benefit ID must be provided.
This endpoint can only be used for a tax year that has ended.
Authorisation
This endpoint is
user-restricted
and requires an Authorization
header containing an OAuth 2.0 Bearer Token with the write:self-assessment
scope.
Path parameters
Name | Description |
---|---|
nino
string
required
|
National Insurance number, in the format AA999999A.
For example: |
taxYear
string
required
|
The tax year the data applies to, for example, 2020-21. The start year and end year must not span two tax years. The minimum tax year is 2020-21. No gaps are allowed, for example, 2020-22 is not valid. (The minimum tax year in Sandbox is 2019-20.)
For example: |
benefitId
string
required
|
Unique identifier of the benefit type. Must conform to the regular expression
For example: |
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. For example: application/vnd.hmrc.1.0+json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. For example: -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the write:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: a1e8057e-fbbc-47a8-a8b4-78d9f015c253
|
See also fraud prevention.
Response
HTTP status: 200 (OK)
{ "links": [ { "href": "/individuals/state-benefits/TC663795B/2020-21?benefitId=a1e8057e-fbbc-47a8-a8b4-78d9f015c253", "rel": "self", "method": "GET" }, { "href": "/individuals/state-benefits/TC663795B/2020-21/a1e8057e-fbbc-47a8-a8b4-78d9f015c253/unignore", "rel": "unignore-state-benefit", "method": "POST" } ] }
Name | Description |
---|---|
links
array
required
|
A list of endpoint links that indicate possible actions related to the current resource. |
href
string
required
|
The relative url of the endpoint.
For example: |
rel
string
required
|
A label for the endpoint, which describes how it is related to the current resource. The rel will be self where the action is retrieval of the same resource. Limited to the following possible values: self
unignore-state-benefit
|
method
string
required
|
The HTTP method type for the endpoint. Limited to the following possible values: GET
POST
|
Error scenarios
Scenario | HTTP status | Code |
---|---|---|
The format of the supplied NINO field is not valid. |
400 (Bad Request) |
FORMAT_NINO |
The format of the supplied tax year field is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The format of the supplied benefit ID field is not valid. |
400 (Bad Request) |
FORMAT_BENEFIT_ID |
Tax year range invalid. A tax year range of one year is required. |
400 (Bad Request) |
RULE_TAX_YEAR_RANGE_INVALID |
The specified tax year is not supported. That is, the tax year specified is before the minimum tax year value. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_SUPPORTED |
The submission has been made before the tax year it relates to has ended. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_ENDED |
A customer added state benefit cannot be ignored. |
403 (Forbidden) |
RULE_IGNORE_FORBIDDEN |
The client or agent is not authorised. This is because: the client is not subscribed to MTD, the agent is not subscribed to Agent Services, or the client has not authorised the agent to act on their behalf. |
403 (Forbidden) |
CLIENT_OR_AGENT_NOT_AUTHORISED |
The supplied income source could not be found. |
404 (Not Found) |
MATCHING_RESOURCE_NOT_FOUND |
For error scenarios that are common across all APIs, and for error formats, see our reference guide.
Test data
Scenario simulations using Gov-Test-Scenario headers is only available in the sandbox environment.
Header Value (Gov-Test-Scenario) | Scenario |
---|---|
N/A - DEFAULT |
Simulates success response. |
CUSTOMER_ADDED |
Simulates the scenario in which a benefit is customer added and therefore cannot be ignored. |
NOT_FOUND |
Simulates the scenario where no data is found. |
/individuals/state-benefits/{nino}/{taxYear}/{benefitId}/unignore
This endpoint allows a customer to mark a State Benefit as unignored, customer added benefits can’t be unignored they can only be deleted. A National Insurance number, tax year and benefit ID must be provided.
Authorisation
This endpoint is
user-restricted
and requires an Authorization
header containing an OAuth 2.0 Bearer Token with the write:self-assessment
scope.
Path parameters
Name | Description |
---|---|
nino
string
required
|
National Insurance number, in the format AA999999A.
For example: |
taxYear
string
required
|
The tax year the data applies to, for example, 2020-21. The start year and end year must not span two tax years. The minimum tax year is 2020-21. No gaps are allowed, for example, 2020-22 is not valid. (The minimum tax year in Sandbox is 2019-20.)
For example: |
benefitId
string
required
|
Unique identifier of the benefit type. Must conform to the regular expression
For example: |
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. For example: application/vnd.hmrc.1.0+json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. For example: -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the write:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: a1e8057e-fbbc-47a8-a8b4-78d9f015c253
|
See also fraud prevention.
Response
HTTP status: 200 (OK)
{ "links": [ { "href": "/individuals/state-benefits/TC663795B/2020-21?benefitId=a1e8057e-fbbc-47a8-a8b4-78d9f015c253", "rel": "self", "method": "GET" }, { "href": "/individuals/state-benefits/TC663795B/2020-21/a1e8057e-fbbc-47a8-a8b4-78d9f015c253/ignore", "rel": "ignore-state-benefit", "method": "POST" } ] }
Name | Description |
---|---|
links
array
required
|
A list of endpoint links that indicate possible actions related to the current resource. |
href
string
required
|
The relative url of the endpoint.
For example: |
rel
string
required
|
A label for the endpoint, which describes how it is related to the current resource. The rel will be self where the action is retrieval of the same resource. Limited to the following possible values: self
ignore-state-benefit
|
method
string
required
|
The HTTP method type for the endpoint. Limited to the following possible values: GET
POST
|
Error scenarios
Scenario | HTTP status | Code |
---|---|---|
The format of the supplied NINO field is not valid. |
400 (Bad Request) |
FORMAT_NINO |
The format of the supplied tax year field is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The format of the supplied benefit ID field is not valid. |
400 (Bad Request) |
FORMAT_BENEFIT_ID |
Tax year range invalid. A tax year range of one year is required. |
400 (Bad Request) |
RULE_TAX_YEAR_RANGE_INVALID |
The specified tax year is not supported. That is, the tax year specified is before the minimum tax year value. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_SUPPORTED |
The submission has been made before the tax year it relates to has ended. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_ENDED |
A customer added state benefit cannot be unignored. |
403 (Forbidden) |
RULE_UNIGNORE_FORBIDDEN |
The client or agent is not authorised. This is because: the client is not subscribed to MTD, the agent is not subscribed to Agent Services, or the client has not authorised the agent to act on their behalf. |
403 (Forbidden) |
CLIENT_OR_AGENT_NOT_AUTHORISED |
The supplied income source could not be found. |
404 (Not Found) |
MATCHING_RESOURCE_NOT_FOUND |
For error scenarios that are common across all APIs, and for error formats, see our reference guide.
Test data
Scenario simulations using Gov-Test-Scenario headers is only available in the sandbox environment.
Header Value (Gov-Test-Scenario) | Scenario |
---|---|
N/A - DEFAULT |
Simulates success response. |
UNIGNORE_FORBIDDEN |
Simulates the scenario in which a benefit is customer added and therefore cannot be unignored. |
NOT_FOUND |
Simulates the scenario where no data is found. |