Partial Gift Redemption

robert_orobert_o Member Posts: 5


we're using lightspeed's REST API to apply discounts (either cash or free item based) to the cart.

our use-cases include following scenario:

cart contains 3 coffees, cashier switches to our website and redeems one free coffee. now we modify the cart:

  • change coffee quantity to 2
  • create a new sale-line-item with same itemID, set quantity to 1 and set discount to 100%

this used to work (was implemented some years ago)

now, only redemptions where line-item quantity === redeem-gift quantity are working (since we just need to set the discount to 100%)

but when line-item quantity > redeem-gift quantity, then something strange happens when we try to duplicate the line-item in the cart. i.e.:

  • 2 coffees are in the cart
  • trying to redeem only 1 as gift (calling REST API to alter qty and create new line-item with same itemID, qty=1, discount=100%
  • the result is 1 line-item with 4 coffees and 100% discount applied

how should such case be implemented?

the other way we thought of was adding a partial discount on a single line item. ie. if we want to redeem 1 coffee out of 3, we could then set a discount of 33.33% on the line-item. but the major issue with this approach is that any discount applied to this line-item beforehand would be lost

any advice?

thanks, Robert

Sign In or Register to comment.