This version is in beta - expect some breaking changes.

Individual Calculations (MTD) API

Available in Sandbox Yes
Sandbox base URL https://test-api.service.hmrc.gov.uk
Available in Production Yes
Production base URL https://api.service.hmrc.gov.uk

Overview

This API enables you to:

  • trigger a customer’s self assessment tax calculation
  • for version 3.0, a query parameter is used to control whether the calculation is to be used for a final declaration
  • for prior versions, a separate Intent to Crystallise endpoint is used to trigger a calculation to be used as a final declaration
  • list a customer’s self assessment tax calculations for a tax year
  • retrieve a customer’s self assessment tax calculation result
  • for version 3.0, a single endpoint retrieves the entire calculation
  • for prior versions, the calculation is retrieved using multiple endpoints
  • submit a self assessment final declaration for a tax year

In versions prior to version 3.0, the term ‘crystallise’ was used to mean submit a final declaration, and the term ‘intent to crystallise’ was used to mean trigger a final declaration self-assessment tax calculation.

For information on how to connect to this API see the Income Tax MTD end-to-end service guide.

Deprecation Notice: v4 is now deprecated. Please migrate to v5 for expanded functionality and long-term support.

Mapping APIs to Self Assessment tax return forms

Some parameters in this API map to box numbers in one or more Self Assessment tax return forms. To learn more and to download this mapping information as a CSV file, go to income-tax-mtd-changelog/mapping on GitHub.

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

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.

Dynamic

Some endpoints support DYNAMIC gov test scenarios. The response is dynamic based on the request parameters:

  • List Self Assessment Tax Calculations V3.0 and later
  • Retrieve a Self Assessment Tax Calculation V4.0 and later

Fraud Prevention

HMRC monitors transactions to help protect your customers' confidential data from criminals and fraudsters.

Warning You are required by law to submit header data for this API. This includes all associated APIs and endpoints.

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.

Endpoints

View API endpoints
Why do these endpoints look different?

The endpoints for this API now use the Open API Specification (OAS).

The API has not changed. You do not need to make any updates to your application if you already use this API.