post
https://platform.nector.io/api/v2/merchant/actions-checkoutpage
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
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
