This version is in beta - expect some breaking changes.
Individual Losses (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 API allows software packages to show and provide a taxpayers’ financial data for their Brought Forward Losses and Loss Claims. For Brought forward losses a developer can:
- provide a list of brought forward losses
- create a new brought forward loss
- show a single brought forward loss
- delete an existing brought forward loss
- update an existing brought forward loss
For Loss claims a developer can:
- provide a list of loss claims
- create a loss claim against an income source for a specific tax year
- show the detail of an existing loss claim
- delete a previously entered loss claim
- update a previously entered loss claim
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"
}
]
}
Changelog
You can find the changelog in the individual-losses-api GitHub wiki.
Support
- Raise non-technical or platform-related issues with the Software Development Support Team (SDST).
- Raise technical issues on the individual-losses-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
Brought Forward Losses
These resources allow software packages to provide a taxpayers' financial data for their brought forward losses. Here the developer can:
- provide a list of brought forward losses
- create a new brought forward loss to submitted against Self-employment, Self-employment Class 4, UK Furnished Holiday Let (FHL) property, UK other (Non-FHL) property, Foreign property FHL in the European Economic Area (EEA) and Foreign property for the tax year prior to joining MTD
- show a single brought forward loss
- delete an existing brought forward loss
- update an existing brought forward loss
Brought Forward Losses resources
/individuals/losses/{nino}/brought-forward-losses
This endpoint allows a developer to retrieve a list of all brought forward losses that have incurred before joining MTD. A National Insurance number is required.
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: |
Query parameters
Name | Description |
---|---|
taxYear
string
optional
|
The tax year the data applies to, for example, 2018-19. The start year and end year must not span two tax years. No gaps are allowed, for example, 2018-20 is not valid. The minimum tax year is 2018-19.
For example: |
typeOfLoss
string
optional
|
The type of business the loss applies to. Limited to the following possible values:
|
businessId
string
optional
|
The unique identifier of the income source the claim relates to. 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.2.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 for other request headers which will become mandatory.
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention for other request headers which will become mandatory.
Response
HTTP status: 200 (OK)
{ "losses": [ { "id": "000000123456789", "links": [ { "href": "/individuals/losses/TC663795B/brought-forward-losses/000000123456789", "rel": "self", "method": "GET" } ] }, { "id": "000000123456790", "links": [ { "href": "/individuals/losses/TC663795B/brought-forward-losses/000000123456790", "rel": "self", "method": "GET" } ] } ], "links": [ { "href": "/individuals/losses/TC663795B/brought-forward-losses", "rel": "create-brought-forward-loss", "method": "POST" }, { "href": "/individuals/losses/TC663795B/brought-forward-losses", "rel": "self", "method": "GET" } ] }
Name | Description |
---|---|
losses
array
required
|
Array of losses |
id
string
required
|
The unique identifier of the loss
Must conform to the regular expression
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
|
method
string
required
|
The HTTP method type for the endpoint Limited to the following possible values: GET
|
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
create-brought-forward-loss
|
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 is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The specified tax year is not supported, 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 |
A Business ID must be supplied for a self-employment or a foreign property business type. |
400 (Bad Request) |
RULE_BUSINESS_ID |
The format of the supplied Type of loss is not valid. |
400 (Bad Request) |
FORMAT_TYPE_OF_LOSS |
The format of the supplied Business ID is not valid. |
400 (Bad Request) |
FORMAT_BUSINESS_ID |
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 |
Matching resource not 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 containing 4 losses. |
SELF_EMPLOYMENT |
Simulates a list containing two self-employment losses. |
UK_PROPERTY_FHL |
Simulates a list containing a single UK FHL property loss. |
UK_PROPERTY_NON_FHL |
Simulates a list containing a single UK Non-FHL property loss. |
FOREIGN_PROPERTY |
Simulates a list containing a single Foreign Property Loss |
FOREIGN_PROPERTY_FHL_EEA |
Simulates a list containing a single Foreign-Property-FHL-EEA Loss |
NOT_FOUND |
Simulates the scenario where no data is found. |
This endpoint allows the developer to create a new brought forward loss which can be submitted against self-employment, self-employment class 4, UK Furnished Holiday Let (FHL) property, UK other (Non-FHL) property, foreign property FHL in the European Economic Area (EEA) and foreign property for the tax year prior to joining MTD.
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: |
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. For example: application/vnd.hmrc.2.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 for other request headers which will become mandatory.
Request
{ "typeOfLoss": "uk-property-fhl", "businessId": "XGIS00000001319", "lossAmount": 12345.67, "taxYear": "2018-19" }
Name | Description |
---|---|
typeOfLoss
string
required
|
The type of business the loss applies to. Limited to the following possible values: self-employment
self-employment-class4
uk-property-fhl
uk-property-non-fhl
foreign-property-fhl-eea
foreign-property
|
businessId
string
required
|
An identifier for the business, unique to the customer.
Must conform to the regular expression
For example: |
lossAmount
number
required
|
Brought Forward Loss amount related to the type of loss, specified. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
taxYear
string
required
|
The tax year the data applies to, for example, 2018-19. The start year and end year must not span two tax years. No gaps are allowed, for example, 2018-20 is not valid. The minimum tax year is 2018-19.
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 for other request headers which will become mandatory.
Response
HTTP status: 201 (Created)
{ "id": "1234568790ABCDE", "links": [ { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE", "rel": "self", "method": "GET" }, { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE", "rel": "delete-brought-forward-loss", "method": "DELETE" }, { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE/change-loss-amount", "rel": "amend-brought-forward-loss", "method": "POST" } ] }
Name | Description |
---|---|
id
string
required
|
The unique identifier of the loss
Must conform to the regular expression
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-brought-forward-loss
delete-brought-forward-loss
|
method
string
required
|
The HTTP method type for the endpoint Limited to the following possible values: GET
POST
DELETE
|
Error scenarios
Scenario | HTTP status | Code |
---|---|---|
The format of the supplied NINO field is not valid. |
400 (Bad Request) |
FORMAT_NINO |
An empty or non-matching body was submitted. |
400 (Bad Request) |
RULE_INCORRECT_OR_EMPTY_BODY_SUBMITTED |
The format of the supplied tax year is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The specified tax year is not supported, 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 |
A brought forward loss is entered before the end of the tax year in which it was generated. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_ENDED |
The format of the supplied Type of loss is not valid. |
400 (Bad Request) |
FORMAT_TYPE_OF_LOSS |
The format of the supplied Business ID is not valid. |
400 (Bad Request) |
FORMAT_BUSINESS_ID |
The format of the supplied Loss amount field is not valid. |
400 (Bad Request) |
FORMAT_LOSS_AMOUNT |
Amounts should be a positive number less than 99999999999.99 with up to 2 decimal places. |
400 (Bad Request) |
RULE_LOSS_AMOUNT |
A brought forward loss already exists for this income source. |
403 (Forbidden) |
RULE_DUPLICATE_SUBMISSION |
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 |
Matching resource not 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 |
Simulate success scenario |
DUPLICATE |
Simulates the scenario where a brought forward loss already exists for this income source |
NOT_FOUND |
Simulates the scenario where no data can be found |
TAX_YEAR_NOT_ENDED |
Simulates the scenario where a tax year for the current year is supplied |
/individuals/losses/{nino}/brought-forward-losses/{lossId}
This endpoint allows the developer to retrieve an existing brought forward loss amount. A National Insurance number and Loss ID are required.
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: |
lossId
string
required
|
A unique identifier for the brought forward loss.
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.2.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 for other request headers which will become mandatory.
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention for other request headers which will become mandatory.
Response
HTTP status: 200 (OK)
{ "typeOfLoss": "self-employment-class4", "businessId": "XGIS00000001319", "lossAmount": 12345.67, "taxYear": "2018-19", "lastModified": "2018-07-13T12:13:48.763Z", "links": [ { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE", "rel": "self", "method": "GET" }, { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE", "rel": "delete-brought-forward-loss", "method": "DELETE" }, { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE/change-loss-amount", "rel": "amend-brought-forward-loss", "method": "POST" } ] }
{ "typeOfLoss": "uk-property-fhl", "lossAmount": 12345.67, "taxYear": "2018-19", "lastModified": "2018-07-13T12:13:48.763Z", "links": [ { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE", "rel": "self", "method": "GET" }, { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE", "rel": "delete-brought-forward-loss", "method": "DELETE" }, { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE/change-loss-amount", "rel": "amend-brought-forward-loss", "method": "POST" } ] }
{ "taxYear": "2019-20", "typeOfLoss": "foreign-property-fhl-eea", "businessId": "XAIS12345678910", "lossAmount": 100.00, "lastModified": "2020-07-13T12:13:48.763Z", "links": [ { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE", "rel": "self", "method": "GET" }, { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE", "rel": "delete-brought-forward-loss", "method": "DELETE" }, { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE/change-loss-amount", "rel": "amend-brought-forward-loss", "method": "POST" } ] }
Name | Description |
---|---|
typeOfLoss
string
required
|
The type of business the loss applies to. Limited to the following possible values: self-employment
self-employment-class4
uk-property-fhl
uk-property-non-fhl
foreign-property-fhl-eea
foreign-property
|
businessId
string
optional
|
An identifier for the business, unique to the customer.
Must conform to the regular expression
For example: |
lossAmount
number
required
|
Brought forward loss amount related to the type of loss, specified. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
taxYear
string
required
|
The tax year the data applies to, for example, 2018-19. The start year and end year must not span two tax years. No gaps are allowed, for example, 2018-20 is not valid. The minimum tax year is 2018-19.
For example: |
lastModified
string
required
|
The timestamp when the entry was created or last modified.
Must conform to the regular expression
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-brought-forward-loss
delete-brought-forward-loss
|
method
string
required
|
The HTTP method type for the endpoint. Limited to the following possible values: GET
POST
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 Loss ID is not valid. |
400 (Bad Request) |
FORMAT_LOSS_ID |
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 |
Matching resource not 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 success response with a self-employment loss. |
SELF_EMPLOYMENT |
Simulates a success response with a self-employment loss. |
CLASS_4 |
Simulates a success response with a self-employment National Insurance Class 4 loss. |
UK_PROPERTY_FHL |
Simulates a success response with a UK FHL property loss. |
UK_PROPERTY_NON_FHL |
Simulates a success response with a UK Non-FHL property loss. |
FOREIGN_PROPERTY |
Simulates a success response with a Foreign property loss. |
FOREIGN_PROPERTY_FHL_EEA_LOSS |
Simulates a success response with a Foreign property FHL EEA loss. |
NOT_FOUND |
Simulates a scenario where no data is found. |
This endpoint allows users to delete an existing brought forward loss. The user should be aware that where a loss has been used as part of a successful crystallisation activity, deletion will be blocked and an error code will be returned. In such a case, the user can amend the loss amount to zero. If the user wants to delete any details, they need to create a new account for that business.
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: |
lossId
string
required
|
A unique identifier for the brought forward loss.
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.2.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 for other request headers which will become mandatory.
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention for other request headers which will become mandatory.
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 Loss ID is not valid. |
400 (Bad Request) |
FORMAT_LOSS_ID |
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 |
An existing brought forward loss cannot be deleted after it has been crystallised. The requested resource is locked. |
403 (Forbidden) |
RULE_DELETE_AFTER_CRYSTALLISATION |
Matching resource not 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 |
Simulate success scenario |
DELETE_AFTER_CRYSTALLISATION |
Simulates the scenario where the requested resource is locked. |
NOT_FOUND |
Simulates the scenario where no data is found. |
/individuals/losses/{nino}/brought-forward-losses/{lossId}/change-loss-amount
This endpoint allows the developer to update an existing brought forward loss amount. A National Insurance number and Loss ID are required.
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: |
lossId
string
required
|
A unique identifier for the brought forward loss.
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.2.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 for other request headers which will become mandatory.
Request
{ "lossAmount": 12345.67 }
Name | Description |
---|---|
lossAmount
number
required
|
Brought Forward Loss amount related to a Business. The value must be between 0 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 for other request headers which will become mandatory.
Response
HTTP status: 200 (OK)
{ "typeOfLoss": "self-employment-class4", "businessId": "XGIS00000001319", "lossAmount": 12345.67, "taxYear": "2018-19", "lastModified": "2018-07-13T12:13:48.763Z", "links": [ { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE", "rel": "self", "method": "GET" } ] }
{ "typeOfLoss": "uk-property-fhl", "lossAmount": 12345.67, "taxYear": "2018-19", "lastModified": "2018-07-13T12:13:48.763Z", "links": [ { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE", "rel": "self", "method": "GET" } ] }
{ "taxYear": "2018-19", "businessId": "XGIS00000001319", "typeOfLoss": "foreign-property", "lossAmount": 12345.67, "lastModified": "2018-07-13T12:13:48.763Z", "links": [ { "href": "/individuals/losses/TC663795B/brought-forward-losses/1234568790ABCDE", "rel": "self", "method": "GET" } ] }
Name | Description |
---|---|
typeOfLoss
string
required
|
The type of business the loss applies to. Limited to the following possible values: self-employment
self-employment-class4
uk-property-fhl
uk-property-non-fhl
foreign-property
foreign-property-fhl-eea
|
businessId
string
optional
|
An identifier for the business, unique to the customer.
Must conform to the regular expression
For example: |
lossAmount
number
required
|
Brought Forward Loss amount related to the type of loss, specified. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
taxYear
string
required
|
The tax year the data applies to, for example, 2018-19. The start year and end year must not span two tax years. No gaps are allowed, for example, 2018-20 is not valid. The minimum tax year is 2018-19.
For example: |
lastModified
string
required
|
The timestamp when the entry was created or last modified.
Must conform to the regular expression
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
|
method
string
required
|
The HTTP method type for the endpoint Limited to the following possible values: GET
|
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 Loss ID is not valid. |
400 (Bad Request) |
FORMAT_LOSS_ID |
The format of the supplied Loss amount field is not valid. |
400 (Bad Request) |
FORMAT_LOSS_AMOUNT |
Amounts should be a positive number less than 99999999999.99 with up to 2 decimal places. |
400 (Bad Request) |
RULE_LOSS_AMOUNT |
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 loss amount supplied is the same as the existing stored loss amount. |
403 (Forbidden) |
RULE_NO_CHANGE |
Matching resource not 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 success response with a self-employment loss. |
SELF_EMPLOYMENT |
Simulates a success response with a self-employment loss. |
CLASS_4 |
Simulates a success response with a self-employment National Insurance Class 4 loss. |
UK_PROPERTY_FHL |
Simulates a success response with a self-employment National Insurance Class 4
Simulates a success response with a UK FHL property loss. |
UK_PROPERTY_NON_FHL |
Simulates a success scenario with UK Non-FHL property loss. |
FOREIGN_PROPERTY |
Simulates a success response with a Foreign property loss. |
FOREIGN_PROPERTY_FHL_EEA |
Simulates a success response with a Foreign property FHL EEA loss. |
NOT_FOUND |
Simulates a scenario where no data is found. |
NO_CHANGE |
Simulates the scenario where loss amount supplied is the same as the existing stored loss amount. |
Loss Claims
These resources allow software packages to provide a taxpayers' financial data for their loss claims. Here the developer can:
- Provide a list of loss claims
- Create a Loss Claim against an income source for a specific tax year
- Show the detail of an existing loss claim
- Delete a previously entered loss claim
- Update a previously entered loss claim
Loss Claims resources
/individuals/losses/{nino}/loss-claims
This endpoint allows a developer to retrieve existing loss claims information. A National Insurance number is required.
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: |
Query parameters
Name | Description |
---|---|
taxYear
string
optional
|
The tax year the data applies to, for example, 2019-20. The start year and end year must not span two tax years. No gaps are allowed, for example, 2019-21 is not valid. The minimum tax year is 2019-20.
For example: |
typeOfLoss
string
optional
|
The type of business the loss applies to. Limited to the following possible values:
|
businessId
string
optional
|
The unique identifier of the income source the claim relates to. Must conform to the regular expression
For example: |
claimType
string
optional
|
[This query parameter is only available in Sandbox]
|
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. For example: application/vnd.hmrc.2.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 for other request headers which will become mandatory.
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention for other request headers which will become mandatory.
Response
HTTP status: 200 (OK)
{ "claims" : [ { "id": "1234568790ABCDE", "sequence": 1, "typeOfClaim": "carry-sideways", "links":[ { "href":"/individuals/losses/TC663795B/loss-claims/1234568790ABCDE", "rel":"self", "method":"GET" } ] }, { "id": "1234568790ABCDF", "typeOfClaim": "carry-forward", "links":[ { "href":"/individuals/losses/TC663795B/loss-claims/1234568790ABCDF", "rel":"self", "method":"GET" } ] } ], "links":[ { "href":"/individuals/losses/TC663795B/loss-claims", "rel":"self", "method":"GET" }, { "href":"/individuals/losses/TC663795B/loss-claims", "rel":"create-loss-claim", "method":"POST" }, { "href":"/individuals/losses/TC663795B/loss-claims/order", "rel":"amend-loss-claim-order", "method":"PUT" } ] }
Name | Description |
---|---|
claims
array
required
|
An array of loss claim objects. An empty array is not returned, if no loss claims exist for the supplied NINO, a MATCHING_RESOURCE_NOT_FOUND error is returned. |
id
string
required
|
The unique identifier of the loss claim
Must conform to the regular expression
For example: |
sequence
integer
optional
|
[This field is only available in Sandbox] A number used to order a loss, the value must be between 1 and 99
For example: |
typeOfClaim
string
required
|
The type of claim to be applied. A self employment or a foreign property loss claim can only be of type carry-forward or carry-sideways. Limited to the following possible values: carry-forward
carry-sideways
carry-sideways-fhl
carry-forward-to-carry-sideways
|
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
|
method
string
required
|
The HTTP method type for the endpoint Limited to the following possible values: GET
|
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
create-loss-claim
amend-loss-claim-order
|
method
string
required
|
The HTTP method type for the endpoint Limited to the following possible values: GET
POST
PUT
|
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 is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The specified tax year is not supported, 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 |
A Business ID must be supplied for a self-employment or a foreign property business type. |
400 (Bad Request) |
RULE_BUSINESS_ID |
The format of the supplied Type of loss is not valid. |
400 (Bad Request) |
FORMAT_TYPE_OF_LOSS |
The format of the supplied Business ID is not valid. |
400 (Bad Request) |
FORMAT_BUSINESS_ID |
[This error is only available in Sandbox] The format of the supplied claim type is not valid |
400 (Bad Request) |
FORMAT_CLAIM_TYPE |
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 |
Matching resource not 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 containing 4 loss claims. |
SELF_EMPLOYMENT |
Simulates a list containing 2 self-employment loss claims. |
UK_PROPERTY_NON_FHL |
Simulates a list containing 2 uk-property-non-fhl loss claims. |
FOREIGN_PROPERTY |
Simulates a list containing 2 foreign-property loss claims. |
CARRY_SIDEWAYS |
Simulates a list containing 2 carry-sideways loss claims. |
NOT_FOUND |
Simulates the scenario where no data is found. |
This endpoint allows a developer to create a Loss Claim against an income source for a specific tax year. Claims cannot be made until after the End of Period Statement. A National Insurance number is required.
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: |
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. For example: application/vnd.hmrc.2.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 for other request headers which will become mandatory.
Request
{ "typeOfLoss":"self-employment", "businessId": "XGIS00000001319", "typeOfClaim": "carry-forward", "taxYear": "2019-20" }
{ "typeOfLoss":"uk-property-non-fhl", "typeOfClaim": "carry-sideways", "taxYear": "2019-20" }
{ "typeOfLoss": "foreign-property", "businessId": "X2IS12356589871", "typeOfClaim": "carry-forward", "taxYear": "2019-20" }
Name | Description |
---|---|
typeOfLoss
string
required
|
The type of business the loss applies to. Limited to the following possible values: self-employment
uk-property-non-fhl
foreign-property
|
businessId
string
optional
|
The unique identifier of the income source the claim relates to. Must be provided for self-employment and foreign-property businesses.
Must conform to the regular expression
For example: |
typeOfClaim
string
required
|
The type of claim to be applied. Note that carry-sideways-fhl and carry-forward-to-carry-sideways are only permitted when the type of loss is set to uk-property-non-fhl. Limited to the following possible values: carry-forward
carry-sideways
carry-sideways-fhl
carry-forward-to-carry-sideways
|
taxYear
string
required
|
The tax year the data applies to, for example, 2019-20. The start year and end year must not span two tax years. No gaps are allowed, for example, 2019-21 is not valid. The minimum tax year is 2019-20.
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 for other request headers which will become mandatory.
Response
HTTP status: 201 (Created)
{ "id": "1234568790ABCDE", "links":[ { "href":"/individuals/losses/TC663795B/loss-claims/1234568790ABCDE", "rel":"self", "method":"GET" }, { "href":"/individuals/losses/TC663795B/loss-claims/1234568790ABCDE", "rel":"delete-loss-claim", "method":"DELETE" }, { "href":"/individuals/losses/TC663795B/loss-claims/1234568790ABCDE/change-type-of-claim", "rel":"amend-loss-claim", "method":"POST" } ] }
Name | Description |
---|---|
id
string
required
|
ID reference to the newly created loss claim.
Must conform to the regular expression
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-loss-claim
delete-loss-claim
|
method
string
required
|
The HTTP method type for the endpoint. Limited to the following possible values: GET
POST
DELETE
|
Error scenarios
Scenario | HTTP status | Code |
---|---|---|
The format of the supplied NINO field is not valid. |
400 (Bad Request) |
FORMAT_NINO |
An empty or non-matching body was submitted. |
400 (Bad Request) |
RULE_INCORRECT_OR_EMPTY_BODY_SUBMITTED |
The format of the supplied Type of loss is not valid. |
400 (Bad Request) |
FORMAT_TYPE_OF_LOSS |
The format of the supplied Business ID is not valid. |
400 (Bad Request) |
FORMAT_BUSINESS_ID |
A Business ID must be supplied for a self-employment or a foreign property business type. |
400 (Bad Request) |
RULE_BUSINESS_ID |
The format of the Type of claim is not valid. |
400 (Bad Request) |
FORMAT_TYPE_OF_CLAIM |
The Type of claim supplied is not valid. |
400 (Bad Request) |
RULE_TYPE_OF_CLAIM_INVALID |
The format of the supplied tax year is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The specified tax year is not supported, 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 Loss claim has been made too soon. |
403 (Forbidden) |
RULE_PERIOD_NOT_ENDED |
The Type of claim is the same as a previous submission for this income source. |
403 (Forbidden) |
RULE_DUPLICATE_SUBMISSION |
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 |
There is no accounting period for the year of the claim. |
403 (Forbidden) |
RULE_NO_ACCOUNTING_PERIOD |
Matching resource not 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 success scenario |
DUPLICATE |
Simulates the scenario where a claim of the same type has already been made for this income source |
NOT_FOUND |
Simulates the scenario where the given income source could not be found |
PERIOD_NOT_ENDED |
Simulates the scenario where the loss claim has been made too soon |
NO_ACCOUNTING_PERIOD |
Simulates the scenario where there is no accounting period for the year of the claim |
/individuals/losses/{nino}/loss-claims/{claimId}
This endpoint allows a developer to retrieve the detail of an existing loss claim. A National Insurance number and Claim ID is required.
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: |
claimId
string
required
|
A unique identifier for the loss claim.
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.2.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 for other request headers which will become mandatory.
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention for other request headers which will become mandatory.
Response
HTTP status: 200 (OK)
{ "typeOfLoss":"self-employment", "businessId": "XGIS00000001319", "typeOfClaim": "carry-forward", "taxYear": "2019-20", "lastModified" : "2020-07-11T12:13:48.763Z", "links": [ { "href": "/individuals/losses/TC663795B/loss-claims/1234568790ABCDE", "rel": "self", "method": "GET" }, { "href": "/individuals/losses/TC663795B/loss-claims/1234568790ABCDE", "rel": "delete-loss-claim", "method": "DELETE" }, { "href": "/individuals/losses/TC663795B/loss-claims/1234568790ABCDE/change-type-of-claim", "rel": "amend-loss-claim", "method": "POST" } ] }
{ "typeOfLoss":"uk-property-non-fhl", "typeOfClaim": "carry-sideways", "taxYear": "2019-20", "lastModified" : "2020-07-11T12:15:34.734Z", "links": [ { "href": "/individuals/losses/TC663795B/loss-claims/1234568790ABCDE", "rel": "self", "method": "GET" }, { "href": "/individuals/losses/TC663795B/loss-claims/1234568790ABCDE", "rel": "delete-loss-claim", "method": "DELETE" }, { "href": "/individuals/losses/TC663795B/loss-claims/1234568790ABCDE/change-type-of-claim", "rel": "amend-loss-claim", "method": "POST" } ] }
{ "typeOfLoss":"foreign-property", "businessId": "XGIS00000001319", "typeOfClaim": "carry-forward", "taxYear": "2019-20", "lastModified" : "2020-07-11T12:13:48.763Z", "links": [ { "href": "/individuals/losses/TC663795B/loss-claims/1234568790ABCDE", "rel": "self", "method": "GET" }, { "href": "/individuals/losses/TC663795B/loss-claims/1234568790ABCDE", "rel": "delete-loss-claim", "method": "DELETE" }, { "href": "/individuals/losses/TC663795B/loss-claims/1234568790ABCDE/change-type-of-claim", "rel": "amend-loss-claim", "method": "POST" } ] }
Name | Description |
---|---|
typeOfLoss
string
required
|
The type of business the loss applies to. Limited to the following possible values: self-employment
uk-property-non-fhl
foreign-property
|
businessId
string
optional
|
The unique identifier of the income source the claim relates to. Must be provided for self-employment and foreign-property businesses.
Must conform to the regular expression
For example: |
typeOfClaim
string
required
|
The type of claim to be applied. Note that carry-sideways-fhl and carry-forward-to-carry-sideways are only permitted when the type of loss is set to uk-property-non-fhl. Limited to the following possible values: carry-forward
carry-sideways
carry-sideways-fhl
carry-forward-to-carry-sideways
|
taxYear
string
required
|
The tax year the data applies to, for example, 2019-20. The start year and end year must not span two tax years. No gaps are allowed, for example, 2019-21 is not valid. The minimum tax year is 2019-20.
For example: |
lastModified
string
required
|
The timestamp when the entry was created or last modified
Must conform to the regular expression
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-loss-claim
delete-loss-claim
|
method
string
required
|
The HTTP method type for the endpoint Limited to the following possible values: GET
POST
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 Claim ID is not valid. |
400 (Bad Request) |
FORMAT_CLAIM_ID |
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 |
Matching resource not 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 the successful retrieval of self-employment loss claim with carry-forward. |
SE_FORWARD |
Simulates the successful retrieval of self-employment loss claim with carry-forward. |
SE_SIDEWAYS |
Simulates the successful retrieval of self-employment loss claim with carry-sideways. |
FP_FORWARD |
Simulates the successful retrieval of foreign-property loss claim with carry-forward. |
FP_SIDEWAYS |
Simulates the successful retrieval of foreign-property loss claim with carry-sideways. |
NONFHL_FORWARD |
Simulates the successful retrieval of UK Non-FHL property loss claim with carry-forward. |
NONFHL_SIDEWAYS |
Simulates the successful retrieval of UK Non-FHL property loss claim with carry-sideways. |
NONFHL_SIDEWAYS_FHL |
Simulates the successful retrieval of UK Non-FHL property loss claim with carry-sideways-fhl. |
NONFHL_FORWARD_TO_SIDEWAYS |
Simulates the successful retrieval of UK Non-FHL property loss claim with carry-forward-to-carry-sideways. |
NOT_FOUND |
Simulates the scenario where no data is found. |
This endpoint allows the user to remove a previously entered loss claim.
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: |
claimId
string
required
|
A unique identifier for the loss claim.
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.2.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 for other request headers which will become mandatory.
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention for other request headers which will become mandatory.
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 Claim ID is not valid. |
400 (Bad Request) |
FORMAT_CLAIM_ID |
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 remote endpoint has indicated that no data can be found for the given claim ID |
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 |
Simulate success scenario |
NOT_FOUND |
Simulates the scenario where no data is found. |
/individuals/losses/{nino}/loss-claims/{claimId}/change-type-of-claim
This endpoint allows a developer to change the type of claim for an existing loss claim. A National Insurance Number and Claim ID are required.
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: |
claimId
string
required
|
A unique identifier for the loss claim.
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.2.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 for other request headers which will become mandatory.
Request
{ "typeOfClaim": "carry-forward" }
Name | Description |
---|---|
typeOfClaim
string
required
|
The type of claim to be applied. Note that carry-sideways-fhl and carry-forward-to-carry-sideways are only permitted when the type of loss is set to uk-property-non-fhl Limited to the following possible values: carry-forward
carry-sideways
carry-sideways-fhl
carry-forward-to-carry-sideways
|
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking For example: c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention for other request headers which will become mandatory.
Response
HTTP status: 200 (OK)
{ "typeOfLoss":"self-employment", "businessId": "XGIS00000001319", "typeOfClaim": "carry-forward", "taxYear": "2019-20", "lastModified" : "2020-07-11T12:13:48.763Z", "links": [ { "href": "/individuals/losses/TC663795B/loss-claims/1234568790ABCDE", "rel": "self", "method": "GET" } ] }
{ "typeOfLoss":"uk-property-non-fhl", "typeOfClaim": "carry-sideways", "taxYear": "2019-20", "lastModified" : "2020-07-11T12:15:34.734Z", "links": [ { "href": "/individuals/losses/TC663795B/loss-claims/1234568790ABCDE", "rel": "self", "method": "GET" } ] }
{ "typeOfLoss":"foreign-property", "businessId": "X2IS12356589871", "typeOfClaim": "carry-sideways", "taxYear": "2019-20", "lastModified" : "2020-07-11T12:13:48.763Z", "links": [ { "href": "/individuals/losses/TC663795B/loss-claims/1234568790ABCDE", "rel": "self", "method": "GET" } ] }
Name | Description |
---|---|
typeOfLoss
string
required
|
The type of business the loss applies to. Limited to the following possible values: self-employment
uk-property-non-fhl
foreign-property
|
businessId
string
optional
|
The unique identifier of the income source the claim relates to. Must be provided for self-employment and foreign-property businesses.
Must conform to the regular expression |
typeOfClaim
string
required
|
The type of claim to be applied. Note that carry-sideways-fhl, carry-forward-to-carry-sideways are only permitted when the type of loss is set to uk-property-non-fhl Limited to the following possible values: carry-forward
carry-sideways
carry-sideways-fhl
carry-forward-to-carry-sideways
|
taxYear
string
required
|
The tax year the data applies to, for example 2019 to 2020. The start year and end year must not span two tax years. Gaps are not allowed, for example 2018 to 2020 is not valid. The minimum tax year is 2019 to 2020.
Must conform to the regular expression |
lastModified
string
required
|
The timestamp when the entry was created or last modified.
Must conform to the regular expression |
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
|
method
string
required
|
The HTTP method type for the endpoint. Limited to the following possible values: GET
|
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 Claim ID is not valid. |
400 (Bad Request) |
FORMAT_CLAIM_ID |
The format of the Type of claim is not valid. |
400 (Bad Request) |
FORMAT_TYPE_OF_CLAIM |
An empty or non-matching body was submitted. |
400 (Bad Request) |
RULE_INCORRECT_OR_EMPTY_BODY_SUBMITTED |
The requested Type of claim is already active. |
403 (Forbidden) |
RULE_ALREADY_EXISTS |
The Type of claim supplied is not valid. |
403 (Forbidden) |
RULE_TYPE_OF_CLAIM_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 |
Matching resource not 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 success scenario |
SE_FORWARD |
Simulates a success scenario for self-employment loss claim with carry-forward. |
SE_SIDEWAYS |
Simulates a success scenario for self-employment loss claim with carry-sideways. |
NONFHL_FORWARD |
Simulates a success scenario for UK Non-FHL property loss claim with carry-forward. |
NONFHL_SIDEWAYS |
Simulates a success scenario for UK Non-FHL property loss claim with carry-sideways. |
NONFHL_SIDEWAYS_FHL |
Simulates a success scenario for UK Non-FHL property loss claim with carry-sideways-fhl. |
NONFHL_FORWARD_TO_SIDEWAYS |
Simulates a success scenario for UK Non-FHL property loss claim with carry-forward-to-carry-sideways. |
FP_FORWARD |
Simulates a success scenario for foreign-property loss claim with carry-forward. |
FP_SIDEWAYS |
Simulates a success scenario for foreign-property loss claim with carry-sideways. |
NOT_FOUND |
Simulates the scenario where no data is found. |
ALREADY_EXISTS |
Simulates the scenario where the back end detects that the requested type of claim is already active. |
INVALID_CLAIM_TYPE |
Simulates the scenario where the type of claim selected is not valid for the type of loss. |
/individuals/losses/{nino}/loss-claims/order
This endpoint allows the developer to change the sequence in which certain losses are used.
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: |
Query parameters
Name | Description |
---|---|
taxYear
string
optional
|
The tax year the data applies to, for example, 2019-20. The start year and end year must not span two tax years. No gaps are allowed, for example, 2019-21 is not valid. The minimum tax year 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.2.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 for other request headers which will become mandatory.
Request
{ "claimType": "carry-sideways", "listOfLossClaims": [ { "id": "1234567890ABCDE", "sequence":2 }, { "id": "1234567890ABDE0", "sequence":3 }, { "id": "1234567890ABEF1", "sequence":1 } ] }
Name | Description |
---|---|
claimType
string
required
|
The type of loss claims whose order is to be amended. Limited to the following possible values: carry-sideways
|
listOfLossClaims
array
required
|
A list of the claims to be amended - all of the claims for a given type and tax year must be included in the submission. |
id
string
required
|
The unique identifier for the loss claim must conform to the regular expression: ^[A-Za-z0-9]{15}$
For example: |
sequence
integer
required
|
The order number in which this loss claim is to be used it must be an integer from the range 1 to 99. The sequence can have no gaps and must begin with 1.
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 for other request headers which will become mandatory.
Response
HTTP status: 200 (OK)
{ "links":[ { "href":"/individuals/losses/TC663795B/loss-claims", "rel":"self", "method":"GET" }, { "href":"/individuals/losses/TC663795B/loss-claims/order", "rel":"amend-loss-claim-order", "method":"PUT" } ] }
Name | Description |
---|---|
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-loss-claim-order
|
method
string
required
|
The HTTP method type for the endpoint Limited to the following possible values: GET
PUT
|
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 is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The format of the supplied Claim ID is not valid. |
400 (Bad Request) |
FORMAT_CLAIM_ID |
The format of the supplied claim type is not valid |
400 (Bad Request) |
FORMAT_CLAIM_TYPE |
The format of the supplied sequence number is not valid. |
400 (Bad Request) |
FORMAT_SEQUENCE |
The sequence does not begin with 1. |
400 (Bad Request) |
RULE_INVALID_SEQUENCE_START |
The sequence is not continuous. |
400 (Bad Request) |
RULE_SEQUENCE_ORDER_BROKEN |
Not all of the loss claims of this type for this tax year were included in the submission. |
400 (Bad Request) |
RULE_LOSS_CLAIMS_MISSING |
An empty or non-matching body was submitted. |
400 (Bad Request) |
RULE_INCORRECT_OR_EMPTY_BODY_SUBMITTED |
The specified tax year is not supported, 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 remote endpoint has indicated that no data can be found for the given claim ID |
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 |
Simulate list containing 1 loss claim |
LOSS_CLAIMS_MISSING |
Simulate the scenario where one or more loss claim is missing |
NOT_FOUND |
Simulate the scenario where no data is found |