Individuals Charges (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 provide financial data for a customer’s pension charges. Here a developer can:
- retrieve pension charges
- create and amend pension charges
- delete pension charges
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"
}
]
}
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
/individuals/charges/pensions/{nino}/{taxYear}
Retrieve Pension Charges
GET
This endpoint allows a developer to retrieve previously populated charges for pensions. 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.
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 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.
Retrieve Pension Charges
{ "pensionSavingsTaxCharges": { "isAnnualAllowanceReduced": true, "taperedAnnualAllowance": true, "moneyPurchasedAllowance": false, "pensionSchemeTaxReference": ["00123456RA", "00123456RA"], "lumpSumBenefitTakenInExcessOfLifetimeAllowance": { "amount":100, "taxPaid":100 } , "benefitInExcessOfLifetimeAllowance": { "amount":100, "taxPaid":100 } }, "pensionSchemeOverseasTransfers": { "overseasSchemeProvider": [ { "providerName": "Overseas Pensions Plc.", "providerAddress": "111 Main Street, Any Town, Any City", "providerCountryCode": "CYM", "qualifyingRecognisedOverseasPensionScheme": ["Q1234"] } ], "transferCharge": 100, "transferChargeTaxPaid": 100 }, "pensionSchemeUnauthorisedPayments": { "pensionSchemeTaxReference": ["00123456RA", "00123456RA"], "surcharge": { "amount": 100.99, "foreignTaxPaid": 100.99 }, "noSurcharge": { "amount": 100.99, "foreignTaxPaid": 100.99 } }, "pensionContributions": { "pensionSchemeTaxReference": ["00123456RA", "00123456RA"], "inExcessOfTheAnnualAllowance": 100, "annualAllowanceTaxPaid": 100 }, "overseasPensionContributions": { "overseasSchemeProvider": [ { "providerName": "Overseas Pensions Plc", "providerAddress": "111 Main Street, Any Town, Any City", "providerCountryCode": "CYM", "qualifyingRecognisedOverseasPensionScheme": [ "Q123456" ] } ], "shortServiceRefund": 123.0, "shortServiceRefundTaxPaid": 123.0 }, "links":[ { "href":"/individuals/charges/pensions/TC663795B/2021-22", "method":"GET", "rel":"self" }, { "href":"/individuals/charges/pensions/TC663795B/2021-22", "method":"PUT", "rel":"create-and-amend-charges-pensions" }, { "href":"/individuals/charges/pensions/TC663795B/2021-22", "method":"DELETE", "rel":"delete-charges-pensions" } ] }
Name | Description |
---|---|
pensionSavingsTaxCharges
object
optional
|
Object holding the booleans for annual allowance. |
isAnnualAllowanceReduced
boolean
optional
|
A boolean indicating whether annual allowance has been reduced. The value must be true or false.
For example: |
taperedAnnualAllowance
boolean
optional
|
A boolean indicating whether tapered annual allowance is lower than the standard annual allowance. The value must be true or false.
For example: |
moneyPurchasedAllowance
boolean
optional
|
A boolean indicating whether money purchased allowance has been paid. The value must be true or false.
For example: |
pensionSchemeTaxReference
array
required
|
A list of one or more unique references provided by HM Revenue and Customs (HMRC) when the scheme has been registered for tax relief and exemptions. It is 10 characters made up of 8 numbers followed by 2 letters.
For example: |
lumpSumBenefitTakenInExcessOfLifetimeAllowance
object
optional
|
Object holding the amount and tax paid on lump sum benefit in excess of the lifetime allowance. |
amount
number
required
|
The amount of the lump sum benefit taken in excess of the lifetime allowance. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
taxPaid
number
required
|
The amount of tax to be paid on the lump sum benefit taken in excess of the lifetime allowance. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
benefitInExcessOfLifetimeAllowance
object
optional
|
Object holding the amount and tax paid on benefit in excess of the lifetime allowance. |
amount
number
required
|
The amount of the benefit taken in excess of the lifetime allowance. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
taxPaid
number
required
|
The tax to be paid on the benefit taken in excess of the lifetime allowance. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
pensionSchemeOverseasTransfers
object
optional
|
Object holding the transfer of overseas pension to another pension scheme. |
overseasSchemeProvider
array
required
|
Details of overseas pension provider. |
providerName
string
required
|
The name of the pension provider
For example: |
providerAddress
string
required
|
The address of the pension provider.
For example: |
providerCountryCode
string
required
|
A three-letter code that represents a country name. The value must be a ISO 3166-1 alpha-3 code.
For example: |
qualifyingRecognisedOverseasPensionScheme
array
optional
|
A list of one or more qualifying overseas pension scheme reference numbers for overseas pensions contributions.
For example: |
transferCharge
number
required
|
The amount the pension provider charges to transfer the pension. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
transferChargeTaxPaid
number
required
|
The amount of tax paid on the transfer charge. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
pensionSchemeUnauthorisedPayments
object
optional
|
Object holding tax on unauthorised payment. |
pensionSchemeTaxReference
array
required
|
A list of one or more unique references provided by HM Revenue and Customs (HMRC) when the scheme has been registered for tax relief and exemptions. It is 10 characters made up of 8 numbers followed by 2 letters.
For example: |
surcharge
object
optional
|
The unauthorised payments surcharge. |
amount
number
required
|
The amount of the unauthorised payment. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
foreignTaxPaid
number
required
|
The amount of foreign tax paid in pounds sterling. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
noSurcharge
object
optional
|
Object holding unauthorised payments for no surcharge. |
amount
number
required
|
The amount of the unauthorised payment. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
foreignTaxPaid
number
required
|
The amount of foreign tax paid in pounds sterling. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
pensionContributions
object
optional
|
Object holding payments paid into a pension |
pensionSchemeTaxReference
array
required
|
A list of one or more unique references provided by HM Revenue and Customs (HMRC) when the scheme has been registered for tax relief and exemptions. It is 10 characters made up of 8 numbers followed by 2 letters.
For example: |
inExcessOfTheAnnualAllowance
number
required
|
The amount of the in excess of the annual allowance. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
annualAllowanceTaxPaid
number
required
|
The amount of tax paid on annual allowance. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
overseasPensionContributions
object
optional
|
Object holding the contributions paid into overseas pension. |
overseasSchemeProvider
array
required
|
Details of overseas pension provider. |
providerName
string
required
|
The name of the pension provider
For example: |
providerAddress
string
required
|
The address of the pension provider.
For example: |
providerCountryCode
string
required
|
A three-letter code that represents a country name. The value must be a ISO 3166-1 alpha-3 code.
For example: |
qualifyingRecognisedOverseasPensionScheme
array
optional
|
A list of one or more qualifying overseas pension scheme reference numbers for overseas pensions contributions.
For example: |
shortServiceRefund
number
required
|
The amount of short service refund for overseas pension contributions. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
shortServiceRefundTaxPaid
number
required
|
The amount of tax paid on short service refund. 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
create-and-amend-charges-pensions
delete-charges-pensions
|
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 |
Tax year range invalid. A tax year range of one year is required. |
400 (Bad Request) |
RULE_TAX_YEAR_RANGE_INVALID |
The specified tax year is not supported. That is, the tax year specified is before the minimum tax year value. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_SUPPORTED |
The client or agent is not authorised. This is because the client is not subscribed to MTD, the agent is not subscribed to Agent Services, or the client has not authorised the agent to act on their behalf. |
403 (Forbidden) |
CLIENT_OR_AGENT_NOT_AUTHORISED |
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 successful pension charge response. |
NOT_FOUND |
Simulates a scenario where no data can be found. |
Close Section
/individuals/charges/pensions/{nino}/{taxYear}
Create and Amend Pension Charges
PUT
This endpoint allows a developer to create and amend charges relating to pensions. 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.
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: Create and Amend Request from Vendors
{ "pensionSavingsTaxCharges": { "isAnnualAllowanceReduced": true, "taperedAnnualAllowance": true, "moneyPurchasedAllowance": true, "pensionSchemeTaxReference": ["00123456RA", "00123456RA"], "lumpSumBenefitTakenInExcessOfLifetimeAllowance": { "amount":100, "taxPaid":100 }, "benefitInExcessOfLifetimeAllowance": { "amount":100, "taxPaid":100 } }, "pensionSchemeOverseasTransfers": { "overseasSchemeProvider": [ { "providerName": "Overseas Pensions Plc", "providerAddress": "111 Main Street, George Town, Grand Cayman", "providerCountryCode": "CYM", "qualifyingRecognisedOverseasPensionScheme": [ "Q123456" ] } ], "transferCharge": 100, "transferChargeTaxPaid": 100 }, "pensionSchemeUnauthorisedPayments": { "pensionSchemeTaxReference": ["00123456RA", "00123456RA"], "surcharge": { "amount": 100, "foreignTaxPaid": 100 }, "noSurcharge": { "amount": 100, "foreignTaxPaid": 100 } }, "pensionContributions": { "pensionSchemeTaxReference": ["00123456RA", "00123456RA"], "inExcessOfTheAnnualAllowance": 100, "annualAllowanceTaxPaid": 100 }, "overseasPensionContributions": { "overseasSchemeProvider": [ { "providerName": "Overseas Pensions Plc", "providerAddress": "111 Main Street, George Town, Grand Cayman", "providerCountryCode": "CYM", "qualifyingRecognisedOverseasPensionScheme": [ "Q123456" ] } ], "shortServiceRefund": 123.0, "shortServiceRefundTaxPaid": 123.0 } }
Name | Description |
---|---|
pensionSavingsTaxCharges
object
optional
|
Object holding the booleans for annual allowance. |
isAnnualAllowanceReduced
boolean
required
|
A boolean indicating whether annual allowance has been reduced.If this field is set to true then taperedAnnualAllowance or moneyPurchasedAllowance must also be set to true.
For example: |
taperedAnnualAllowance
boolean
optional
|
A boolean indicating whether tapered annual allowance is lower than the standard annual allowance. The value must be true or false.
For example: |
moneyPurchasedAllowance
boolean
optional
|
A boolean indicating whether money purchased allowance has been paid. The value must be true or false.
For example: |
pensionSchemeTaxReference
array
required
|
A list of one or more unique references provided by HM Revenue and Customs (HMRC) when the scheme has been registered for tax relief and exemptions. It is 10 characters made up of 8 numbers followed by 2 letters.
For example: |
lumpSumBenefitTakenInExcessOfLifetimeAllowance
object
optional
|
Object holding the amount and tax paid on lump sum benefit in excess of the lifetime allowance. |
amount
number
required
|
The amount of the lump sum benefit taken in excess of the lifetime allowance. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
taxPaid
number
required
|
The amount of tax to be paid on the lump sum benefit taken in excess of the lifetime allowance. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
benefitInExcessOfLifetimeAllowance
object
optional
|
The amount and tax paid on benefit in excess of the lifetime allowance. |
amount
number
required
|
The amount of the benefit taken in excess of the lifetime allowance. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
taxPaid
number
required
|
The tax to be paid on the benefit taken in excess of the lifetime allowance. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
pensionSchemeOverseasTransfers
object
optional
|
Transfer of overseas pension to another pension scheme. |
overseasSchemeProvider
array
required
|
Details of overseas pension provider. |
providerName
string
required
|
The name of the pension provider.
For example: |
providerAddress
string
required
|
The address of the pension provider.
For example: |
providerCountryCode
string
required
|
A three-letter code that represents a country name. The value must be a ISO 3166-1 alpha-3 code.
For example: |
qualifyingRecognisedOverseasPensionScheme
array
optional
|
A list of one or more qualifying overseas pension scheme reference number for overseas pensions contributions.
For example: |
pensionSchemeTaxReference
array
optional
|
A list of one or more unique references provided by HM Revenue and Customs (HMRC) when the scheme has been registered for tax relief and exemptions. It is 10 characters made up of 8 numbers followed by 2 letters.
For example: |
transferCharge
number
required
|
The amount the pension provider charges to transfer the pension. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
transferChargeTaxPaid
number
required
|
The amount of tax paid on the transfer charge. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
pensionSchemeUnauthorisedPayments
object
optional
|
Tax on unauthorised payment. |
pensionSchemeTaxReference
array
required
|
A list of one or more unique references provided by HM Revenue and Customs (HMRC) when the scheme has been registered for tax relief and exemptions. It is 10 characters made up of 8 numbers followed by 2 letters.
For example: |
surcharge
object
optional
|
Object holding the unauthorised payments surcharge. |
amount
number
required
|
The amount of the unauthorised payment. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
foreignTaxPaid
number
required
|
The amount of foreign tax paid in pounds sterling. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
noSurcharge
object
optional
|
Object holding the unauthorised payments no surcharge. |
amount
number
required
|
The amount of the unauthorised payment. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
foreignTaxPaid
number
required
|
The amount of foreign tax paid in pounds sterling. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
pensionContributions
object
optional
|
Payments paid into a pension. |
pensionSchemeTaxReference
array
required
|
A list of one or more unique references provided by HM Revenue and Customs (HMRC) when the scheme has been registered for tax relief and exemptions. It is 10 characters made up of 8 numbers followed by 2 letters.
For example: |
inExcessOfTheAnnualAllowance
number
required
|
The amount of the in excess of the annual allowance. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
annualAllowanceTaxPaid
number
required
|
The amount of tax paid on annual allowance. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
overseasPensionContributions
object
optional
|
Object holding contributions paid into overseas pension. |
overseasSchemeProvider
array
required
|
Details of overseas pension provider. |
providerName
string
required
|
The name of the pension provider.
For example: |
providerAddress
string
required
|
The address of the pension provider.
For example: |
providerCountryCode
string
required
|
A three-letter code that represents a country name. The value must be a ISO 3166-1 alpha-3 code.
For example: |
qualifyingRecognisedOverseasPensionScheme
array
optional
|
A list of one or more qualifying overseas pension scheme reference number for overseas pensions contributions.
For example: |
pensionSchemeTaxReference
array
optional
|
A list of one or more unique references provided by HM Revenue and Customs (HMRC) when the scheme has been registered for tax relief and exemptions. It is 10 characters made up of 8 numbers followed by 2 letters.
For example: |
shortServiceRefund
number
required
|
The amount of short service refund for overseas pension contributions. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
shortServiceRefundTaxPaid
number
required
|
The amount of tax paid on short service refund. The value must be between 0 and 99999999999.99 up to 2 decimal places.
For example: |
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 |
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 |
The format of the supplied country code is not valid. |
400 (Bad Request) |
FORMAT_COUNTRY_CODE |
Not a valid ISO 3166-1 alpha-3 country code. |
400 (Bad Request) |
RULE_COUNTRY_CODE |
The format of providers name is invalid. |
400 (Bad Request) |
FORMAT_PROVIDER_NAME |
The format of providers address is invalid. |
400 (Bad Request) |
FORMAT_PROVIDERS_ADDRESS |
An empty or non-matching body was submitted. |
400 (Bad Request) |
RULE_INCORRECT_OR_EMPTY_BODY_SUBMITTED |
The specified tax year is not supported. That is, the tax year specified is before the minimum tax year value. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_SUPPORTED |
The format of QOPS reference number is not valid. |
400 (Bad Request) |
FORMAT_QOPS_REF |
The format of pension scheme tax reference is not valid. |
400 (Bad Request) |
FORMAT_PENSION_SCHEME_TAX_REFERENCE |
If annual allowance reduced is provided then tapered annual allowance or money purchased allowance must also be provided. |
400 (Bad Request) |
RULE_IS_ANNUAL_ALLOWANCE_REDUCED |
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 |
Simulates a success response. |
Close Section
Delete Pension Charges
DELETE
This endpoint allows a developer to delete charges relating to pensions. 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.
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.
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 |
Tax year range invalid. A tax year range of one year is required. |
400 (Bad Request) |
RULE_TAX_YEAR_RANGE_INVALID |
The specified tax year is not supported. That is, the tax year specified is before the minimum tax year value. |
400 (Bad Request) |
RULE_TAX_YEAR_NOT_SUPPORTED |
The client or agent is not authorised. This is because the client is not subscribed to MTD, the agent is not subscribed to Agent Services, or the client has not authorised the agent to act on their behalf. |
403 (Forbidden) |
CLIENT_OR_AGENT_NOT_AUTHORISED |
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. |
NOT_FOUND |
Simulates a scenario where the remote endpoint has indicated that no data can be found for the given period. |
Close Section