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)
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);
}
}
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);
}
}
{
"Type": "BIN",
"Bin": "540006",
"IssuerCountryCode": "US",
"IssuingBank": "FIRST NATIONAL BANK OF OMAHA",
"BinData": [
{
"CardType": "CREDIT",
"CommercialIndicator": "PERSONAL",
"Subtype": "MIXED PRODUCT",
"Brand": "MASTERCARD"
}
]
}
{
"Type": "BIN",
"Bin": "47929300",
"IssuerCountryCode": "GB",
"IssuingBank": "SANTANDER UK PLC",
"BinData": [
{
"CardType": "CREDIT",
"CommercialIndicator": "COMMERCIAL",
"Subtype": "B2B",
"Brand": "VISA"
}
]
}
{
"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"
}
]
}
{
"Type": "GOOGLE_PAY",
"TokenFormat": "PAN_ONLY",
"Bin": "555555",
"CardType": "DEBIT",
"IssuerCountryCode": "BR",
"IssuingBank": "CIAGROUP",
"CommercialIndicator": "PERSONAL",
"BinData": [
{
"Subtype": "PREPAID",
"Brand": "MASTERCARD"
}
]
}
Metadata
Look up metadata for a payment method
POST
/
v2.01
/
{ClientId}
/
payment-methods
/
metadata
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)
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);
}
}
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);
}
}
{
"Type": "BIN",
"Bin": "540006",
"IssuerCountryCode": "US",
"IssuingBank": "FIRST NATIONAL BANK OF OMAHA",
"BinData": [
{
"CardType": "CREDIT",
"CommercialIndicator": "PERSONAL",
"Subtype": "MIXED PRODUCT",
"Brand": "MASTERCARD"
}
]
}
{
"Type": "BIN",
"Bin": "47929300",
"IssuerCountryCode": "GB",
"IssuingBank": "SANTANDER UK PLC",
"BinData": [
{
"CardType": "CREDIT",
"CommercialIndicator": "COMMERCIAL",
"Subtype": "B2B",
"Brand": "VISA"
}
]
}
{
"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"
}
]
}
{
"Type": "GOOGLE_PAY",
"TokenFormat": "PAN_ONLY",
"Bin": "555555",
"CardType": "DEBIT",
"IssuerCountryCode": "BR",
"IssuingBank": "CIAGROUP",
"CommercialIndicator": "PERSONAL",
"BinData": [
{
"Subtype": "PREPAID",
"Brand": "MASTERCARD"
}
]
}
Best practice – For BIN lookup, use an 8-digit version if availableAn 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.Body parameters
string
required
Allowed values:
BIN, GOOGLE_PAYThe type of metadata.string
Format: 6 or 8 digitsRequired if the
Type is BIN.The bank identification number (BIN).string
Required if the
Type is GOOGLE_PAY.The tokenized payment data provided by the third-party payment method.Responses
200 - BIN: 8 digits
200 - BIN: 8 digits
string
The type of metadata.
string
Format: 6 or 8 digitsThe bank identification number (BIN).
string
Format: Two-letter country code (ISO 3166-1 alpha-2 format)The country where the card was issued.
string
The name of the card issuer.
array
objectAdditional data about the card based on the BIN. In the case of co-branded card products, two objects are returned.
Show properties
Show properties
string
Returned values:
CREDIT, DEBIT, CHARGE CARDThe type of the card.string
Returned values:
PERSONAL, COMMERCIALWhether the card is held in a personal or commercial capacity.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.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.200 - BIN: 6 digits
200 - BIN: 6 digits
string
The type of metadata.
string
Format: 6 or 8 digitsThe bank identification number (BIN).
string
Format: Two-letter country code (ISO 3166-1 alpha-2 format)The country where the card was issued.
string
The name of the card issuer.
array
objectAdditional data about the card based on the BIN. In the case of co-branded card products, two objects are returned.
Show properties
Show properties
string
Returned values:
CREDIT, DEBIT, CHARGE CARDThe type of the card.string
Returned values:
PERSONAL, COMMERCIALWhether the card is held in a personal or commercial capacity.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.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.200 - Co-branded
200 - Co-branded
string
The type of metadata.
string
Format: 6 or 8 digitsThe bank identification number (BIN).
string
Format: Two-letter country code (ISO 3166-1 alpha-2 format)The country where the card was issued.
string
The name of the card issuer.
array
objectAdditional data about the card based on the BIN. In the case of co-branded card products, two objects are returned.
Show properties
Show properties
string
Returned values:
CREDIT, DEBIT, CHARGE CARDThe type of the card.string
Returned values:
PERSONAL, COMMERCIALWhether the card is held in a personal or commercial capacity.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.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.200 - Google Pay
200 - Google Pay
string
The type of metadata.
string
Returned values:
PAN_ONLY, CRYPTOGRAM_3DSIn 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.
string
Format: 6 or 8 digitsThe bank identification number (BIN).
string
Format: Two-letter country code (ISO 3166-1 alpha-2 format)The country where the card was issued.
string
The name of the card issuer.
array
objectAdditional data about the card based on the BIN. In the case of co-branded card products, two objects are returned.
Show properties
Show properties
string
Returned values:
CREDIT, DEBIT, CHARGE CARDThe type of the card.string
Returned values:
PERSONAL, COMMERCIALWhether the card is held in a personal or commercial capacity.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.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.{
"Type": "BIN",
"Bin": "540006",
"IssuerCountryCode": "US",
"IssuingBank": "FIRST NATIONAL BANK OF OMAHA",
"BinData": [
{
"CardType": "CREDIT",
"CommercialIndicator": "PERSONAL",
"Subtype": "MIXED PRODUCT",
"Brand": "MASTERCARD"
}
]
}
{
"Type": "BIN",
"Bin": "47929300",
"IssuerCountryCode": "GB",
"IssuingBank": "SANTANDER UK PLC",
"BinData": [
{
"CardType": "CREDIT",
"CommercialIndicator": "COMMERCIAL",
"Subtype": "B2B",
"Brand": "VISA"
}
]
}
{
"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"
}
]
}
{
"Type": "GOOGLE_PAY",
"TokenFormat": "PAN_ONLY",
"Bin": "555555",
"CardType": "DEBIT",
"IssuerCountryCode": "BR",
"IssuingBank": "CIAGROUP",
"CommercialIndicator": "PERSONAL",
"BinData": [
{
"Subtype": "PREPAID",
"Brand": "MASTERCARD"
}
]
}
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)
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);
}
}
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);
}
}
Was this page helpful?