Individuals Expenses (MTD) API
Date | Amount |
---|---|
Version and status | |
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 developers to retrieve, amend and delete expenses for:
- income for trade union and patent royalties
- existing employment expenses
This API also allows developers to ignore HMRC provided employment expenses for a user.
For information on how to connect to this API see the Income Tax MTD end-to-end service guide.
Send fraud prevention data
HMRC monitors transactions to help protect your customers' confidential data from criminals and fraudsters.
Check the data you need to send. You can also use the Test API during initial development and as part of your quality assurance checks.
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 income-tax-mtd-changelog GitHub wiki.
Support
- Raise non-technical or platform-related issues with the Software Development Support Team (SDST).
- Raise technical issues on the income-tax-mtd-changelog 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
Other Expenses
Resources relating to an individual's other expenses
Other Expenses resources
/individuals/expenses/other/{nino}/{taxYear}
Retrieve Other Expenses
GET
This endpoint enables you to retrieve other expenses. A National Insurance number and tax year must be provided.
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, 2021-22. The start year and end year must not span two tax years. The minimum tax year is 2021-22. 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. application/vnd.hmrc.1.0+json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the read:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Responses
HTTP status 200 (OK)
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention.
Example response
{ "submittedOn": "2019-04-04T01:01:01Z", "paymentsToTradeUnionsForDeathBenefits": { "customerReference": "TRADE UNION PAYMENTS", "expenseAmount": 4528.99 }, "patentRoyaltiesPayments": { "customerReference": "ROYALTIES PAYMENTS", "expenseAmount": 3015.50 }, "links":[ { "href":"/individuals/expenses/other/TC663795B/2019-20", "method":"GET", "rel":"self" }, { "href":"/individuals/expenses/other/TC663795B/2019-20", "method":"PUT", "rel":"amend-expenses-other" }, { "href":"/individuals/expenses/other/TC663795B/2019-20", "method":"DELETE", "rel":"delete-expenses-other" } ] }
Name | Description |
---|---|
submittedOn
string
required
|
The date the expenses were added. It must be provided in the format YYYY-MM-DDThh:mm:ssZ
For example: |
paymentsToTradeUnionsForDeathBenefits
object
optional
|
Payments made to a Trade union or friendly society for death benefits. |
customerReference
string
optional
|
A reference the user supplies to identify the record.
For example: |
expenseAmount
number
required
|
The amount spent or cost incurred. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
patentRoyaltiesPayments
object
optional
|
Payments made by the licensee to the licensor for the use of the patent. They are usually a percentage of the revenue generated by the patent, although they can sometimes be agreed as a fixed fee. |
customerReference
string
optional
|
A reference the user supplies to identify the record.
For example: |
expenseAmount
number
required
|
The amount spent or cost incurred. The value must be between 0 and 99999999999.99 up to 2 decimal places.
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-expenses-other
delete-expenses-other
|
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 specified tax year is not supported. Either the tax year specified is before the minimum tax year value, or it is after the maximum 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 matching resource is 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 success response. |
NOT_FOUND |
Simulates the scenario where no data is found. |
Close Section
/individuals/expenses/other/{nino}/{taxYear}
Create and Amend Other Expenses
PUT
This endpoint enables you to create and amend other expenses. A National Insurance number and tax year must be provided.
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, 2021-22. The start year and end year must not span two tax years. The minimum tax year is 2021-22. 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. application/vnd.hmrc.1.0+json
|
Content-Type
required
|
Specifies the format of the request body, which must be JSON. application/json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the write:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Request
Scenario: Default Example
{ "paymentsToTradeUnionsForDeathBenefits": { "customerReference": "TRADE UNION PAYMENTS", "expenseAmount": 1223.22 }, "patentRoyaltiesPayments":{ "customerReference": "ROYALTIES PAYMENTS", "expenseAmount": 1223.22 } }
Name | Description |
---|---|
paymentsToTradeUnionsForDeathBenefits
object
optional
|
Payments made to a Trade union or friendly society for death benefits. |
customerReference
string
optional
|
A reference the user supplies to identify the record.
For example: |
expenseAmount
number
required
|
The amount spent or cost incurred. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
patentRoyaltiesPayments
object
optional
|
Payments made by the licensee to the licensor for the use of the patent. They are usually a percentage of the revenue generated by the patent, although they can sometimes be agreed as a fixed fee. |
customerReference
string
optional
|
A reference the user supplies to identify the record.
For example: |
expenseAmount
number
required
|
The amount spent or cost incurred. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
Responses
HTTP status 200 (OK)
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention.
Default Example
{ "links":[ { "href":"/individuals/expenses/other/TC663795B/2019-20", "method":"PUT", "rel":"amend-expenses-other" }, { "href":"/individuals/expenses/other/TC663795B/2019-20", "method":"GET", "rel":"self" }, { "href":"/individuals/expenses/other/TC663795B/2019-20", "method":"DELETE", "rel":"delete-expenses-other" } ] }
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-expenses-other
delete-expenses-other
|
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 specified tax year is not supported. Either the tax year specified is before the minimum tax year value, or it is after the maximum 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 |
One or more values have been added with the incorrect format. |
400 (Bad Request) |
FORMAT_VALUE |
An empty or non-matching body was submitted. |
400 (Bad Request) |
RULE_INCORRECT_OR_EMPTY_BODY_SUBMITTED |
The format of customer reference is not valid. |
400 (Bad Request) |
FORMAT_CUSTOMER_REFERENCE |
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 |
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 response. |
Close Section
/individuals/expenses/other/{nino}/{taxYear}
Delete Other Expenses
DELETE
This endpoint enables you to delete other expenses. A National Insurance number and tax year must be provided.
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, 2021-22. The start year and end year must not span two tax years. The minimum tax year is 2021-22. 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. application/vnd.hmrc.1.0+json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the write:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Responses
HTTP status 204 (No Content)
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention.
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 specified tax year is not supported. Either the tax year specified is before the minimum tax year value, or it is after the maximum 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 matching resource is 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 response. |
NOT_FOUND |
Simulates the scenario where the given expenses could not be found. |
Close Section
Employment Expenses
Resources relating to an individual's employment expenses
Employment Expenses resources
/individuals/expenses/employments/{nino}/{taxYear}
Retrieve Employment Expenses
GET
This endpoint enables you to retrieve existing employment expenses. A National Insurance number and tax year must be provided.
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, 2021-22. The start year and end year must not span two tax years. The minimum tax year is 2021-22. 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 |
---|---|
source
string
optional
|
Specifies the source of data to be returned. Defaults to “latest” if not provided, which combines the HMRC and user-provided overridden values. Limited to the following possible values:
|
Request headers
Name | Description |
---|---|
Accept
required
|
Specifies the response format and the version of the API to be used. application/vnd.hmrc.1.0+json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the read:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Responses
HTTP status 200 (OK)
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention.
Example user response
{ "submittedOn": "2020-12-12T12:12:12Z", "totalExpenses": 123.12, "source": "user", "dateIgnored": "2020-12-11T12:12:12Z", "expenses": { "businessTravelCosts": 123.12, "jobExpenses": 123.12, "flatRateJobExpenses": 123.12, "professionalSubscriptions": 123.12, "hotelAndMealExpenses": 123.12, "otherAndCapitalAllowances": 123.12, "vehicleExpenses": 123.12, "mileageAllowanceRelief": 123.12 }, "links": [ { "href":"/individuals/expenses/employments/TC663795B/2019-20", "method":"GET", "rel":"self" }, { "href":"/individuals/expenses/employments/TC663795B/2019-20", "method":"PUT", "rel":"amend-employment-expenses" }, { "href":"/individuals/expenses/employments/TC663795B/2019-20", "method":"DELETE", "rel":"delete-employment-expenses" } ] }
Example hmrcHeld response
{ "submittedOn": "2020-12-12T12:12:12Z", "totalExpenses": 123.12, "source": "hmrcHeld", "dateIgnored": "2020-12-11T12:12:12Z", "expenses": { "businessTravelCosts": 123.12, "jobExpenses": 123.12, "flatRateJobExpenses": 123.12, "professionalSubscriptions": 123.12, "hotelAndMealExpenses": 123.12, "otherAndCapitalAllowances": 123.12, "vehicleExpenses": 123.12, "mileageAllowanceRelief": 123.12 }, "links": [ { "href":"/individuals/expenses/employments/TC663795B/2019-20", "method":"GET", "rel":"self" }, { "href":"/individuals/expenses/employments/TC663795B/2019-20/ignore", "method":"POST", "rel":"ignore-employment-expenses" } ] }
Example latest response
{ "submittedOn": "2020-12-12T12:12:12Z", "totalExpenses": 123.12, "source": "latest", "dateIgnored": "2020-12-11T12:12:12Z", "expenses": { "businessTravelCosts": 123.12, "jobExpenses": 123.12, "flatRateJobExpenses": 123.12, "professionalSubscriptions": 123.12, "hotelAndMealExpenses": 123.12, "otherAndCapitalAllowances": 123.12, "vehicleExpenses": 123.12, "mileageAllowanceRelief": 123.12 }, "links": [ { "href":"/individuals/expenses/employments/TC663795B/2019-20", "method":"GET", "rel":"self" }, { "href":"/individuals/expenses/employments/TC663795B/2019-20", "method":"PUT", "rel":"amend-employment-expenses" }, { "href":"/individuals/expenses/employments/TC663795B/2019-20", "method":"DELETE", "rel":"delete-employment-expenses" }, { "href":"/individuals/expenses/employments/TC663795B/2019-20/ignore", "method":"POST", "rel":"ignore-employment-expenses" } ] }
Name | Description |
---|---|
submittedOn
string
optional
|
The date the expenses were submitted. Must conform to the format YYYY-MM-DDThh:mm:ssZ
For example: |
totalExpenses
number
optional
|
The sum of the expenses provided. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
source
string
optional
|
Specifies the source of data returned. "latest" combines the HMRC and user-provided overridden values. Limited to the following possible values: hmrcHeld
user
latest
|
dateIgnored
string
optional
|
The date the expenses were flagged not to be used in the tax calculation. Must conform to the format YYYY-MM-DDThh:mm:ssZ
For example: |
expenses
object
optional
|
Object containing the employment expenses. |
businessTravelCosts
number
optional
|
Expenses associated with business travel where own or company vehicle was not used. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
jobExpenses
number
optional
|
The actual expense of replacing or maintaining tools or special work clothes. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
flatRateJobExpenses
number
optional
|
Fixed rate expenses applied for replacing or maintaining tools or special work clothes. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
professionalSubscriptions
number
optional
|
Fees or subscriptions to professional bodies, required in order to undertake the employment. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
hotelAndMealExpenses
number
optional
|
Subsistence costs incurred with work. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
otherAndCapitalAllowances
number
optional
|
The expense from purchasing small items required for this employment. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
vehicleExpenses
number
optional
|
Fuel and other costs when using a company vehicle. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
mileageAllowanceRelief
number
optional
|
The shortfall incurred when the employer pays less than the approved mileage rate. The value must be between 0 and 99999999999.99 up to 2 decimal places.
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-employment-expenses
delete-employment-expenses
ignore-employment-expenses
|
method
string
required
|
The HTTP method type for the endpoint. Limited to the following possible values: GET
PUT
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 tax year field is not valid. |
400 (Bad Request) |
FORMAT_TAX_YEAR |
The format of the supplied Source field is not valid. |
400 (Bad Request) |
FORMAT_SOURCE |
The specified tax year is not supported. Either the tax year specified is before the minimum tax year value, or it is after the maximum 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 matching resource is 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 |
Requesting user source simulates success response with User provided financial details. |
N/A - DEFAULT |
Requesting hmrcHeld source simulates success response with HMRC held financial details. |
N/A - DEFAULT |
Requesting latest source simulates success response with Latest financial details submitted. |
NOT_FOUND |
Simulates the scenario where no data is found. |
Close Section
/individuals/expenses/employments/{nino}/{taxYear}
Create and Amend Employment Expenses
PUT
This endpoint enables you to add or update existing employment expenses. This endpoint can only be used after the tax year has ended. A National Insurance number and tax year are required.
Amending an expense will override the expense and remove the “dateIgnored” flag from HMRC-provided expenses.
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, 2021-22. The start year and end year must not span two tax years. The minimum tax year is 2021-22. 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. application/vnd.hmrc.1.0+json
|
Content-Type
required
|
Specifies the format of the request body, which must be JSON. application/json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the write:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Request
Scenario: Default Example
{ "expenses": { "businessTravelCosts": 1234.23, "jobExpenses": 1223.22, "flatRateJobExpenses": 1223.22, "professionalSubscriptions": 1223.22, "hotelAndMealExpenses": 1223.22, "otherAndCapitalAllowances": 1223.22, "vehicleExpenses": 1223.22, "mileageAllowanceRelief": 1223.22 } }
Name | Description |
---|---|
expenses
object
required
|
Object containing the employment expenses. |
businessTravelCosts
number
optional
|
Expenses associated with business travel. The value must be between 0 and 99999999999.99
For example: |
jobExpenses
number
optional
|
The actual expense of replacing or maintaining tools or special work clothes. The value must be between 0 and 99999999999.99
For example: |
flatRateJobExpenses
number
optional
|
Fixed rate expenses applied for replacing or maintaining tools or special work clothes. The value must be between 0 and 99999999999.99
For example: |
professionalSubscriptions
number
optional
|
Fees or subscriptions to professional bodies, required in order to undertake the employment. The value must be between 0 and 99999999999.99
For example: |
hotelAndMealExpenses
number
optional
|
Subsistence costs incurred with work. The value must be between 0 and 99999999999.99
For example: |
otherAndCapitalAllowances
number
optional
|
The expense from purchasing small items required for this employment. The value must be between 0 and 99999999999.99
For example: |
vehicleExpenses
number
optional
|
Vehicle expenses for using own car, van or motorcycle for business mileage occurred during work. The value must be between 0 and 99999999999.99
For example: |
mileageAllowanceRelief
number
optional
|
The shortfall incurred when the employer pays less than the approved mileage rate. The value must be between 0 and 99999999999.99
For example: |
Responses
HTTP status 200 (OK)
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention.
Default Example
{ "links":[ { "href":"/individuals/expenses/employments/TC663795B/2021-22", "method":"PUT", "rel":"amend-employment-expenses" }, { "href":"/individuals/expenses/employments/TC663795B/2021-22", "method":"GET", "rel":"self" }, { "href":"/individuals/expenses/employments/TC663795B/2021-22", "method":"DELETE", "rel":"delete-employment-expenses" } ] }
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-employment-expenses
delete-employment-expenses
|
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 |
One or more values have been added with the incorrect format. |
400 (Bad Request) |
FORMAT_VALUE |
An empty or non-matching body was submitted. |
400 (Bad Request) |
RULE_INCORRECT_OR_EMPTY_BODY_SUBMITTED |
The specified tax year is not supported. Either the tax year specified is before the minimum tax year value, or it is after the maximum 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 submission has been made before the Tax year it relates to has ended. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_ENDED |
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 |
Employments could not be found for the supplied NINO. |
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 a success response. |
NOT_FOUND |
Scenario to simulate not found error. |
Close Section
/individuals/expenses/employments/{nino}/{taxYear}
Delete Employment Expenses
DELETE
This endpoint allows a developer to delete employment expenses for a user and can only be used after the tax year has
ended.
Deleting an expense will remove the amended expense and remove the “dateIgnored” flag from HMRC expenses.
This endpoint requires a National Insurance number and tax year.
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, 2021-22. The start year and end year must not span two tax years. The minimum tax year is 2021-22. 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. application/vnd.hmrc.1.0+json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the write:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Responses
HTTP status 204 (No Content)
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention.
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 specified tax year is not supported. Either the tax year specified is before the minimum tax year value, or it is after the maximum 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 |
Simulate a success response. |
NOT_FOUND |
Simulates the scenario where the given expenses could not be found. |
Close Section
/individuals/expenses/employments/{nino}/{taxYear}/ignore
Ignore Employment Expenses
POST
This endpoint enables you to ignore HMRC-provided employment expenses for this user. This endpoint can only be used after the tax year has ended. A National Insurance number and tax year must be provided.
Ignoring an expense will remove any amended expenses and add the “dateIgnored” flag to HMRC-provided expenses.
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, 2021-22. The start year and end year must not span two tax years. The minimum tax year is 2021-22. 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. application/vnd.hmrc.1.0+json
|
Gov-Test-Scenario
optional
|
Only in sandbox environment. See Test Data table for all header values. -
|
Authorization
required
|
An
OAuth 2.0 Bearer Token
with the write:self-assessment scope.
For example: Bearer bb7fed3fe10dd235a2ccda3d50fb
|
See also fraud prevention.
Responses
HTTP status 200 (OK)
Response headers
Name | Description |
---|---|
X-CorrelationId
required
|
Unique ID for operation tracking c75f40a6-a3df-4429-a697-471eeec46435
|
See also fraud prevention.
Default Example
{ "links":[ { "href":"/individuals/expenses/employments/TC663795B/2021-22", "method":"GET", "rel":"self" }, { "href":"/individuals/expenses/employments/TC663795B/2021-22", "method":"DELETE", "rel":"delete-employment-expenses" } ] }
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
delete-employment-expenses
|
method
string
required
|
The HTTP method type for the endpoint Limited to the following possible values: GET
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 specified tax year is not supported. Either the tax year specified is before the minimum tax year value, or it is after the maximum 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 submission has been made before the Tax year it relates to has ended. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_ENDED |
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 expenses 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 success response. |
NOT_FOUND |
Scenario to simulate not found error. |
Close Section