[DEPRECATED] Pipelet: Basket AddCouponToBasket

Pipelet AddCouponToBasket

Deprecated. Do not use this pipelet. Use the AddCouponToBasket2 pipelet instead.

Validates the supplied coupon code and, if the coupon code is valid, applies them to the basket.

While applying the coupon code the pipelet adds a new CouponLineItem to the basket based on the supplied coupon code. The coupon code gets set at the CouponLineItem.

A coupon code can be invalid because of the following reasons:

  • the coupon code is already added to the basket
  • a coupon code of the same coupon is already in basket.
    Adding a single coupon code of this coupon is sufficient to enables a promotion.
    Adding another coupon code of the same coupon does not make sense since the promotion is already enabled by the previously added code.
  • the numbers of redemptions of this coupon code is 1 and the code as already been redeemed.
  • the numbers of redemptions of this coupon code is >1 and the maximum numbers of redemptions of this coupon code has already been reached.
    The pipelet includes the number of redemptions of this coupon code in past plus
    the number of redemptions of other coupon codes of the same coupon in the past.
  • the maximum number of times this coupon can be redeemed per customer has already been reached.
  • the maximum number of times this coupon can be redeemed by a customer within a given time period has already been reached.
    The pipelet includes the number of redemptions of this coupon code in past plus
    the number of redemptions of other coupon codes of the same coupon in the past.
  • the coupon code is unknown to the system
  • the coupon is not enabled
  • there exists no active promotion to which the coupon is assigned

In this case, no CouponLineItem is added to the basket and the pipelet returns to the error connector. The returned "Status" object contains the details of why the coupon was invalid. Status: The status object representing the result of the operation. The status property (Status.status) will be set to 0 if the coupon was successfully applied or 1 otherwise. The code property (Status.code) will be set to one of the following values:

  • "OK" = The coupon was applied to the basket.
  • CampaignStatusCodes.COUPON_UNKNOWN = The coupon code is invalid.
  • CampaignStatusCodes.COUPON_ALREADY_APPLIED = The coupon has already been applied to the basket
    Or a coupon code of the same coupon is already in basket.
  • CampaignStatusCodes.COUPON_ALREADY_REDEEMED = The coupon has already been redeemed.
  • CampaignStatusCodes.COUPON_NOT_REDEEMABLE = The coupon is not enabled.
    OR the coupon code is unknown.
    OR the numbers of redemptions of this coupon code has been reached.
    OR the numbers of redemptions of this coupon code per customer has been reached.
    OR the numbers of redemptions of this coupon code per customer and time period has been reached.
    OR there exists no active promotion to which the coupon is assigned.

Deprecated:

Deprecated. Do not use this pipelet. Use the AddCouponToBasket2 pipelet instead.

Group:

Basket (deprecated)

Flags:

Error Connector

Transaction Required

Input Parameters

CouponCode : String Required

The code of the coupon to add.

Basket : LineItemCtnr Required

The basket to add the coupon to.

Output Parameters

CouponLineItem : CouponLineItem : Optional

The newly created coupon line item.

Status : Status : Required

DEPRECATED