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):
Cannot exceed the card's available balance
Cannot exceed the remaining unpaid order total
Cannot exceed the remaining headroom under
GIFT_CARD_CONFIG.max_amount_per_orderafter 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:
amountmust be greater than zeroIf 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
Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.
XMLHttpRequestPossible values: Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)
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.
100.00Gift card applied as reservation
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'"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?

