This microservice retrieves a child's birth record from one of the following services:
- GRO (General Registry Office) - England and Wales
- NRS (National Records Scotland) - Scotland
This service is written in Scala and Play, so needs a JRE to run.
Run the services using the command below
sm2 --start BIRTH_REGISTRATION_MATCHING_ALL
The API takes a post request of child details (see parameters below), and returns a json response. If the submissions passes validation and contains no client errors, the response returned will be 200 OK with a JSON body of "matched": true or "matched": false
Path | Supported Methods | Description |
---|---|---|
/birth-registration-matching/match |
POST |
Returns whether there is match against the childs birth record |
Headers | Type | Example | Size | Description |
---|---|---|---|---|
Accept | String |
application/vnd.hmrc.1.0+json | N/A | API Version |
Audit-Source | String |
dfs | 20 | Unique identifier of the service |
Content-Type | String |
application/json; charset=utf-8 | N/A | Type of payload |
Parameters | Type | Size | Description |
---|---|---|---|
birthReferenceNumber | Optional(String) |
9 digits (england/wales) OR 10 digits (scotland) (10 = 4,3,3. In that first 4 digits are child's birth year i.e. 2017 and then after 3 digits are child's district number i.e. 417 and last 3 digits are entry number i.e.001. So Scottish BRN will be '2017417001') | Birth reference number for England or Wales / Scotland |
firstName | String |
1-250 | Child's first name |
additionalNames | Optional(String) |
1-250 | Child's additional names (It can contain space separated names) |
lastName | String |
1-250 | Child's last name |
dateOfBirth | Date (yyyy-MM-dd) |
10 | Child's date of birth |
whereBirthRegistered | Enum england / wales / scotland / northern ireland |
N/A | Where the child was registered (England / Wales / Scotland / Northern Ireland) |
curl --request POST \
--url http://localhost:8098/birth-registration-matching/match \
--header 'accept: application/vnd.hmrc.1.0+json' \
--header 'audit-source: test' \
--header 'cache-control: no-cache' \
--header 'content-type: application/json' \
--data '{
"birthReferenceNumber": "123456789",
"firstName": "Adam Test",
"lastName": "Smith",
"dateOfBirth": "2010-01-01",
"whereBirthRegistered": "england"
}'
POST /birth-registration-matching/match HTTP/1.1
Host: localhost:8098
Content-Type: application/json
Audit-Source: test
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache
{
"birthReferenceNumber": "123456789",
"firstName": "Adam Test",
"lastName": "Smith",
"dateOfBirth": "2010-01-01",
"whereBirthRegistered": "england"
}
curl --request POST \
--url http://localhost:8098/birth-registration-matching/match \
--header 'accept: application/vnd.hmrc.1.0+json' \
--header 'audit-source: test' \
--header 'cache-control: no-cache' \
--header 'content-type: application/json' \
--data '{
"birthReferenceNumber": "123456789",
"firstName": "Adam Test",
"additionalNames": "David",
"lastName": "Smith",
"dateOfBirth": "2010-01-01",
"whereBirthRegistered": "england"
}'
POST /birth-registration-matching/match HTTP/1.1
Host: localhost:8098
Content-Type: application/json
Audit-Source: test
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache
{
"birthReferenceNumber": "123456789",
"firstName": "Adam Test",
"additionalNames": "David",
"lastName": "Smith",
"dateOfBirth": "2010-01-01",
"whereBirthRegistered": "england"
}
HTTP/1.1 200 OK
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{"matched":false}
HTTP/1.1 200 OK
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{"matched":true}
HTTP/1.1 400 Bad Request
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
HTTP/1.1 400 Bad Request
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{
"code":"INVALID_BIRTH_REFERENCE_NUMBER",
"message":"The birth reference number does not meet the required length"
}
HTTP/1.1 400 Bad Request
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{
"code": "INVALID_FIRSTNAME",
"message": "Provided firstName is invalid."
}
HTTP/1.1 400 Bad Request
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{
"code": "INVALID_ADDITIONALNAMES",
"message": "Provided additionalNames are invalid."
}
HTTP/1.1 400 Bad Request
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{
"code": "INVALID_LASTNAME",
"message": "Provided lastName is invalid."
}
HTTP/1.1 400 Bad Request
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{
"code": "INVALID_DATE_OF_BIRTH",
"message": "Provided dateOfBirth is invalid."
}
HTTP/1.1 403 Forbidden
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{
"code": "INVALID_WHERE_BIRTH_REGISTERED",
"message": "Provided Country is invalid. "
}
HTTP/1.1 401 unauthorized
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{
"code": "INVALID_AUDITSOURCE",
"message": "Provided Audit-Source is invalid."
}
HTTP/1.1 400 Bad Request
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{
"code": "BAD_REQUEST",
"message": "Provided request is invalid."
}
HTTP/1.1 406 Not Acceptable
Accept: application/vnd.hmrc.1.0+xml
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{
"code": "INVALID_CONTENT_TYPE",
"message": "Accept header is invalid."
}
HTTP/1.1 406 Not Acceptable
Accept: application/vnd.hmrc.12.0+xml
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{
"code": "INVALID_CONTENT_TYPE",
"message": "Accept header is invalid."
}
HTTP/1.1 500 Internal Server Error
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
HTTP/1.1 503 Service Unavailable
Accept: application/vnd.hmrc.1.0+json
Cache-Control: no-cache,no-store,max-age=0
Content-Type: application/json; charset=utf-8
{
"code":"GRO_CONNECTION_DOWN",
"message":"General Registry Office: England and Wales is unavailable"
}
{
"code":"DES_CONNECTION_DOWN",
"message":"DES is unavailable"
}
{
"code":"NRS_CONNECTION_DOWN",
"message":"National Records Scotland: Scotland is unavailable"
}
This code is open source software licensed under the Apache 2.0 License