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

Query available rewards for the Masterpass REST card

Submits the Masterpass card alias to the gateway and retrieves the list of available rewards. The returned reward list is stored in pre_order.rewards and used by the subsequent MasterpassRestRewardSelectionPage.

This is an independent page — submitting it does not advance the main checkout flow.

Required Fields:

  • card_alias: Alias of the Masterpass card the user wants to query rewards for. The alias is the value the Masterpass JS SDK uses to identify a stored card.

Processing:

  1. pre_order.rewards and pre_order.selected_rewards are reset to null.

  2. The Masterpass POS gateway is resolved through pre_order.get_pos_using_slug(). If no POS is found, the page is a no-op and rewards remains null.

  3. When enable_rewards is true and the gateway reports has_rewards(), gateway.query_rewards(...) is called with the current pre-order currency, the user, and the validated input data.

  4. The returned reward list is stored in pre_order.rewards.

Next Pages:

  • MasterpassRestRewardSelectionPage

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
card_aliasstringRequired

Alias of the Masterpass stored card to query rewards for. The alias is the value the Masterpass JS SDK uses to identify a card. The value is forwarded to gateway.query_rewards(...).

Example: MP-CARD-ALIAS-001
Responses
200

Rewards retrieved or empty list returned

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

"card_alias='MP-CARD-ALIAS-001'"
200

Rewards retrieved or empty list returned

{
  "context_list": [
    {
      "page_name": "MasterpassRestRewardSelectionPage",
      "page_slug": "masterpassrestrewardselectionpage",
      "page_context": {
        "rewards": [
          {
            "amount": "50.00",
            "type": "general"
          },
          {
            "amount": "30.00",
            "type": "special"
          }
        ]
      }
    }
  ],
  "pre_order": {
    "payment_option": {
      "pk": 7,
      "slug": "masterpass-rest",
      "payment_type": "masterpass_rest"
    },
    "rewards": [
      {
        "amount": "50.00",
        "type": "general"
      },
      {
        "amount": "30.00",
        "type": "special"
      }
    ]
  },
  "errors": {},
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?