> ## Documentation Index
> Fetch the complete documentation index at: https://docs.greip.io/llms.txt
> Use this file to discover all available pages before exploring further.

# BIN/IIN Lookup

> Utilize this module to effortlessly retrieve comprehensive information associated with a debit or credit card.

The API provides details such as card type (debit or credit), scheme (Visa, Mastercard, etc.), brand (gold, platinum, etc.), and bank information.

This data is invaluable for various applications, including verifying customer payment details, detecting fraudulent transactions, and delivering personalized services to enhance user experiences. 

export const MCPCallout = () => {
  return <div class="callout my-4 px-5 py-4 overflow-hidden rounded-2xl flex gap-3 border border-[rgba(192, 132, 252, 0.2)] bg-[rgba(192, 132, 252, 0.1)] dark:border-[#c084fc4d] dark:bg-[#c084fc1a] text-[#6005BB] dark:text-[#FFFFFF]" data-callout-type="callout">
      <div class="mt-0.5 w-4" data-component-part="callout-icon">
        <svg class="h-4 w-4 !m-0 shrink-0 bg-[#c084fc] [mask-image:url('https://d3gk2c5xim1je2.cloudfront.net/v7.1.0/duotone/fire.svg')] [-webkit-mask-image:url('https://d3gk2c5xim1je2.cloudfront.net/v7.1.0/duotone/fire.svg')] [mask-repeat:no-repeat] [-webkit-mask-repeat:no-repeat] [mask-position:center] [-webkit-mask-position:center]"></svg>
      </div>
      <div class="text-sm prose dark:prose-invert min-w-0 w-full [&_kbd]:bg-background-light dark:[&_kbd]:bg-background-dark text-[#6005BB] dark:text-[#FFFFFF]" data-component-part="callout-content">
        <span data-as="p">
          Want to skip the docs? Use the{" "}
          <a class="link mint-text-xs border-[#C792FC]" href="/docs-mcp-server">
            <b>MCP Server</b>
          </a>
        </span>
      </div>
    </div>;
};

export const Availability = ({plan, color}) => {
  const colorMap = {
    green: "text-green-700 dark:text-green-400",
    blue: "text-blue-700 dark:text-blue-400",
    purple: "text-purple-700 dark:text-purple-400"
  };
  return <div dir="ltr" data-orientation="horizontal" class="p-4 px-5 mt-0 md:mt-4 flex flex-col sm:flex-row flex-wrap gap-2 relative overflow-hidden rounded-2xl border border-gray-950/10 dark:border-white/10 my-0 bg-gray-50 dark:bg-white/5 dark:codeblock-dark text-gray-950 dark:text-gray-50 codeblock-light text-sm prose prose-gray dark:prose-invert font-semibold no-wrap-words">
      Endpoint availability:{" "}
      <span class={` ${colorMap[color]} flex-1`}>{plan}</span>
      <a class="custom-link text-xs" href="https://greip.io/detailed-pricing">
        Learn more
      </a>
    </div>;
};

### Overview

The IIN (Issuer Identification Number), also known as the BIN (Bank Identification Number), is the first 6 digits of a debit or credit card number. These unique numbers are used to identify the issuing entity, such as the bank or financial institution that issued the card.

One of the most common and critical use cases of this method is to detect and prevent fraud payments in your app or website. This is an essential task for any business that accepts online payments, as fraud can lead to significant financial losses and reputational damage.

For example, based on of our case studies, if you notice a user from the UK purchasing large amounts of your product, and the card used for payment is issued by a bank located in the US, this could be a red flag. This may indicate that the user is using a stolen or fraudulent card to complete the checkout process. By flagging such transactions for review or rejection, you can prevent fraud and protect your business from financial loss.

### Query Parameters

<ParamField query="bin" type="string" placeholder="The BIN" required>
  The BIN/IIN of the card (min: 6 digits).

  Sample value: `456789`, `456789XXXXXX1234`, or `4567891234567890`.
</ParamField>

<ParamField query="format" type="string" default="JSON" placeholder="Response format">
  The format command is used to get a response in a specific format.

  Expected values: `JSON`, `XML`, `CSV`, or `Newline`

  For more information please refer to [Response Format](/options/response-format).
</ParamField>

<ParamField query="mode" type="string" default="live" placeholder="Environment">
  The mode command is used to in the development stage to simulate the integration process before releasing it to the production environment.

  Expected values: `live`, or `test`.

  For more information please refer to [Development Environment](/options/development-environment).
</ParamField>

<ParamField query="userID" type="string" placeholder="User Identifier">
  The userID command can be used to identify requests sent by specific users to monitor in the [Events Page](/dashboard-guides/monitoring-capabilities/real-time-threat-monitoring).

  Expected values: email address, phone number, user id, name, etc.

  For more information please refer to [User Identifier](/options/user-identifier).
</ParamField>

<ParamField query="callback" type="string" placeholder="JSONP callback">
  The callback command can help you make the response as a JSONP format.

  Expected values: any name that can be used as a function name in Javascript, e.g: `myFunctionName`.

  For more information please refer to [JSONP Callback](/options/jsonp-callback).
</ParamField>

<Panel>
  <MCPCallout />

  <Availability plan="Standard and above" color="blue" />

  <ResponseExample>
    ```json Success theme={null}
    {
      "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://greip.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
    }
    ```

    ```json Error theme={null}
    {
      "status": "error",
      "code": 101,
      "type": "invalid_key",
      "description": "The API Key is missing or invalid."
    }
    ```
  </ResponseExample>
</Panel>

### Response properties

<ResponseField name="data" type="object" required>
  <Expandable title="properties" defaultOpen={true}>
    <ResponseField name="reason" type="string" required>
      Reason for the validation result.
    </ResponseField>

    <ResponseField name="isValid" type="boolean" required>
      Validation result (`true` or `false`).
    </ResponseField>

    <ResponseField name="blacklisted" type="boolean" required>
      Indicates if the BIN is blacklisted due to applying [custom
      rules](/knowledge-base/custom-rules/overview) or were found in one of your
      blacklists.
    </ResponseField>

    <ResponseField name="bin" type="string" required>
      The BIN/IIN of the card you passed in the request.
    </ResponseField>

    <ResponseField name="info" type="object" required>
      <Expandable title="properties" defaultOpen={true}>
        <ResponseField name="scheme" type="object" required>
          <Expandable title="properties" defaultOpen={true}>
            <ResponseField name="name" type="object" required>
              Card scheme name.
            </ResponseField>

            <ResponseField name="coName" type="object" required>
              Card company name.
            </ResponseField>

            <ResponseField name="isLuha" type="boolean" required>
              Is the card issued by Luha?
            </ResponseField>

            <ResponseField name="isPrepaid" type="boolean" required>
              Is the card prepaid?
            </ResponseField>

            <ResponseField name="isCommercial" type="boolean" required>
              Is the card commercial?
            </ResponseField>

            <ResponseField name="type" type="string" required>
              Card type (`debit`, or `credit`).
            </ResponseField>

            <ResponseField name="brand" type="string" required>
              Card brand (`Traditional`, `Gold`, `Platinum`, etc.).
            </ResponseField>

            <ResponseField name="currency" type="string" required>
              Card currency.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="detected_digits" type="string" required>
          The digits used to detect the scheme details.
        </ResponseField>

        <ResponseField name="syntax" type="object" required>
          <Expandable title="properties" defaultOpen={true}>
            <ResponseField name="gaps" type="array" required>
              The gaps variations of the card number.
            </ResponseField>

            <ResponseField name="lengths" type="array" required>
              The possible lengths of the card number.
            </ResponseField>

            <ResponseField name="code" type="object" required>
              <Expandable title="properties" defaultOpen={true}>
                <ResponseField name="name" type="string" required>
                  The name of the code (e.g: CVV).
                </ResponseField>

                <ResponseField name="size" type="integer" required>
                  The number of digits in the code.
                </ResponseField>
              </Expandable>
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="bank" type="object" required>
          <Expandable title="properties" defaultOpen={true}>
            <ResponseField name="id" type="string" required>
              Bank ID.
            </ResponseField>

            <ResponseField name="identifier" type="string" required>
              Bank identifier.
            </ResponseField>

            <ResponseField name="name" type="string" required>
              The official bank name.
            </ResponseField>

            <ResponseField name="city" type="string" required>
              The city where the bank's headquarters are located.
            </ResponseField>

            <ResponseField name="url" type="string" required>
              Bank URL of the official website.
            </ResponseField>

            <ResponseField name="phone" type="string" required>
              Bank phone number for contact.
            </ResponseField>

            <ResponseField name="logo" type="string" required>
              Bank logo URL (image).
            </ResponseField>

            <ResponseField name="latitude" type="string" required>
              Bank latitude coordinates of the country where the bank is
              located.
            </ResponseField>

            <ResponseField name="longitude" type="string" required>
              Bank longitude coordinates of the country where the bank is
              located.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="country" type="object" required>
          <Expandable title="properties" defaultOpen={true}>
            <ResponseField name="alpha2" type="string" required>
              Country code (in ISO 3166-1 alpha-2 format).
            </ResponseField>

            <ResponseField name="name" type="string" required>
              The Country name.
            </ResponseField>

            <ResponseField name="code" type="string" required>
              Country dialing code.
            </ResponseField>

            <ResponseField name="numeric" type="string" required>
              Country numeric code.
            </ResponseField>

            <ResponseField name="emoji" type="string" required>
              Country flag emoji.
            </ResponseField>

            <ResponseField name="continent" type="string" required>
              Continent where the country is located.
            </ResponseField>

            <ResponseField name="languageCode" type="string" required>
              Country language code (in ISO 639-1 format).
            </ResponseField>

            <ResponseField name="languageNative" type="string" required>
              Country native language name.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="custom_rules_applied" type="object">
      The custom rules applied to this request, [learn
      more](/knowledge-base/custom-rules/overview).

      <Expandable title="properties" defaultOpen={true}>
        <ResponseField name="total" type="integer" required>
          The total number of custom rules applied to this request.
        </ResponseField>

        <ResponseField name="rules" type="object" required>
          The custom rules applied to this request, [learn
          more](/knowledge-base/custom-rules/overview).

          <Expandable title="properties" defaultOpen={true}>
            <ResponseField name="id" type="string" required>
              The rule ID as shown in the dashboard (e.g: `CR104`).
            </ResponseField>

            <ResponseField name="title" type="string" required>
              The rule title you set when creating the rule.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="status" type="string" required>
  Response status (`success`, or `error`).
</ResponseField>

<ResponseField name="executionTime" type="integer" required>
  Time taken to process the data (in milliseconds).
</ResponseField>
