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

Update the reserved amount of an applied gift card

Updates the amount for the reservation identified by card_number_hash. The balance is read from cache to avoid a gateway round-trip.

The new amount is subject to the same caps as the apply step, with one adjustment: the card's current reserved amount is temporarily added back to the unpaid total so the calculation treats it as if the card were not yet applied.

  1. Cannot exceed the cached available balance

  2. Cannot exceed the unpaid total (including this card's current amount)

  3. Cannot push the cumulative gift card total above GIFT_CARD_CONFIG.max_amount_per_order

After the update, the previously selected payment method is reset so the payment step is re-evaluated.

Cache expiry: If the cached balance has expired, the reservation is automatically removed. The response returns an error asking the user to re-add the card.

Required Fields:

  • card_number_hash: Hash identifying the reservation to update (max 255 chars)

  • new_amount: New desired amount (decimal, must be greater than zero)

Validation:

  • new_amount must be greater than zero

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

  • If card_number_hash is not found among the applied cards, a validation error is returned

Next Pages:

  • EmptyPage

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_number_hashstring · max: 255Required

Hash of the gift card number identifying the reservation to update. Obtained from card_number_hash in the applied cards list returned by the Gift Card Page.

Example: abc123hash
new_amountstring · decimalRequired

New desired reserved amount (12 digits, 2 decimal places). Must be greater than zero. Subject to the same cap rules as the apply step, adjusted so the card's current reserved amount is treated as if it were not yet applied.

Example: 75.00
Responses
200

Gift card reservation amount updated

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

"card_number_hash='abc123hash'&new_amount='75.00'"
200

Gift card reservation amount updated

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

Last updated

Was this helpful?