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

Apply the verified gift card as a reservation

Applies the verified gift card as a reservation on the order. The submitted amount is capped by the following rules (in order):

  1. Cannot exceed the card's available balance

  2. Cannot exceed the remaining unpaid order total

  3. Cannot exceed the remaining headroom under GIFT_CARD_CONFIG.max_amount_per_order after subtracting already-applied card amounts

After the reservation is created, the previously selected payment method is reset so the payment step is re-evaluated with the updated totals.

Required Fields:

  • amount: Decimal amount to apply (must be greater than zero)

Validation:

  • amount must be greater than zero

  • If the final capped amount resolves to zero, a validation error is returned

Backward Navigation:

  • Navigating backward clears the pending card from the session

Next Pages:

  • EmptyPage — the gift card sub-flow is complete

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
amountstring · decimalRequired

Decimal amount to apply from the gift card (12 digits, 2 decimal places). Must be greater than zero. The actual reserved amount may be lower after caps are applied: available balance, remaining unpaid order total, and the headroom under GIFT_CARD_CONFIG.max_amount_per_order.

Example: 100.00
Responses
200

Gift card applied as reservation

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

"amount='100.00'"
200

Gift card applied as reservation

{
  "context_list": [],
  "pre_order": {
    "user_email": "user@akinon.com",
    "total_amount": "250.00",
    "unpaid_amount": "150.00",
    "payment_option": null
  },
  "errors": {},
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?