Argentina CBU Validation
CBU (Clave Bancaria Uniforme) is a 22-digit number used to identify bank accounts in Argentina. It is the standard domestic account identifier used to route transfers to the correct bank branch and account.
A CBU consists of 22 digits and contains the bank code (3 digits), branch code (4 digits), one check digit for the bank and branch block, account number (13 digits), and a final check digit for the account block.
For example, CBU number 2850590912345678901233:
- 285 - bank code
- 0590 - branch code
- 9 - bank and branch block check digit
- 1234567890123 - account number
- 3 - account block check digit
How the check digits work
A CBU has two check digits, one for each block, so an error in the bank and branch part and an error in the account part are caught separately. Each digit of a block is multiplied by a fixed weight, the products are added up, and the check digit is 10 minus the last digit of the sum (or 0 when the sum ends in 0).
- Bank and branch block - the first 7 digits use the weights 7, 1, 3, 9, 7, 1, 3. For the example above the sum is 81, so the check digit is 10 − 1 = 9.
- Account block - the next 13 digits use the weights 3, 9, 7, 1, 3, 9, 7, 1, 3, 9, 7, 1, 3. For the example above the sum is 217, so the check digit is 10 − 7 = 3.
What the API checks
- Format - exactly 22 digits, with no spaces or dashes. Otherwise the API returns
400 Invalid CBU. Must be exactly 22 digits long. - Both check digits - a mismatch in either block returns
400 Invalid CBU. Checksum is incorrect. - Bank - the three-digit bank code must belong to an institution registered with the Central Bank of Argentina, otherwise
404 Bank not found.
How to validate a CBU
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.
Because a CBU identifies a specific bank account, it is considered personally identifiable information (PII) and must not appear in URLs or access logs. That is why CBU validation uses the POST method with the CBU passed in the JSON request body.
To validate a CBU call /v2/cbu endpoint with the POST method and include the cbu in the request body:
curl 'https://api.fincodesapi.com/v2/cbu' \
--request POST \
--header 'Authorization: Bearer your-api-key-here' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"cbu":"2850590912345678901233"}'
# INSTALLATION
$ composer require guzzlehttp/guzzle
# REQUEST
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.fincodesapi.com/v2/cbu', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer your-api-key-here',
],
'json' => [
'cbu' => '2850590912345678901233',
],
]);
echo $response->getBody();
# INSTALLATION
$ python -m pip install requests
# REQUEST
import requests
url = "https://api.fincodesapi.com/v2/cbu"
headers = {
"Accept": "application/json",
"Authorization": "Bearer your-api-key-here"
}
payload = {
"cbu": "2850590912345678901233"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
# INSTALLATION
$ npm install node-fetch --save
// REQUEST
import fetch from 'node-fetch';
const url = 'https://api.fincodesapi.com/v2/cbu';
const options = {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer your-api-key-here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'cbu': '2850590912345678901233'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
const options = {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer your-api-key-here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'cbu': '2850590912345678901233'
})
};
fetch('https://api.fincodesapi.com/v2/cbu', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
The response should be:
{
"success": true,
"data": {
"id": "2850590912345678901233",
"account_number": "1234567890123",
"branch_code": "0590",
"bank": {
"id": "f1f5b5a8-c83d-4d9b-8224-0a1a2f5c0d62",
"country_id": "AR",
"code": "285",
"name": "Banco Macro"
}
}
}
Response fields
id- the CBUbranch_code- the four-digit branch codeaccount_number- the thirteen-digit account block, without its check digitbank- the institution identified by the bank code
Common mistakes
- Sending an alias - Argentine customers often share a CBU alias (a word-based alias such as
sol.casa.mar) instead of the number. The API needs the 22-digit CBU. - Copying with spaces - banking apps often display the CBU in groups. Remove spaces before sending it.
- Putting the CBU in a URL - always send it in the request body as shown above, so it doesn't end up in proxy or server logs.
Where the data comes from
Bank codes are imported from the list of financial institutions published by the Central Bank of Argentina (BCRA) and are refreshed weekly. Both check digits are calculated on every request.
You can find full documentation here.