This version is in beta - expect some breaking changes.

Individuals Charges (MTD) API

Dates and amounts
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.

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

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.

Skip to main content

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.

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

Path parameters table
Name Description
nino
string
required

National Insurance number, in the format AA999999A.

For example: TC663795B

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: 2021-22

Request headers

Request headers Table
Name Description
Accept
required

Specifies the response format and the version of the API to be used.

For example: application/vnd.hmrc.1.0+json
Content-Type
required

Specifies the format of the request body, which must be JSON.

For example: application/json
Gov-Test-Scenario
optional

Only in sandbox environment. See Test Data table for all header values.

For example: -
Authorization
required
An OAuth 2.0 Bearer Token with the read:self-assessment scope.

For example: Bearer bb7fed3fe10dd235a2ccda3d50fb

See also fraud prevention.

Response headers

Response headers Table
Name Description
X-CorrelationId
required

Unique ID for operation tracking
String, 36 characters.

For example: c75f40a6-a3df-4429-a697-471eeec46435

See also fraud prevention.

Response

HTTP status: 200 (OK)

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"
    }
  ]
}

Response table
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: false

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: true

moneyPurchasedAllowance
boolean
optional

A boolean indicating whether money purchased allowance has been paid. The value must be true or false.

For example: false

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: 00123456RA

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: 1999.99

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: 1999.99

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: 1999.99

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: 1999.99

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: Overseas Pensions Plc

providerAddress
string
required

The address of the pension provider.

For example: 111 Main Street, Any Town, Any City

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: CYM

qualifyingRecognisedOverseasPensionScheme
array
optional

A list of one or more qualifying overseas pension scheme reference numbers for overseas pensions contributions.

For example: Q123456

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: 1999.99

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: 1999.99

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: 00123456RA

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: 1999.99

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: 1999.99

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: 1999.99

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: 1999.99

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: 00123456RA

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: 1999.99

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: 1999.99

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: Overseas Pensions Plc

providerAddress
string
required

The address of the pension provider.

For example: 111 Main Street, Any Town, Any City

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: CYM

qualifyingRecognisedOverseasPensionScheme
array
optional

A list of one or more qualifying overseas pension scheme reference numbers for overseas pensions contributions.

For example: Q123456

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: 1999.99

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: 1999.99

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: /individuals/charges/pensions/{nino}/{taxYear}

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

Error scenarios table
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.

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

Path parameters table
Name Description
nino
string
required

National Insurance number, in the format AA999999A.

For example: TC663795B

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: 2021-22

Request headers

Request headers Table
Name Description
Accept
required

Specifies the response format and the version of the API to be used.

For example: application/vnd.hmrc.1.0+json
Content-Type
required

Specifies the format of the request body, which must be JSON.

For example: application/json
Gov-Test-Scenario
optional

Only in sandbox environment. See Test Data table for all header values.

For example: -
Authorization
required
An OAuth 2.0 Bearer Token with the write:self-assessment scope.

For example: Bearer bb7fed3fe10dd235a2ccda3d50fb

See also fraud prevention.

Request

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
  }
}

Request table
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: false

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: true

moneyPurchasedAllowance
boolean
optional

A boolean indicating whether money purchased allowance has been paid. The value must be true or false.

For example: false

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: 00123456RA

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: 1999.99

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: 1999.99

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: 1999.99

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: 1999.99

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: Overseas Pensions Plc

providerAddress
string
required

The address of the pension provider.

For example: 111 Main Street, Any Town, Any City

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: CYM

qualifyingRecognisedOverseasPensionScheme
array
optional

A list of one or more qualifying overseas pension scheme reference number for overseas pensions contributions.

For example: Q123456

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: 00123456RA

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: 1999.99

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: 1999.99

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: 00123456RA

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: 1999.99

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: 1999.99

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: 1999.99

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: 1999.99

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: 00123456RA

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: 1999.99

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: 1999.99

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: Overseas Pensions Plc

providerAddress
string
required

The address of the pension provider.

For example: 111 Main Street, Any Town, Any City

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: CYM

qualifyingRecognisedOverseasPensionScheme
array
optional

A list of one or more qualifying overseas pension scheme reference number for overseas pensions contributions.

For example: Q123456

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: 00123456RA

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: 1999.99

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: 1999.99

Response headers

Response headers Table
Name Description
X-CorrelationId
required

Unique ID for operation tracking
String, 36 characters.

For example: c75f40a6-a3df-4429-a697-471eeec46435

See also fraud prevention.

Response

HTTP status: 204 (No Content)

Error scenarios

Error scenarios table
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.

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

Path parameters table
Name Description
nino
string
required

National Insurance number, in the format AA999999A.

For example: TC663795B

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: 2021-22

Request headers

Request headers Table
Name Description
Accept
required

Specifies the response format and the version of the API to be used.

For example: application/vnd.hmrc.1.0+json
Content-Type
required

Specifies the format of the request body, which must be JSON.

For example: application/json
Gov-Test-Scenario
optional

Only in sandbox environment. See Test Data table for all header values.

For example: -
Authorization
required
An OAuth 2.0 Bearer Token with the write:self-assessment scope.

For example: Bearer bb7fed3fe10dd235a2ccda3d50fb

See also fraud prevention.

Response headers

Response headers Table
Name Description
X-CorrelationId
required

Unique ID for operation tracking
String, 36 characters.

For example: c75f40a6-a3df-4429-a697-471eeec46435

See also fraud prevention.

Response

HTTP status: 204 (No Content)

Error scenarios

Error scenarios table
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

Skip to main content