This version is in beta - expect some breaking changes.

Marriage Allowance 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 provides resources related to Marriage Allowance.

Marriage Allowance lets the lower earner of a couple transfer some of their Personal Allowance to their husband, wife or civil partner. If they are eligible this will then lower their tax bill.

In particular, this API can

  • Retrieve an individual’s Marriage Allowance status
  • Check their partner’s eligibility to be a recipient of Marriage Allowance (useful if the individual is considering applying for Marriage Allowance)

Switch to version 2.0

On 28 February 2020 version 1.0 will be switched off.

Version 2.0 will be released on 23 October 2019 within the Sandbox and Production environment.

Authorisation

The endpoint in this API is user-restricted. Your users must grant authority for your software to access it by signing in to their HMRC online account.

The API supports individual and agent users. Note that:

  • Individual users can only access their own information.
  • Agent users can only access their own clients’ data.

The following options are supported for agents:

Option 1: Agent services account

If the agent uses an agent services account, they can access their existing 64-8 clients who they have linked to their agent services account (restricted to 2 years’ history)

Option 2: HMRC online services for agents account

If the agent uses an HMRC online services for agents account which is enrolled for Self Assessment for Agents, they will be able to access their existing 64-8 clients (restricted to 2 years’ history).

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.

Testing

You can use the sandbox environment to test this API.

It supports stateful behaviour. You can set up test data for this API using the Marriage Allowance Test Support API.

Skip to main content

Endpoints

/marriage-allowance/sa/{utr}/status

Get Marriage Allowance status
GET

@*

  • Copyright 2021 HM Revenue & Customs * *@

This resource determines whether an individual taxpayer has Marriage Allowance for the given tax year. If they have Marriage Allowance it will return their role in the relationship (either 'Transferor' or 'Recipient').

Authorisation

This endpoint is user-restricted and requires an Authorization header containing an OAuth 2.0 Bearer Token with the read:marriage-allowance scope.

Path parameters

Path parameters table
Name Description
utr
string
required

The 10 digit self-assessment UTR for the individual.

For example: 2234567890

Query parameters

Query parameters table
Name Description
taxYear
string
required

The tax year for which the Marriage Allowance status is being retrieved, in the format YYYY-YY.

For example: 2014-15

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.2.0+json
Authorization
required
An OAuth 2.0 Bearer Token with the read:marriage-allowance scope.

For example: Bearer bb7fed3fe10dd235a2ccda3d50fb

See also fraud prevention.

Response

HTTP status: 200 (OK)

{
    "status" : "Recipient",
    "deceased": false
}

Response table
Name Description
status
string
required

The role of the taxpayer as recipient or transferor.

Limited to the following possible values:

Transferor - The taxpayer has transferred personal allowance in the given tax year
Recipient - The taxpayer has received personal allowance in the given tax year
None - The taxpayer has not transferred or received personal allowance in the given tax year
deceased
boolean
required

Whether the taxpayer is deceased or not.

Error scenarios

Error scenarios table
Scenario HTTP status Code

Invalid UTR

400 (Bad Request)

SA_UTR_INVALID

Invalid tax year

400 (Bad Request)

TAX_YEAR_INVALID

Missing tax year

400 (Bad Request)

TAX_YEAR_INVALID

User not authorised

401 (Unauthorized)

UNAUTHORIZED

Unmatched recipient

404 (Not Found)

NOT_FOUND

For error scenarios that are common across all APIs, and for error formats, see our reference guide.


Close Section
/marriage-allowance/sa/{utr}/eligibility

Check Marriage Allowance eligibility
POST

@*

  • Copyright 2021 HM Revenue & Customs * *@

This resource checks whether an individual taxpayer's partner is eligible to become a recipient of Marriage Allowance for the given tax year.

This resource should only be used when the individual is the lower earner and is considering becoming a transferor of Marriage Allowance. It should only be used to to check the eligibility of their own partner.

Authorisation

This endpoint is user-restricted and requires an Authorization header containing an OAuth 2.0 Bearer Token with the read:marriage-allowance scope.

Path parameters

Path parameters table
Name Description
utr
string
required

The 10 digit self-assessment UTR for the individual.

For example: 2234567890

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.2.0+json
Content-Type
required

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

For example: application/json
Authorization
required
An OAuth 2.0 Bearer Token with the read:marriage-allowance scope.

For example: Bearer bb7fed3fe10dd235a2ccda3d50fb

See also fraud prevention.

Request

{
    "nino": "AA000003D",
    "firstname": "John",
    "surname": "Smith",
    "dateOfBirth": "1981-01-31",
    "taxYear": "2018-19"
}

Request table
Name Description
nino
string
required

National Insurance number

Must conform to the regular expression ^((?!(BG|GB|KN|NK|NT|TN|ZZ)|(D|F|I|Q|U|V)[A-Z]|[A-Z](D|F|I|O|Q|U|V))([A-Z]\s*){2})([0-9]\s*){6}([A-D]\s*)$

For example: AA000003D

firstname
string
required

Partner’s (potential recipient’s) first name

Must conform to the regular expression ^(.){1,35}$

For example: John

surname
string
required

Partner’s (potential recipient’s) surname

Must conform to the regular expression ^(.){1,35}$

For example: Wick

dateOfBirth
string
required

Partner’s (potential recipient’s) date of birth in YYYY-MM-DD format

Must conform to the regular expression ^(19|20)[0-9]{2}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$

For example: 1987-12-20

taxYear
string
required

The tax year for which the Marriage Allowance eligibility is being retrieved, in the format YYYY-YY

Must conform to the regular expression ^(19|20)[0-9]{2}-[1-9]{2}$

For example: 2019-20

Response

HTTP status: 200 (OK)

{
    "eligible" : true
}

Response table
Name Description
eligible
boolean
required

Whether the taxpayer's partner is eligible to become a recipient of Marriage Allowance.

Error scenarios

Error scenarios table
Scenario HTTP status Code

Invalid UTR

400 (Bad Request)

SA_UTR_INVALID

Missing Nino

400 (Bad Request)

BAD_REQUEST

Invalid NINO

400 (Bad Request)

NINO_INVALID

Missing date of birth

400 (Bad Request)

BAD_REQUEST

Invalid date of birth

400 (Bad Request)

DOB_INVALID

Missing tax year

400 (Bad Request)

BAD_REQUEST

Invalid tax year

400 (Bad Request)

TAX_YEAR_INVALID

Missing first name

400 (Bad Request)

BAD_REQUEST

Invalid first name

400 (Bad Request)

FIRST_NAME_INVALID

Missing surname

400 (Bad Request)

BAD_REQUEST

Invalid surname

400 (Bad Request)

SURNAME_VALID

User not authorised

401 (Unauthorized)

UNAUTHORIZED

Unmatched recipient

404 (Not Found)

NOT_FOUND

For error scenarios that are common across all APIs, and for error formats, see our reference guide.


Close Section

Skip to main content