Card schemes
The Humo or Uzcard logo from the first digits of a card number
While a customer types the card number, its first digits (the BIN) are enough to show the logo of the card scheme. The API returns the scheme and links to its SVG logos.
Detecting by BIN
Detects the scheme by the first 4-8 digits of the card number so you can show the logo while the user types
the number. No token, limit: 300 requests per minute per IP. An unknown BIN is not an error: the response has
scheme: null. More than 8 digits are rejected: never send the full card number here.
Query Parameters
The first 4-8 digits of the card number
^\d{4,8}$Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/public/v1/card-schemes/detect?bin=string"{ "success": true, "meta": { "requestId": "string", "timestamp": "2019-08-24T14:15:22Z", "processingTimeMs": 0 }, "data": { "scheme": { "code": "string", "name": "string", "logos": { "color": "http://example.com", "mono": "http://example.com" } } }}- Send the first 4 to 8 digits. The API rejects more than 8: never send the full card number here.
- The public method needs no token, so you can call it straight from a browser or a mobile app. Limit: 300 requests per minute per IP.
- An unknown scheme still returns
200, withschemeset tonull. Show a neutral card icon. - To avoid a request per digit, call it after 4 digits with a 200-300 ms delay and cache the answer by BIN.
const cache = new Map();
let timer;
cardInput.addEventListener('input', () => {
const bin = cardInput.value.replace(/\D/g, '').slice(0, 8);
clearTimeout(timer);
if (bin.length < 4) return showLogo(null);
timer = setTimeout(async () => {
if (!cache.has(bin)) {
const response = await fetch(`https://splitpay-api.buzzi.uz/public/v1/card-schemes/detect?bin=${bin}`);
cache.set(bin, (await response.json()).data.scheme);
}
showLogo(cache.get(bin));
}, 250);
});
function showLogo(scheme) {
logo.hidden = !scheme;
if (scheme) {
logo.src = scheme.logos.color;
logo.alt = scheme.name;
}
}From your server, make the same request under the merchant token with GET /v1/card-schemes/detect.
The key's shared limit then applies.
Same as the public GET /public/v1/card-schemes/detect, but under the merchant token and its shared limit. For calls from your server.
Authorization
bearer In: header
Query Parameters
The first 4-8 digits of the card number
^\d{4,8}$Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/card-schemes/detect?bin=string"{ "success": true, "meta": { "requestId": "string", "timestamp": "2019-08-24T14:15:22Z", "processingTimeMs": 0 }, "data": { "scheme": { "code": "string", "name": "string", "logos": { "color": "http://example.com", "mono": "http://example.com" } } }}Logos
All supported card schemes with logos. No token: suitable for calling straight from a browser or an app. Limit: 300 requests per minute per IP.
Response Body
application/json
application/json
curl -X GET "https://example.com/public/v1/card-schemes"{ "success": true, "meta": { "requestId": "string", "timestamp": "2019-08-24T14:15:22Z", "processingTimeMs": 0 }, "data": [ { "code": "string", "name": "string", "logos": { "color": "http://example.com", "mono": "http://example.com" } } ]}An SVG with a viewBox: scales to any size without losing quality. Take the link from logos
in the responses - it carries the file version (v), so the response is cached forever, and after the logo is replaced
the link changes by itself. variant=mono is a single-colour version for dark backgrounds; if there is none,
the colour one is returned.
Path Parameters
Query Parameters
"color"Value in
- "color"
- "mono"
File version from the link in logos
Response Body
image/svg+xml
application/json
application/json
curl -X GET "https://example.com/public/v1/card-schemes/string/logo.svg""string"- A logo is an SVG with a
viewBox, so you choose the size:<img src="…" height="24">or CSSheight: 24px; width: auto. The proportions are kept and it stays sharp on any screen. logos.coloris the main version.logos.monois single-colour, for dark backgrounds; if a scheme has none, the link points to the colour one.- Take the links from the API response instead of building them. A link carries the file version (
v), so the logo is cached forever, and the link changes when the logo is replaced. GET /public/v1/card-schemeslists all schemes, for an "We accept Humo and Uzcard" line ahead of time.
Scheme of a saved card
Every card in Partner API responses has a scheme field, detected from the first digits of the mask.
There is no need to ask for it separately.
{
"id": "0f8d3c1e-…",
"mask": "860012******9012",
"scheme": {
"code": "UZCARD",
"name": "Uzcard",
"logos": {
"color": "https://splitpay-api.buzzi.uz/public/v1/card-schemes/UZCARD/logo.svg?v=3f9a1c0b7d2e4a68",
"mono": "https://splitpay-api.buzzi.uz/public/v1/card-schemes/UZCARD/logo.svg?variant=mono&v=8b1e0f5a2c9d3e71"
}
}
}
SplitPay