Docs / API reference
BIN Lookup
Identifies the issuer, brand, type and country of a payment card from its first digits and tells you whether the BIN is valid.
Overview#
The BIN (Bank Identification Number, also called IIN) is the first six to eight digits of a card number. lookup/bin takes it in the bin parameter and returns isValid, a reason when it is not, blacklisted, and an info object with the card scheme (name, brand, type, currency, prepaid and commercial flags), the card number syntax, the issuing bank (name, city, URL, phone, coordinates) and the issuing country.
Send only the leading digits; never send a full card number to this method.
When to use it#
- Validate a card at checkout before calling the payment gateway.
- Compare the card's country with the customer's billing or IP country.
- Detect prepaid or commercial cards where your policy treats them differently.
- Route payments by scheme or issuer.
Reading the result#
isValid: falsemeans the number is not a known BIN;reasonexplains why. Treat repeated invalid BINs from one customer as card testing.info.country.alpha2is where the card was issued. A mismatch with the customer's country is a classic risk signal but also common for travellers, so weigh it with other evidence.info.scheme.isPrepaidcards are harder to trace and are used more often in abuse;isCommercialindicates corporate cards.info.scheme.typeseparates debit from credit, which can affect how you price risk.blacklistedreflects your own blacklists.
Coverage#
info is always present. For a BIN in our reference data you get the scheme, card type (debit, credit or charge), brand/category (Classic, Platinum, Infinite, World Elite...), prepaid and commercial flags, and the issuing bank's name, URL and phone. Saudi mada cards are recognised by range, including co-badged Visa and Mastercard debit cards. For a BIN we have no record of, you still get the scheme and card syntax derived from the number itself, with the bank and country fields set to null, and isValid reflects the scheme and, when a full number is sent, the Luhn check. Issuer names are normalised to Title Case.
Notes#
- Counts as one request. Test mode returns fake data, is free and raises no events.
- Included in every plan, including Standard.
- Custom rules for the BIN group can test the scheme, card type, prepaid and commercial flags, issuing country and bank, and can mark the BIN as valid or invalid; applied rules show in
custom_rules_applied. - An
invalid_binevent is raised when the BIN is judged invalid and goes to your webhooks. - A missing or malformed value returns error 120 (
invalid_bin_number) with HTTP 200. The payment fraud method runs this check itself when you pass a card number.
Request#
https://gurdx.cretip.com/api/lookup/bin
- Authenticate with the key parameter or an Authorization: Bearer header.
- Counts as 1 request.
- Available on: Free trial Standard Premium Pay-as-you-go
Parameters#
| Name | Type | Description |
|---|---|---|
bin
required
query |
string |
The BIN/IIN of the card (min: 6 digits). Sample value: 456789, 456789XXXXXX1234, or 4567891234567890.
|
Every method also accepts format, lang, mode, userID, callback. See Options.
Code samples#
curl -G "https://gurdx.cretip.com/api/lookup/bin" \
--data-urlencode "key=YOUR_API_KEY" \
--data-urlencode "bin=45717360"
<?php
$response = file_get_contents('https://gurdx.cretip.com/api/lookup/bin?'.http_build_query(['key' => 'YOUR_API_KEY', 'bin' => '45717360']));
$result = json_decode($response, true);
if ($result['status'] === 'success') {
print_r($result['data']);
} else {
echo $result['code'].': '.$result['description'];
}
const params = new URLSearchParams({"key":"YOUR_API_KEY","bin":"45717360"});
const res = await fetch(`https://gurdx.cretip.com/api/lookup/bin?${params}`);
const result = await res.json();
if (result.status === 'success') {
console.log(result.data);
} else {
console.error(result.code, result.description);
}
import requests
res = requests.get("https://gurdx.cretip.com/api/lookup/bin", params={"key": "YOUR_API_KEY", "bin": "45717360"})
result = res.json()
if result["status"] == "success":
print(result["data"])
else:
print(result["code"], result["description"])
Response#
Success#
{
"data": {
"reason": "",
"isValid": true,
"blacklisted": false,
"bin": "456789",
"info": {
"scheme": {
"name": "Visa",
"coName": "Mada",
"isLuha": true,
"isPrepaid": false,
"isCommercial": false,
"type": "debit",
"brand": "Traditional",
"currency": "SAR"
},
"detected_digits": "4",
"syntax": {
"gaps": [
4,
8,
12
],
"lengths": [
16,
18,
19
],
"code": {
"name": "CVV",
"size": 3
}
},
"bank": {
"id": "588847",
"identifier": "80",
"name": "AL RAJHI BANKING AND INVESTMENT CORP.",
"city": "Riyadh",
"url": "https://www.alrajhibank.com.sa",
"phone": "+96611211600",
"logo": "https://gurdx.io/img/banks/al-rajhi.jpg",
"latitude": "25",
"longitude": "45"
},
"country": {
"alpha2": "SA",
"name": "Saudi Arabia",
"code": "966",
"numeric": "682",
"emoji": "🇸🇦",
"continent": "Asia",
"languageCode": "ar",
"languageNative": "العربية"
}
},
"custom_rules_applied": {
"total": 0,
"rules": []
}
},
"status": "success",
"executionTime": 2
}Error#
Errors are delivered with HTTP 200 — always check the status field.
{
"status": "error",
"code": 101,
"type": "invalid_key",
"description": "The API Key is missing or invalid."
}Response fields#
| Name | Type | Description |
|---|---|---|
data.reason |
string |
Reason for the validation result. |
data.isValid |
boolean |
Validation result (true or false).
|
data.blacklisted |
boolean |
Indicates if the BIN is blacklisted due to applying custom rules or were found in one of your blacklists. |
data.bin |
string |
The BIN/IIN of the card you passed in the request. |
data.info.scheme.name |
object |
Card scheme name. |
data.info.scheme.coName |
object |
Card company name. |
data.info.scheme.isLuha |
boolean |
Is the card issued by Luha? |
data.info.scheme.isPrepaid |
boolean |
Is the card prepaid? |
data.info.scheme.isCommercial |
boolean |
Is the card commercial? |
data.info.scheme.type |
string |
Card type (debit, or credit).
|
data.info.scheme.brand |
string |
Card brand (Traditional, Gold, Platinum, etc.).
|
data.info.scheme.currency |
string |
Card currency. |
data.info.scheme |
object |
— |
data.info.detected_digits |
string |
The digits used to detect the scheme details. |
data.info.syntax.gaps |
array |
The gaps variations of the card number. |
data.info.syntax.lengths |
array |
The possible lengths of the card number. |
data.info.syntax.code.name |
string |
The name of the code (e.g: CVV). |
data.info.syntax.code.size |
integer |
The number of digits in the code. |
data.info.syntax.code |
object |
— |
data.info.syntax |
object |
— |
data.info.bank.id |
string |
Bank ID. |
data.info.bank.identifier |
string |
Bank identifier. |
data.info.bank.name |
string |
The official bank name. |
data.info.bank.city |
string |
The city where the bank's headquarters are located. |
data.info.bank.url |
string |
Bank URL of the official website. |
data.info.bank.phone |
string |
Bank phone number for contact. |
data.info.bank.logo |
string |
Bank logo URL (image). |
data.info.bank.latitude |
string |
Bank latitude coordinates of the country where the bank is located. |
data.info.bank.longitude |
string |
Bank longitude coordinates of the country where the bank is located. |
data.info.bank |
object |
— |
data.info.country.alpha2 |
string |
Country code (in ISO 3166-1 alpha-2 format). |
data.info.country.name |
string |
The Country name. |
data.info.country.code |
string |
Country dialing code. |
data.info.country.numeric |
string |
Country numeric code. |
data.info.country.emoji |
string |
Country flag emoji. |
data.info.country.continent |
string |
Continent where the country is located. |
data.info.country.languageCode |
string |
Country language code (in ISO 639-1 format). |
data.info.country.languageNative |
string |
Country native language name. |
data.info.country |
object |
— |
data.info |
object |
— |
data.custom_rules_applied.total |
integer |
The total number of custom rules applied to this request. |
data.custom_rules_applied.rules.id |
string |
The rule ID as shown in the dashboard (e.g: CR104).
|
data.custom_rules_applied.rules.title |
string |
The rule title you set when creating the rule. |
data.custom_rules_applied.rules |
object |
The custom rules applied to this request, learn more. |
data.custom_rules_applied |
object |
The custom rules applied to this request, learn more. |
data |
object |
— |
status |
string |
Response status (success, or error).
|
executionTime |
integer |
Time taken to process the data (in milliseconds). |
Found a mistake? Tell us on the contact page. Contact