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

Add or Remove a Coupon

Adds or removes a coupon from the current checkout session. This is an independent step and does not determine the next checkout page. The checkout flow proceeds based on the current checkout state.

Required Fields:

  • coupon: The primary key of the BasketOffer record as a string

  • action: Either "add" to apply the coupon or "remove" to unapply it

State Changes:

  • The coupon PK is added to or removed from pre_order.data["coupons"]

  • Offer applications are recalculated on the next GET request

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
couponstringRequired

Primary key of the BasketOffer record to add or remove, as a string.

Example: 101
actionstring · enumRequired

Action to perform: "add" to apply the coupon or "remove" to unapply it.

Example: addPossible values:
Responses
200

Coupon action processed

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

"coupon='101'&action='add'"
200

Coupon action processed

{
  "context_list": [],
  "errors": {}
}

Last updated

Was this helpful?