Submit Card BIN Number for Masterpass REST
Submits the card BIN number captured by the Masterpass JS SDK. The BIN is used to identify the card type (bank, card type, available installment records). If the BIN cannot be matched in the BinNumber table, the system falls back to the default card configuration (DEFAULT_CARD_SLUG).
Required Fields:
bin_number: First 6 or 8 digits of the card. Must contain only digits.
Optional Fields:
is_masterpass_stored_card: Boolean flag indicating whether the card is being used from the user's Masterpass stored cards. Defaults tofalse.
Validation:
bin_numbermust be a 6 or 8 digit numeric string. A non-matching value returns the error"Please enter a valid bin number.".If the active payment option has
provision_enabled = trueand the resolved card is a debit card, a validation error is raised:"You can only use credit cards.".
State Update:
pre_order.card_infois set to aCardInfoobject containing thebin_numberand the resolvedcard.pre_order.data["is_masterpass_stored_card"]is set to the submitted flag.pre_order.data["is_mastercard"]is set based on the card type detected from the BIN (true when the card brand ismaster).
Backward Navigation:
On backward navigation, both
is_masterpass_stored_cardandis_mastercardkeys are removed frompre_order.data.
Next Pages:
MasterpassRemoteInstallmentPage— when the active payment option'sconfighas aninstallment_slugset (i.e., a remote installment service is configured for this Masterpass POS).MasterpassRestInstallmentPage— otherwise (default flow).
available_for_post_order: true
Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.
XMLHttpRequestPossible values: Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)
First 6 or 8 digits of the card (BIN - Bank Identification Number). Captured by the Masterpass JS SDK on the client side. Must contain only digits and have a length of 6 or 8.
542119Pattern: ^\d{6,8}$Flag indicating whether the card BIN comes from the user's stored
Masterpass cards. Stored on the pre-order as
pre_order.data["is_masterpass_stored_card"].
falseExample: falseBIN submitted successfully
POST /orders/checkout/?page=MasterpassRestBinNumberPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 57
"bin_number='542119'&is_masterpass_stored_card=false"BIN submitted successfully
{
"context_list": [
{
"page_name": "MasterpassRestInstallmentPage",
"page_slug": "masterpassrestinstallmentpage",
"page_context": {
"installments": [
{
"pk": 1,
"installment_count": 1,
"label": "Single Payment",
"price_with_accrued_interest": "159.99",
"monthly_price_with_accrued_interest": "159.99"
},
{
"pk": 2,
"installment_count": 3,
"label": "3 Installments",
"price_with_accrued_interest": "165.59",
"monthly_price_with_accrued_interest": "55.20"
}
],
"card_type": {
"name": "Master",
"slug": "master",
"logo": "https://cdn.akinon.com/logos/master.png"
},
"installment_messages": []
}
}
],
"pre_order": {
"basket": {
"pk": 123,
"total_amount": "150.00"
},
"payment_option": {
"pk": 7,
"name": "Masterpass",
"slug": "masterpass-rest",
"payment_type": "masterpass_rest",
"payment_type_label": "Masterpass"
},
"card_info": {
"bin_number": "542119",
"card": {
"pk": 1,
"name": "Master"
}
},
"data": {
"is_masterpass_stored_card": false,
"is_mastercard": true
},
"installment": null,
"total_amount": "159.99",
"currency_type_label": "TRY"
},
"errors": {},
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

