For the complete documentation index, see llms.txt. This page is also available as Markdown.

Submit Card BIN Number for Masterpass

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 database, the system falls back to the default card configuration.

Required Fields:

  • bin_number: First 6 or 8 digits of the card. Must contain only digits.

Optional Fields:

  • is_masterpass_stored_card: Indicates whether the card is from the user's stored Masterpass cards. Defaults to false.

Validation:

  • bin_number must be a 6 or 8 digit numeric string. A non-matching value returns "Please enter a valid bin number.".

  • When the active payment option has provisioning enabled and the resolved card is a debit card, the submission is rejected with "You can only use credit cards.".

State Update:

  • Card information is stored, containing the submitted BIN and the resolved card record.

  • The stored card flag and the detected card brand (Mastercard or not) are saved to the session.

Backward Navigation:

  • On backward navigation, the stored card flag and the card brand indicator are removed from the session.

Next Page:

  • MasterpassInstallmentPage

available_for_post_order: true

post
Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Body
bin_numberstringRequired

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.

Example: 542119Pattern: ^\d{6,8}$
is_masterpass_stored_cardbooleanOptional

Indicates whether the card BIN comes from the user's stored Masterpass cards. Saved to the session so later steps can distinguish stored-card and fresh-card flows.

Default: falseExample: false
Responses
200

BIN submitted successfully

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=MasterpassBinNumberPage
POST /orders/checkout/?page=MasterpassBinNumberPage 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"
200

BIN submitted successfully

{
  "context_list": [
    {
      "page_name": "MasterpassInstallmentPage",
      "page_slug": "masterpassinstallmentpage",
      "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": 5,
      "name": "Masterpass",
      "slug": "masterpass",
      "payment_type": "masterpass",
      "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?