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

Select Payment Option

Sets the selected payment option for the order.

Validation:

  • The selected payment option must be active

  • The selected payment option must pass its availability rules

Payment Option Processing:

  • If payment option is pay-on-delivery type, installment and card_info are cleared

  • Previous MobilExpress data (keys starting with me_) is cleared

  • Payment choice is reset

Next Pages: Based on the selected payment option type, the user is routed to the appropriate page:

  • credit_card: BinNumberPage (enter card bin number)

  • funds_transfer: FundsTransferChoicePage (select bank account)

  • bkm_express: BexSelectionPage (BKM Express flow)

  • loyalty_money: LoyaltyMoneyPage (use loyalty points)

  • cash_register: CashRegisterPage (cash register payment)

  • gpay: GPaySelectionPage (Google Pay flow)

  • redirection: RedirectionPaymentSelectedPage (redirect to payment provider)

  • stored_card: MobilExpressSelectionPage (use stored card)

  • masterpass: MasterpassBinNumberPage (Masterpass flow)

  • masterpass_rest: MasterpassRestBinNumberPage (Masterpass REST API flow)

  • credit_payment: CreditPaymentSelectionPage (credit/installment payment)

  • pay_later: PayLaterCompletePage (buy now pay later)

  • saved_card: SavedCardSelectionPage (use saved card)

  • confirmation: ConfirmationPaymentAgreementCheckPage (confirmation required)

  • b2b: B2BPage (B2B payment)

  • wallet: WalletSelectionPage (digital wallet)

  • pay_on_delivery: If multiple payment choices available: PayOnDeliveryPaymentChoicePage, otherwise: PayOnDeliveryPage

  • gift_card: GiftCardPaymentPage (complete order fully covered by gift cards)

Partial gift card payment: When gift cards are applied but do not fully cover the order, the user selects a regular payment option here. Selecting a non-gift-card payment type does not remove the applied gift card reservations. During order placement, the gift card amounts are charged first; the remaining balance is charged to the selected payment method.

Cascading Invalidation:

  • Selecting a new payment option clears previous payment-related data

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
payment_optionintegerRequired

Primary key of the selected payment option. Must be an active payment option that passes availability rules.

Responses
200

Payment option selected successfully

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=PaymentOptionSelectionPage
POST /orders/checkout/?page=PaymentOptionSelectionPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 20

"payment_option=1"
200

Payment option selected successfully

{
  "context_list": [
    {
      "page_name": "BinNumberPage",
      "page_slug": "binnumberpage",
      "page_context": {}
    }
  ],
  "pre_order": {
    "basket": {
      "pk": 123,
      "total_amount": "150.00"
    },
    "shipping_address": {
      "pk": 10,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@akinon.com",
      "phone_number": "+15551234567",
      "line": "123 Main St",
      "country": {
        "pk": 1,
        "code": "US",
        "name": "United States"
      },
      "city": {
        "pk": 1,
        "name": "New York"
      },
      "township": {
        "pk": 1,
        "name": "Manhattan"
      }
    },
    "billing_address": {
      "pk": 10,
      "first_name": "John",
      "last_name": "Doe"
    },
    "billing_and_shipping_same": true,
    "delivery_option": {
      "pk": 1,
      "name": "Home Delivery",
      "slug": "home-delivery",
      "delivery_option_type": "customer",
      "sort_order": 1
    },
    "shipping_option": {
      "pk": 1,
      "name": "Standard Shipping",
      "slug": "standard-shipping",
      "logo": "https://cdn.akinon.com/logos/standard.png",
      "shipping_amount": "9.99",
      "description": "Delivery in 3-5 business days",
      "kwargs": {}
    },
    "shipping_amount": "9.99",
    "payment_option": {
      "pk": 1,
      "name": "Credit Card",
      "slug": "credit-card",
      "payment_type": "credit_card",
      "payment_type_label": "Credit Card"
    },
    "notifications": [],
    "total_amount": "159.99",
    "unpaid_amount": "159.99",
    "loyalty_money": null,
    "currency_type_label": "USD",
    "installment": null,
    "redirect_to_three_d": null,
    "retail_store": null,
    "payment_choice": null,
    "user_email": "john@akinon.com",
    "phone_number": "+15551234567",
    "user_phone_number": "+15551234567",
    "gift_box": null,
    "delivery_range": null,
    "total_amount_with_interest": "159.99",
    "is_guest": false,
    "is_post_order": false,
    "data_source_shipping_options": null,
    "attribute_based_shipping_options": null
  },
  "errors": {},
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?