New Zealand NCC Code Validation
An NCC (National Clearing Code) is the six-digit bank and branch prefix of a New Zealand bank account number. It tells the clearing system which bank and which branch hold the account, in the same way a sort code does in the UK.
A full New Zealand account number is written as BB-bbbb-AAAAAAA-SSS: a two-digit bank number, a four-digit branch number, a seven-digit account base and a two or three-digit suffix. The NCC is the first six digits of that number.
For example, NCC code 010205:
- 01 - bank number (01 is ANZ Bank New Zealand)
- 0205 - branch number
Because the NCC is embedded in every account number, you can extract it from an account a customer gives you (e.g. 01-0205-0123456-00) and look it up to confirm which bank and branch the money will go to before you pay.
What the API checks
- Format - the code must be exactly six digits, without dashes or spaces. Anything else returns
400 Invalid NCC. - Existence - the bank and branch combination must appear in the Bank Branch Register. A well-formed code for a branch that doesn't exist returns
404.
The API validates the bank and branch part only. The account base and suffix aren't checked, so pair the NCC lookup with your own account-number checks or a payee verification step for high-value payments.
How to validate an NCC code
To start using our Fin Codes API sign up here and create your API key. Pass this key as a bearer token in the Authorization HTTP header, e.g. Authorization: Bearer your-api-key-here.
To validate an NCC code call /v2/ncc/{ncc_code} endpoint using HTTP client of your preference, i.e.:
curl 'https://api.fincodesapi.com/v2/ncc/010205' \
--header 'Authorization: Bearer your-api-key-here' \
--header 'Accept: application/json'
# INSTALLATION
$ composer require guzzlehttp/guzzle
# REQUEST
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.fincodesapi.com/v2/ncc/010205', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-api-key-here',
],
]);
echo $response->getBody();
# INSTALLATION
$ python -m pip install requests
# REQUEST
import requests
url = "https://api.fincodesapi.com/v2/ncc/010205"
headers = {
"Accept": "application/json",
"Authorization": "Bearer your-api-key-here"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
# INSTALLATION
$ npm install node-fetch --save
// REQUEST
import fetch from 'node-fetch';
const url = 'https://api.fincodesapi.com/v2/ncc/010205';
const options = {
method: 'GET',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer your-api-key-here'
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
const options = {
method: 'GET',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer your-api-key-here'
}
};
fetch('https://api.fincodesapi.com/v2/ncc/010205', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
The response should be:
{
"success": true,
"data": {
"id": "010205",
"branch_name": "ANZ Retail",
"address": "170 Featherston street",
"city": "Wellington",
"postcode": "6011",
"phone": "0800 269 296",
"fax": "",
"pob_number": "PO Box 18",
"pob_location": "Shortland Street, Auckland",
"pob_postcode": "1140",
"bank": {
"id": "dae732d9-535d-4dcd-9719-a0957a4afedd",
"country_id": "NZ",
"code": "01",
"name": "ANZ Bank New Zealand"
}
}
}
Response fields
id- the six-digit NCCbranch_nameandbranch_code- the branch and its four-digit numberaddress,city,postcode- the branch's street addressstd,phone,fax- the branch's contact numbers as listed in the registerpob_number,pob_location,pob_postcode- the branch's PO Box, where one is registeredbank- the bank the two-digit bank number belongs to
Common mistakes
- Sending the whole account number - only the first six digits are the NCC. Strip the dashes and send the bank and branch digits.
- Dropping the leading zero - most major banks have bank numbers that start with 0 (01, 02, 03, 06), and spreadsheets turn
010205into10205. - Treating a branch as a separate bank - one bank number can cover hundreds of branches. Group payees by the
bankobject, not by the full NCC.
Where the data comes from
NCC data is imported from the Bank Branch Register maintained by Payments NZ and is refreshed weekly.
You can find full documentation here.