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

# Look up metadata for a payment method

<Check>
  **Best practice – For BIN lookup, use an 8-digit version if available**

  An 8-digit BIN provides the most detailed and accurate data for card identification and assessment, and is becoming the industry standard. The 6-digit version continues to be used but provides less granular classification that may be ambiguous if 8-digit sub-ranges have been introduced by the issuer.

  A transaction's `CardInfo.BIN` property returns the 8-digit BIN if its available. In the Card object, the `Alias` only ever reveals the first 6 digits – the 8-digit version should be preferred.
</Check>

### Body parameters

<ParamField body="Type" type="string" required>
  **Allowed values:** `BIN`, `GOOGLE_PAY`

  The type of metadata.
</ParamField>

<ParamField body="Bin" type="string">
  Format: 6 or 8 digits

  Required if the `Type` is `BIN`.

  The bank identification number (BIN).
</ParamField>

<ParamField body="Token" type="string">
  Required if the `Type` is `GOOGLE_PAY`.

  The tokenized payment data provided by the third-party payment method.
</ParamField>

### Responses

<Accordion title="200 - BIN: 8 digits">
  <ResponseField name="Type" type="string">
    The type of metadata.
  </ResponseField>

  <ResponseField name="Bin" type="string">
    Format: 6 or 8 digits

    The bank identification number (BIN).
  </ResponseField>

  <ResponseField name="IssuerCountryCode" type="string">
    Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

    The country where the card was issued.
  </ResponseField>

  <ResponseField name="IssuingBank" type="string">
    The name of the card issuer.
  </ResponseField>

  <ResponseField name="BinData" type="array">
    object

    Additional data about the card based on the BIN. In the case of <a href="/guides/payment-methods/card/co-branded">co-branded card products</a>, two objects are returned.

    <Expandable title="properties">
      <ResponseField name="CardType" type="string">
        **Returned values:** `CREDIT`, `DEBIT`, `CHARGE CARD`

        The type of the card.
      </ResponseField>

      <ResponseField name="CommercialIndicator" type="string">
        **Returned values:** `PERSONAL`, `COMMERCIAL`

        Whether the card is held in a personal or commercial capacity.
      </ResponseField>

      <ResponseField name="SubType" type="string">
        The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc.

        **Note:** The possible returned values are numerous and liable to evolve over time.
      </ResponseField>

      <ResponseField name="Brand" type="string">
        The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc.

        **Note:** The possible returned values are numerous and liable to evolve over time.
      </ResponseField>
    </Expandable>
  </ResponseField>
</Accordion>

<AccordionGroup>
  <Accordion title="200 - BIN: 6 digits">
    <ResponseField name="Type" type="string">
      The type of metadata.
    </ResponseField>

    <ResponseField name="Bin" type="string">
      Format: 6 or 8 digits

      The bank identification number (BIN).
    </ResponseField>

    <ResponseField name="IssuerCountryCode" type="string">
      Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

      The country where the card was issued.
    </ResponseField>

    <ResponseField name="IssuingBank" type="string">
      The name of the card issuer.
    </ResponseField>

    <ResponseField name="BinData" type="array">
      object

      Additional data about the card based on the BIN. In the case of <a href="/guides/payment-methods/card/co-branded">co-branded card products</a>, two objects are returned.

      <Expandable title="properties">
        <ResponseField name="CardType" type="string">
          **Returned values:** `CREDIT`, `DEBIT`, `CHARGE CARD`

          The type of the card.
        </ResponseField>

        <ResponseField name="CommercialIndicator" type="string">
          **Returned values:** `PERSONAL`, `COMMERCIAL`

          Whether the card is held in a personal or commercial capacity.
        </ResponseField>

        <ResponseField name="SubType" type="string">
          The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc.

          **Note:** The possible returned values are numerous and liable to evolve over time.
        </ResponseField>

        <ResponseField name="Brand" type="string">
          The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc.

          **Note:** The possible returned values are numerous and liable to evolve over time.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Accordion>

  <Accordion title="200 - Co-branded">
    <ResponseField name="Type" type="string">
      The type of metadata.
    </ResponseField>

    <ResponseField name="Bin" type="string">
      Format: 6 or 8 digits

      The bank identification number (BIN).
    </ResponseField>

    <ResponseField name="IssuerCountryCode" type="string">
      Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

      The country where the card was issued.
    </ResponseField>

    <ResponseField name="IssuingBank" type="string">
      The name of the card issuer.
    </ResponseField>

    <ResponseField name="BinData" type="array">
      object

      Additional data about the card based on the BIN. In the case of <a href="/guides/payment-methods/card/co-branded">co-branded card products</a>, two objects are returned.

      <Expandable title="properties">
        <ResponseField name="CardType" type="string">
          **Returned values:** `CREDIT`, `DEBIT`, `CHARGE CARD`

          The type of the card.
        </ResponseField>

        <ResponseField name="CommercialIndicator" type="string">
          **Returned values:** `PERSONAL`, `COMMERCIAL`

          Whether the card is held in a personal or commercial capacity.
        </ResponseField>

        <ResponseField name="SubType" type="string">
          The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc.

          **Note:** The possible returned values are numerous and liable to evolve over time.
        </ResponseField>

        <ResponseField name="Brand" type="string">
          The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc.

          **Note:** The possible returned values are numerous and liable to evolve over time.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Accordion>

  <Accordion title="200 - Google Pay">
    <ResponseField name="Type" type="string">
      The type of metadata.
    </ResponseField>

    <ResponseField name="TokenFormat" type="string">
      **Returned values:** `PAN_ONLY`, `CRYPTOGRAM_3DS`

      In the case of Google Pay, the format of the `Token`.

      * `PAN_ONLY` – The card is registered in the Google account and requires 3DS authentication.
      * `CRYPTOGRAM_3DS` – The card is enrolled in the customer’s Google Wallet and authentication is handled by the Android device.
    </ResponseField>

    <ResponseField name="Bin" type="string">
      Format: 6 or 8 digits

      The bank identification number (BIN).
    </ResponseField>

    <ResponseField name="IssuerCountryCode" type="string">
      Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

      The country where the card was issued.
    </ResponseField>

    <ResponseField name="IssuingBank" type="string">
      The name of the card issuer.
    </ResponseField>

    <ResponseField name="BinData" type="array">
      object

      Additional data about the card based on the BIN. In the case of <a href="/guides/payment-methods/card/co-branded">co-branded card products</a>, two objects are returned.

      <Expandable title="properties">
        <ResponseField name="CardType" type="string">
          **Returned values:** `CREDIT`, `DEBIT`, `CHARGE CARD`

          The type of the card.
        </ResponseField>

        <ResponseField name="CommercialIndicator" type="string">
          **Returned values:** `PERSONAL`, `COMMERCIAL`

          Whether the card is held in a personal or commercial capacity.
        </ResponseField>

        <ResponseField name="SubType" type="string">
          The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc.

          **Note:** The possible returned values are numerous and liable to evolve over time.
        </ResponseField>

        <ResponseField name="Brand" type="string">
          The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc.

          **Note:** The possible returned values are numerous and liable to evolve over time.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200 - BIN: 6 digits   theme={null}
  {
      "Type": "BIN",
      "Bin": "540006",
      "IssuerCountryCode": "US",
      "IssuingBank": "FIRST NATIONAL BANK OF OMAHA",
      "BinData": [
          {
              "CardType": "CREDIT",
              "CommercialIndicator": "PERSONAL",
              "Subtype": "MIXED PRODUCT",
              "Brand": "MASTERCARD"
          }
      ]
  }  
  ```

  ```json 200 - BIN: 8 digits   theme={null}
  {
      "Type": "BIN",
      "Bin": "47929300",
      "IssuerCountryCode": "GB",
      "IssuingBank": "SANTANDER UK PLC",
      "BinData": [
          {
              "CardType": "CREDIT",
              "CommercialIndicator": "COMMERCIAL",
              "Subtype": "B2B",
              "Brand": "VISA"
          }
      ]
  }  
  ```

  ```json 200 - Co-branded theme={null}
  {
      "Type": "BIN",
      "Bin": "49735591",
      "IssuerCountryCode": "FR",
      "IssuingBank": "SOCIETE GENERALE, S.A.",
      "BinData": [
          {
              "CardType": null,
              "CommercialIndicator": null,
              "SubType": null,
              "Brand": "CB"
          },
          {
              "CardType": "DEBIT",
              "CommercialIndicator": "PERSONAL",
              "SubType": "CLASSIC",
              "Brand": "VISA"
          }
      ]
  }
  ```

  ```json 200 - Google Pay   theme={null}

  {
      "Type": "GOOGLE_PAY",
      "TokenFormat": "PAN_ONLY",
      "Bin": "555555",
      "CardType": "DEBIT",
      "IssuerCountryCode": "BR",
      "IssuingBank": "CIAGROUP",
      "CommercialIndicator": "PERSONAL",
      "BinData": [
          {
              "Subtype": "PREPAID",
              "Brand": "MASTERCARD"
          }
      ]
  }  
  ```
</ResponseExample>

<RequestExample>
  ```javascript NodeJS   theme={null}
  const mangopayInstance = require('mangopay4-nodejs-sdk');
  const mangopay = new mangopayInstance({
      clientId: "your-client-id",
      clientApiKey: "your-api-key",
  })

  let paymentMethod = {
    Type: 'BIN',
    Bin: '540006'
  }

  const getMetadata = async (paymentMethod) => {
    return await mangopay.PayIns.getPaymentMethodMetadata(paymentMethod)
      .then((response) => {
        console.info(response)
        return response
      })
      .catch((err) => {
        console.log(err)
        return false
      })
  }

  getMetadata(paymentMethod)  
  ```

  ```java Java   theme={null}
  import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  import com.mangopay.MangoPayApi;
  import com.mangopay.entities.PaymentMethodMetadata;

  public class LookUpMetadata {
      public static void main(String[] args) throws Exception {
          MangoPayApi mangopay = new MangoPayApi();
          mangopay.getConfig().setClientId("your-client-id");
          mangopay.getConfig().setClientPassword("your-api-key");
          
          PaymentMethodMetadata metadata = new PaymentMethodMetadata();
          metadata.setType("BIN");
          metadata.setBin("540006");

          PaymentMethodMetadata getMetadata = mangopay.getPayInApi().getPaymentMethodMetadata(metadata);

          Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
          String prettyJson = prettyPrint.toJson(getMetadata);

          System.out.println(prettyJson);
      }
  }
  ```

  ```csharp .NET  theme={null}
  using MangoPay.SDK;
  using MangoPay.SDK.Entities.POST;
  using Newtonsoft.Json;

  class Program
  {
      static async Task Main(string[] args)
      {
          MangoPayApi api = new MangoPayApi();

          api.Config.ClientId = "your-client-id";
          api.Config.ClientPassword = "your-api-key";

          var metadata = new PaymentMethodMetadataPostDTO
          {
              Type = "BIN",
              Bin = "47929300"
          };

          var getMetadata = await api.PayIns.GetPaymentMethodMetadataAsync(metadata);

          string prettyPrint = JsonConvert.SerializeObject(getMetadata, Formatting.Indented);
          Console.WriteLine(prettyPrint);
      }
  }
  ```
</RequestExample>
