This version is in beta - expect some breaking changes.

Individuals Business End of Period Statement (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 a developer to submit a declaration that the submission date for a business is complete.

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

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

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/business/end-of-period-statement/{nino}

Submit End of Period Statement for a Business
POST

This endpoint allows the developer to submit a declaration that the submission data for a business is complete. A National Insurance number is required.

Authorisation

This endpoint is user-restricted and requires an Authorization header containing an OAuth 2.0 Bearer Token with the write:self-assessment scope.

Path parameters

Path parameters table
Name Description
nino
string
required

National Insurance number, in the format AA999999A.

For example: TC663795B

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: Submit End of Period Statement for a Busines

{
  "typeOfBusiness": "self-employment",
  "businessId": "XAIS12345678910",
  "accountingPeriod" : {
    "startDate": "2021-04-06",
    "endDate": "2022-04-05"
  },
  "finalised": true
}

Request table
Name Description
typeOfBusiness
string
required

The type of business the the declaration is for. Limited to the following possible values: self-employment, uk-property and foreign-property

Limited to the following possible values:

self-employment
uk-property
foreign-property
businessId
string
required

An identifier for the business, unique to the customer.

Must conform to the regular expression ^X[A-Z0-9]{1}IS[0-9]{11}$

For example: XAIS12345678910

accountingPeriod
object
required

Object containing the accounting period start and end dates

startDate
string
required

The date the accounting period started. Must be in the format YYYY-MM-DD. For example: 2021-04-06

For example: 2021-04-06

endDate
string
required

The date the accounting period ended. Must be in the format YYYY-MM-DD. For example: 2022-04-05

For example: 2022-04-05

finalised
boolean
required

Declaration for the finalised statement. Limited to the following possible values: true or false

For example: true

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 Type of Business field is not valid.

400 (Bad Request)

FORMAT_TYPE_OF_BUSINESS

The format of the supplied Business ID field is not valid.

400 (Bad Request)

FORMAT_BUSINESS_ID

The Accounting Period Start date is not a valid ISO format date.

400 (Bad Request)

FORMAT_START_DATE

The Accounting Period End date is not a valid ISO format date.

400 (Bad Request)

FORMAT_END_DATE

The format of the supplied Finalised field is not valid.

400 (Bad Request)

FORMAT_FINALISED

The user's submission is missing one or more expected fields.

400 (Bad Request)

RULE_INCORRECT_OR_EMPTY_BODY_SUBMITTED

The End date is before the Start date.

400 (Bad Request)

RANGE_END_DATE_BEFORE_START_DATE

The user has not declared the submission for this business is complete.

400 (Bad Request)

RULE_NOT_FINALISED

The user has previously submitted an End of Period Statement for this business' accounting period.

403 (Forbidden)

RULE_ALREADY_SUBMITTED

The user has tried to make their End of Period Statement declaration before the accounting period has ended.

403 (Forbidden)

RULE_EARLY_SUBMISSION

The user has tried to make their End of Period Statement declaration too late.

403 (Forbidden)

RULE_LATE_SUBMISSION

An End of Period Statement without a matching accounting period cannot be submitted.

403 (Forbidden)

RULE_NON_MATCHING_PERIOD

Consolidated expenses are not allowed if the cumulative turnover amount exceeds the threshold.

403 (Forbidden)

RULE_CONSOLIDATED_EXPENSES

The period submission start date does not match the accounting period start date.

403 (Forbidden)

RULE_MISMATCHED_START_DATE

The period submission end date does not match the accounting period end date.

403 (Forbidden)

RULE_MISMATCHED_END_DATE

The user has requested a National Insurance Class 4 exemption but the individual’s age is greater than or equal to 16 years old on the 6th April of the current tax year.

403 (Forbidden)

RULE_CLASS4_OVER_16

The user has requested a National Insurance Class 4 exemption but the individual's age is less than their State Pension age on the 6th April of the current tax year.

403 (Forbidden)

RULE_CLASS4_PENSION_AGE

For UK Furnished Holiday Lettings, the private use adjustment exceeds the total allowable expenses.

403 (Forbidden)

RULE_FHL_PRIVATE_USE_ADJUSTMENT

For UK non-Furnished Holiday Lettings, the private use adjustment exceeds the total allowable expenses.

403 (Forbidden)

RULE_NON_FHL_PRIVATE_USE_ADJUSTMENT

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.

MATCHING_RESOURCE_NOT_FOUND

Simulate scenario where no data found.

RULE_ALREADY_SUBMITTED

Simulate scenario where the user has previously submitted an End of Period Statement for this business' accounting period.

RULE_CLASS4_OVER_16

Simulate scenario where the user has requested a National Insurance Class 4 exemption but the individual’s age is greater than or equal to 16 years old on the 6th April of the current tax year.

RULE_CLASS4_PENSION_AGE

Simulate scenario where the user has requested a National Insurance Class 4 exemption but the individual's age is less than their State Pension age on the 6th April of the current tax year.

RULE_CONSOLIDATED_EXPENSES_SELF_EMPLOYMENT

Simulate scenario where self employment consolidated expenses are not allowed if the cumulative turnover amount exceeds the threshold.

RULE_CONSOLIDATED_EXPENSES_UK_PROPERTY

Simulate scenario where UK property consolidated expenses are not allowed if the cumulative turnover amount exceeds the threshold.

RULE_EARLY_SUBMISSION

Simulate scenario where the user has tried to make their End of Period Statement declaration before the accounting period has ended.

RULE_FHL_PRIVATE_USE_ADJUSTMENT

Simulate scenario for UK Furnished Holiday Lettings, the private use adjustment exceeds the total allowable expenses.

RULE_LATE_SUBMISSION

Simulate scenario where the user has tried to make their End of Period Statement declaration too late.

RULE_MISMATCHED_END_DATE_PERIOD_SHORT

Simulate scenario where the period submission end date does not match the accounting period end date.

RULE_MISMATCHED_END_DATE_PERIOD_EXCEEDS

Simulate scenario where the period submission end date does not match the accounting period end date.

RULE_MISMATCHED_START_DATE

Simulate scenario where the period submission start date must match the accounting period start date.

RULE_NON_FHL_PRIVATE_USE_ADJUSTMENT

Simulate scenario for UK non-Furnished Holiday Lettings, the private use adjustment must not exceed the total allowable expenses

RULE_NON_MATCHING_PERIOD

Simulate scenario where an End of Period Statement without a matching accounting period cannot be submitted.


Close Section

Skip to main content