Applying coupons
The Apply coupon to order - ISF000052 resource permission must be enabled to be
able to apply coupons.
You can scan a coupon or enter the coupon code and then press the Enter key to apply the coupon
to the order. The translateBarCode API is called to identify the coupon. By
default, a dummy implementation, YCD_Translate_Bar_Code_StoreCoupon, is provided to
identify and return the scanned coupon. You can create a custom implementation to validate the
coupon.
- If the coupon that is applied is valid,
PromotionAppliedis set toY. - If the coupon that is applies is valid, but not applicable,
PromotionAppliedis set toN. - If the coupon applied is invalid,
DenialReasonis set toYPM_RULE_INVALID.
After the coupon is identified, the changeOrder API is called to apply the
coupon to the order. If the coupon is successfully applied to the order, the
getCompleteOrderDetails API is called to refresh the order with the updated price.
If the coupon is not applied, an error message is displayed. The error message is mapped to the
DenialReasonDescription attribute that is derived from the
DenialReason attribute of the Promotion element.
The total discount that is availed on the order by applying coupons is displayed. This value is
computed by adding up the PromotionAmount attribute for all the
Promotion elements with PromotionApplied=Y.
When a coupon is applied, the amount is displayed as HeaderCharges or
LineCharges based on the coupon pricing rule type. These charges are displayed when
you click Order total or Item total in the Order line total.
A banner that the coupon is applied is displayed for applicable order lines. You can click this
banner to view the list of coupons that are applied on the order line along with discount value.
This is retrieved from OrderLines > OrderLine > Awards > Award element. Promotions
that are applicable on the order line are reflected as Award for an individual
order line.
Removing coupons
You can delete a coupon by clicking the X icon next to the coupon. To remove a coupon, the
changeOrder API is called with the ACTION attribute set to
REMOVE in the Promotion element. The
getCompleteOrderDetails API is called to refresh the page with the updated
information.