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

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 to false.

Validation:

  • bin_number must 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 = true and the resolved card is a debit card, a validation error is raised: "You can only use credit cards.".

State Update:

  • pre_order.card_info is set to a CardInfo object containing the bin_number and the resolved card.

  • 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 is master).

Backward Navigation:

  • On backward navigation, both is_masterpass_stored_card and is_mastercard keys are removed from pre_order.data.

Next Pages:

  • MasterpassRemoteInstallmentPage — when the active payment option's config has an installment_slug set (i.e., a remote installment service is configured for this Masterpass POS).

  • MasterpassRestInstallmentPage — otherwise (default flow).

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

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"].

Default: falseExample: false
Responses
200

BIN submitted successfully

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

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?