Look up card information by BIN
Last updated:
The getBinInfo method returns the brand, type, country, and issuing bank of a card from its BIN — the first 6 to 8 digits of the PAN. Use it to prevalidate destinations before submitting a card payout, to display issuer details to operators reviewing manual disbursements, or to gate features by country and card type.
When to use it
- Before createPayout with
paymentType=card— reject ineligible destinations (prepaid, sanctioned-country issuers, virtual cards) before they consume a payout limit. - Operator UIs — show the issuing bank and country alongside a masked PAN so operators can spot mismatches against the beneficiary record.
- Feature gating — restrict cross-border card payouts to specific issuer countries per your AML risk appetite.
BIN lookup is informational only. A successful lookup does not guarantee the card is open, has sufficient funds, or will accept a payout — the destination rail still validates at submission.
Endpoint
Send the request to https://api.unitpay.net/api. POST over TLS is required.
Required parameters
| Parameter | Type | Description |
|---|---|---|
method | string | Always getBinInfo. |
params[bin] | string | First 6, 7, or 8 digits of the PAN. Pass digits only — no spaces, dashes, or grouping. UnitPay never requires the full PAN for BIN lookup. |
params[secretKey] | string | Project secret key. Send only via TLS in the POST body. |
Example request
POST https://api.unitpay.net/api
Content-Type: application/x-www-form-urlencoded
method=getBinInfo
¶ms[bin]=455673
¶ms[secretKey]=<your-project-secret-key>
Successful response
{
"result": {
"bin": "455673",
"brand": "visa",
"type": "credit",
"category": "consumer",
"country": "ID",
"countryName": "Indonesia",
"currency": "IDR",
"bankName": "Bank Central Asia",
"bankBicCode": "CENAIDJA",
"supports": {
"payout": true,
"threeDSecure": true
}
}
}
| Field | Description |
|---|---|
brand | One of visa, mastercard, jcb, amex, unionpay, or discover. |
type | One of credit, debit, prepaid, or charge. |
category | One of consumer, business, corporate, or commercial. Useful when commercial-card surcharges apply. |
country | ISO 3166-1 alpha-2 issuer country. Pair with currency for cross-border decisions. |
bankName | Issuing bank's display name. May be empty for niche issuers; bankBicCode is the stable identifier. |
supports.payout | true if the issuer typically accepts inbound card payouts on this BIN range. A false here means createPayout with this card will likely fail with code -32104. |
supports.threeDSecure | Whether the issuer participates in 3-D Secure 2.0 for inbound charges. Informational; payouts do not trigger 3-DS. |
Error response
{
"error": {
"message": "BIN not found.",
"code": -32200
}
}
| code | Meaning |
|---|---|
-32000 | Invalid secret key. |
-32200 | BIN not found in any data source. Treat the destination as unknown — do not assume any default issuer attributes. |
-32201 | BIN format invalid (fewer than 6 digits, more than 8 digits, or non-digit characters). |
-32202 | Rate limit exceeded for this project. Cache the response client-side; see below. |
Caching and freshness
- BIN data changes slowly; caching responses by
binkey for up to 30 days is appropriate for most use cases. - BIN ranges are occasionally reassigned between issuers and acquirers. Bust your cache after a confirmed wrong-issuer event — do not assume cached entries are immutable.
- Per-project rate limit is 100 requests/min. The limit is generous for prevalidation traffic but does not allow bulk-scanning of BIN ranges.
Privacy and PCI considerations
BINs (the first 6–8 digits) are not personally identifying and fall outside PCI DSS cardholder data — you can log and cache them without invoking PCI scope. Never send the full PAN to getBinInfo; UnitPay rejects requests with more than 8 digits with error -32201, but the safer practice is to truncate at the call site so a full PAN never crosses your application boundary.
Test mode
Test-mode keys query the same BIN database as production. There is no separate sandbox dataset; lookups are deterministic and idempotent.
Next steps
- Create a payout — submit the destination after BIN prevalidation passes.
- Get payout information — check the final state of a card payout once submitted.
Metode getBinInfo mengembalikan brand, tipe, negara, dan bank penerbit kartu dari BIN-nya — 6 hingga 8 digit pertama PAN. Gunakan untuk pravalidasi tujuan sebelum mengirim pencairan kartu, untuk menampilkan detail penerbit kepada operator yang meninjau pencairan manual, atau untuk membatasi fitur berdasarkan negara dan tipe kartu.
Kapan menggunakannya
- Sebelum createPayout dengan
paymentType=card— tolak tujuan yang tidak memenuhi syarat (kartu prabayar, penerbit dari negara terkena sanksi, kartu virtual) sebelum mereka memakai kuota batas pencairan. - UI operator — tampilkan bank penerbit dan negara di samping PAN tersamar agar operator dapat menemukan ketidakcocokan terhadap data penerima.
- Pembatasan fitur — batasi pencairan kartu lintas-batas pada negara penerbit tertentu sesuai selera risiko AML Anda.
Pencarian BIN bersifat informatif. Pencarian yang berhasil tidak menjamin kartu masih aktif, memiliki dana cukup, atau akan menerima pencairan — saluran tujuan tetap memvalidasi saat pengiriman.
Endpoint
Kirim permintaan ke https://api.unitpay.net/api. POST melalui TLS wajib digunakan.
Parameter wajib
| Parameter | Tipe | Deskripsi |
|---|---|---|
method | string | Selalu getBinInfo. |
params[bin] | string | 6, 7, atau 8 digit pertama PAN. Kirim hanya digit — tanpa spasi, tanda hubung, atau pengelompokan. UnitPay tidak pernah memerlukan PAN penuh untuk pencarian BIN. |
params[secretKey] | string | Kunci rahasia proyek. Kirim hanya melalui TLS dalam body POST. |
Contoh permintaan
POST https://api.unitpay.net/api
Content-Type: application/x-www-form-urlencoded
method=getBinInfo
¶ms[bin]=455673
¶ms[secretKey]=<your-project-secret-key>
Respons sukses
{
"result": {
"bin": "455673",
"brand": "visa",
"type": "credit",
"category": "consumer",
"country": "ID",
"countryName": "Indonesia",
"currency": "IDR",
"bankName": "Bank Central Asia",
"bankBicCode": "CENAIDJA",
"supports": {
"payout": true,
"threeDSecure": true
}
}
}
| Field | Deskripsi |
|---|---|
brand | Salah satu dari visa, mastercard, jcb, amex, unionpay, atau discover. |
type | Salah satu dari credit, debit, prepaid, atau charge. |
category | Salah satu dari consumer, business, corporate, atau commercial. Berguna ketika biaya tambahan kartu komersial berlaku. |
country | Negara penerbit ISO 3166-1 alpha-2. Padukan dengan currency untuk keputusan lintas-batas. |
bankName | Nama tampilan bank penerbit. Dapat kosong untuk penerbit niche; bankBicCode adalah identifier yang stabil. |
supports.payout | true jika penerbit umumnya menerima pencairan kartu masuk pada rentang BIN ini. Nilai false berarti createPayout dengan kartu ini kemungkinan gagal dengan kode -32104. |
supports.threeDSecure | Apakah penerbit ikut serta dalam 3-D Secure 2.0 untuk pembebanan masuk. Bersifat informatif; pencairan tidak memicu 3-DS. |
Respons error
{
"error": {
"message": "BIN tidak ditemukan.",
"code": -32200
}
}
| code | Arti |
|---|---|
-32000 | Kunci rahasia tidak valid. |
-32200 | BIN tidak ditemukan di sumber data manapun. Anggap tujuan tidak diketahui — jangan asumsikan atribut penerbit default. |
-32201 | Format BIN tidak valid (kurang dari 6 digit, lebih dari 8 digit, atau berisi karakter non-digit). |
-32202 | Batas tarif terlampaui untuk proyek ini. Cache respons di sisi klien; lihat di bawah. |
Cache dan kesegaran data
- Data BIN berubah perlahan; menyimpan respons cache berdasarkan kunci
binhingga 30 hari sesuai untuk sebagian besar kasus. - Rentang BIN sesekali dialihkan antar penerbit dan acquirer. Bersihkan cache setelah peristiwa wrong-issuer yang terkonfirmasi — jangan asumsikan entri cache tidak dapat berubah.
- Batas tarif per-proyek adalah 100 permintaan/menit. Batas ini cukup untuk trafik pravalidasi tetapi tidak mengizinkan pemindaian massal rentang BIN.
Privasi dan PCI
BIN (6–8 digit pertama) bukan data identifikasi pribadi dan berada di luar lingkup data pemegang kartu PCI DSS — Anda dapat mencatat dan men-cache BIN tanpa memicu lingkup PCI. Jangan pernah mengirim PAN penuh ke getBinInfo; UnitPay menolak permintaan dengan lebih dari 8 digit dengan kode error -32201, namun praktik yang lebih aman adalah memotong di tempat pemanggilan agar PAN penuh tidak pernah melewati batas aplikasi Anda.
Mode uji
Kunci mode uji mengkueri basis data BIN yang sama dengan produksi. Tidak ada dataset sandbox terpisah; pencarian bersifat deterministik dan idempoten.
Langkah selanjutnya
- Membuat pencairan dana — kirim tujuan setelah pravalidasi BIN lulus.
- Informasi pencairan dana — periksa status final pencairan kartu setelah dikirim.