Checkout Page Redemption

Multi step redemption for the checkout page flow, i.e. a slider or stepper on the checkout where the customer chooses how many coins to redeem.

  • The offer used is the published or active offer with classification action_checkoutpage. If the customer has a membership (or else a tier) and an offer restricted to that membership (or tier) exists, that offer is used instead of the universal one
  • Each step deducts delta_mincoinperstep coins and gives delta_minfiatperstep discount. delta_step returned by list is the maximum number of steps allowed for this cart, capped by the offer fiat_range, the customer's coin balance, the cart amount and the minimum cart configured on the offer
  • Pass line_items when the offer is restricted to specific products or collections, the applicable cart amount is then the sum of total_amount of the matching lines (capped by amount). When line_items is omitted the full amount is considered applicable
  • Requires the Checkout Page action to be active on the dashboard, otherwise the API fails
  • Calls for the same customer are serialised, so concurrent calls from multiple tabs are safe

Actions

  • list: returns points_balance and a promotions entry with the maximum discount (coin_value, fiat_value, delta_amount) and the step configuration (delta_mincoinperstep, delta_minfiatperstep, delta_step). Render the slider from 1 to delta_step. If a valid coupon was already generated and still fits the cart, it returns that coupon in coupons instead
  • perform: requires step. Generates the discount coupon for the chosen step and returns it in coupons. Use coupons[0].value as the discount code on the checkout (it starts with necpage). step greater than delta_step fails with "Steps cannot be greater than allowed steps". The coins are deducted when the order is placed with the code, not at generation. The coupon expires in 24 hours if unused. Calling perform again when an existing coupon still fits the cart returns it, otherwise the old coupon is cancelled and a new one is generated
  • revert: cancels the coupon generated earlier (status becomes unavailable and the discount code is removed from the store). Call this when the customer resets the slider or removes the code

Errors are returned with a message such as "No discount is available" when the cart is below the minimum cart, the customer has no coins, or the offer is not configured.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string

(One of leadid, customer_id is required, unless x-leadtoken header is passed) (This needs to be leads id value)

string

(One of lead_id, customer_id is required, unless x-leadtoken header is passed) (Minimum length is 8) (Maximum length is 128) (This needs to be leads customer_id value)

string
enum
required

(Required) (This can only be one of list,perform,revert) (list returns the maximum discount and the step size the customer can redeem for this cart, perform generates the discount coupon for the chosen step, revert cancels the coupon generated earlier)

Allowed:
number
required

(Required) (Minimum is 1) (This needs to be the cart total amount in your store currency, before the loyalty discount)

number

(Required when action is perform) (Minimum is 1) (Number of steps the customer chose to redeem, must be less than or equal to delta_step returned by the list action) (Coins deducted = delta_mincoinperstep x step, discount = delta_minfiatperstep x step)

line_items
array of objects

(Optional) (Pass the cart line items when the checkout page offer is restricted to specific products or collections, so that the discount is calculated only on the applicable items) (When omitted the full cart amount is considered applicable)

line_items
Headers
string
enum
required

(Required) (This can only be one of mobile,web) (web for browsers and servers, mobile for native apps)

Allowed:
string
required

(Required) (This needs to be your apikey)

string
required

(Required) (This needs to be your workspaceid)

string

(Required when using a storefront read only api key, not needed with a server api key) (This needs to be the lead_token of the customer, a 1 hour JWT returned by Get User via the x-leaddigest flow or generated on your server with your api signing secret) (When passed, the customer is taken from the token and any lead_id or customer_id in the request is ignored) (Learn more about authentication here)

Responses

Language
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json