BlogDataUpdated

A card brand has a code and a name

Card returns brand for application logic and brand_name for display. Keep network identification separate from issuer details and missing values.

American Express is a useful label to show in a table. amex is a useful value to compare in code. Asking one string to do both jobs makes each application maintain its own translation between a network key and a readable name.

The Card API returns both. Send the leading digits of a card number, often called its BIN or IIN, to identify the network and get its logo. In API 2.0.0, the brand comes from network prefix rules independently of issuer records. For the prefix 371449, the brand fields look like this response excerpt:

{
  "brand": "amex",
  "brand_name": "American Express"
}

Use brand when choosing an icon, grouping results, or comparing a value in application logic. Use brand_name when writing a label for someone to read. Turning amex into title case would give you "Amex", not the supplied display name. The difference is even clearer with unionpay and "China UnionPay".

Use the returned logo URL when you want the network's artwork. An interface that recognizes only a few networks can still show the returned name and logo without maintaining its own labels for every supported network.

The brand fields can also be null when the prefix is unknown or ambiguous. A short prefix identifies a network only when the rules agree across its possible completions. Leave the brand unspecified when they don't. The response supplies a generic card logo in that case.

Send the prefix

The endpoint accepts 2 to 11 leading ASCII digits. Only ASCII spaces, tabs, line breaks, and hyphens are removed, and the original input is limited to 64 characters. Keep it as a string so leading zeros survive, and send only the prefix supplied by your payment processor. Full card numbers are rejected.

The response's bin field is your normalized input. A request such as /card/51 can identify Mastercard without finding an issuer record. The basic response contains bin, brand, brand_name, and logo.

Add ?deep=true when you need recorded issuer, country, funding type, or prepaid details. Directory matching needs at least six digits; shorter inputs return null for those detail fields. deep.prefix is the longest recorded prefix that matched. An eight-digit input can have only a six-digit directory match, so the extra digits do not guarantee more specific issuer information. Requesting this detail leaves the core brand and logo unchanged and uses the same pooled request on every plan.

A network or issuer result does not establish that an individual card is active, belongs to someone, or will be accepted for payment. The Card reference covers the matching behavior and nullable fields. Use brand to choose behavior in your application and brand_name to explain the network to its reader.