Residency status for relief at source 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

Check if a pension scheme member is a resident in Scotland or Wales for tax purposes. Pension scheme administrators need this for relief at source claims.

Before you start

You will need the pension scheme member’s:

  • name
  • date of birth National Insurance number

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 the API

You can use the sandbox environment to test this API.

It does not currently support stateful behaviour, but you can use the payloads described in Resources to test specific scenarios.

You must set up a test user which is an organisation for this API using the Create Test User API.

Skip to main content

Endpoints

/individuals/relief-at-source/residency-status

Check if an individual is a Scotland, Wales or rest of the UK resident
POST

Pension Scheme Administrators can find out if a pension scheme member pays tax in Scotland, Wales or in the rest of the UK. They can apply the correct rate of Income Tax to their relief at source contributions.

From 1 January to 5 April, the API will return currentYearResidencyStatus and nextYearForecastResidencyStatus.

From 6 April to 31 December, the API will only return currentYearResidencyStatus.

Authorisation

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

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:ras scope.

For example: Bearer bb7fed3fe10dd235a2ccda3d50fb

See also fraud prevention.

Request

{
  "nino" : "BB123456B",
  "firstName" : "John",
  "lastName" : "Smith",
  "dateOfBirth" : "1975-05-25"
}

Request table
Name Description
nino
string
required

The pension scheme member’s 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]{2})[0-9]{6}[A-D]$

For example: BB123456B

firstName
string
required

The pension scheme member’s first name.

Must conform to the regular expression ^[a-zA-Z &`\-\'^]{1,35}$

For example: John

lastName
string
required

The pension scheme member’s last name.

Must conform to the regular expression ^[a-zA-Z &`\-\'^]{1,35}$

For example: Smith

dateOfBirth
string
required

The pension scheme member’s date of birth. This cannot be in the future.

Date in the format YYYY-MM-DD

For example: 1975-05-25

Response

HTTP status: 200 (OK)

{
  "currentYearResidencyStatus" : "otherUKResident",
  "nextYearForecastResidencyStatus" : "scotResident"
}

Response table
Name Description
currentYearResidencyStatus
string
required

Returns the residency status for this tax year.

Limited to the following possible values:

scotResident
welshResident
otherUKResident
nextYearForecastResidencyStatus
string
optional

Returns the residency status for the next tax year. This will be returned between 1 January and 5 April.

Limited to the following possible values:

scotResident
welshResident
otherUKResident

Error scenarios

Error scenarios table
Scenario HTTP status Code

Bad Request

400 (Bad Request)

BAD_REQUEST

The pension scheme member's details do not match with HMRC's records.

403 (Forbidden)

STATUS_UNAVAILABLE

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

Test data

Scenario Request Payload Example Response

Request with a valid payload where currentYearResidencyStatus is otherUKResident and nextYearForecastResidencyStatus is otherUKResident

{
"nino" : "PC243122B",
"firstName" : "Peter",
"lastName" : "Armstrong",
"dateOfBirth" : "1969-01-01"
}

HTTP status: 200 (Ok)

{
"currentYearResidencyStatus" : "otherUKResident",
"nextYearForecastResidencyStatus" : "otherUKResident"
}

Request with a valid payload where currentYearResidencyStatus is otherUKResident and nextYearForecastResidencyStatus is scotResident

{
"nino" : "BB123456B",
"firstName" : "John",
"lastName" : "Smith",
"dateOfBirth" : "1975-05-25"
}

HTTP status: 200 (Ok)

{
"currentYearResidencyStatus" : "otherUKResident",
"nextYearForecastResidencyStatus" : "scotResident"
}

Request with a valid payload where currentYearResidencyStatus is scotResident and nextYearForecastResidencyStatus is otherUKResident

{
"nino" : "LR325154D",
"firstName" : "Jane",
"lastName" : "Doe",
"dateOfBirth" : "1969-06-09"
}

HTTP status: 200 (Ok)

{
"currentYearResidencyStatus" : "scotResident",
"nextYearForecastResidencyStatus" : "otherUKResident"
}

Request with a valid payload where currentYearResidencyStatus is scotResident and nextYearForecastResidencyStatus is scotResident

{
"nino" : "CC123456C",
"firstName" : "Joe",
"lastName" : "Bloggs",
"dateOfBirth" : "1982-02-17"
}

HTTP status: 200 (Ok)

{
"currentYearResidencyStatus" : "scotResident",
"nextYearForecastResidencyStatus" : "scotResident"
}

Request with a valid payload where currentYearResidencyStatus is otherUKResident

{
"nino" : "AA315445B",
"firstName" : "Victoria",
"lastName" : "Clark",
"dateOfBirth" : "1981-12-12"
}

HTTP status: 200 (Ok)

{
"currentYearResidencyStatus" : "otherUKResident",
}

Request with a valid payload where currentYearResidencyStatus is scotResident

{
"nino" : "BA315445B",
"firstName" : "Charlie",
"lastName" : "Thompson",
"dateOfBirth" : "1941-10-12"
}

HTTP status: 200 (Ok)

{
"currentYearResidencyStatus" : "scotResident",
}

Request with an invalid nino, no first name, invalid data type for last name and a date of birth which does not exist

{
"nino" : "LE241131E",
"lastName" : true,
"dateOfBirth" : "1989-02-30"
}

HTTP status: 400 (Bad Request)

{
"code": "BAD_REQUEST",
"message": "Bad Request"
"errors": [
{
"code": "INVALID_FORMAT",
"message": "Invalid format has been used",
"path": "/nino"
},
{
"code": "INVALID_DATA_TYPE",
"message": "Invalid data type has been used",
"path": "/lastName"
},
{
"code": "INVALID_DATE",
"message": "Date is invalid",
"path": "/dateOfBirth"
},
{
"code": "MISSING_FIELD",
"message": "This field is required",
"path": "/firstName"
}
]
}

Request with a valid payload, but the status cannot be provided for this pension scheme member.

{
"nino" : "SE235112A",
"firstName" : "Raj",
"lastName" : "Patel",
"dateOfBirth" : "1984-10-30"
}

HTTP status: 403 (Forbidden)

{
"code": "STATUS_UNAVAILABLE",
"message": "Cannot provide a residency status for this pension scheme member."
}


Close Section

Skip to main content