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

Get Saved Card Selection Page context

Returns the saved cards available for selection by the current user and active payment gateway. When the active payment gateway provides a hosted card selection interface, the response contains the data required to initialise that interface instead of the card list.

Preconditions:

  • Basket must not be empty.

  • The selected payment option must be a saved card type.

Gateway-Specific Page Context:

  • Standard gateways (SavedCardSelectionPageContext): Returns a cards list. Each entry includes a display name, masked card number, and a selection token.

  • Iyzico gateway (IyzicoSavedCardSelectionPageContext): Returns a ucs object instead of a card list. The ucs object contains the data required to initialise the Iyzico UCS hosted card selection widget: the customer's masked phone number, a UCS session token, the widget script URL, and the script type.

Step Completion: This page is considered already completed when all of the following are true:

  • Card information has been recorded, and

  • A card has been selected, and

  • The selected payment option is of saved card type.

available_for_post_order: false

get
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>)

Responses
200

Saved card selection page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=SavedCardSelectionPage
GET /orders/checkout/?page=SavedCardSelectionPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Accept: */*
200

Saved card selection page context retrieved

{
  "context_list": [
    {
      "page_name": "SavedCardSelectionPage",
      "page_slug": "savedcardselectionpage",
      "page_context": {
        "cards": [
          {
            "name": "My Visa",
            "masked_card_number": "411111******1111",
            "token": "card-token-abc123"
          }
        ]
      }
    }
  ],
  "pre_order": {
    "basket": {
      "pk": 123,
      "total_amount": "150.00"
    },
    "payment_option": {
      "pk": 3,
      "name": "Saved Card",
      "slug": "saved-card",
      "payment_type": "saved_card",
      "payment_type_label": "Saved Card"
    },
    "card_info": null
  },
  "errors": [],
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?