com.ibm.commerce.marketing.promotion.coupon

Interface CouponManager

  • All Superinterfaces:
    java.io.Serializable, XMLizable


    public interface CouponManager
    extends XMLizable
    This is the coupon management interface that defines different operations that may be applied to a coupon.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM Copyright
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method and Description
      void cancelCoupon(com.ibm.commerce.marketing.promotion.coupon.Coupon coupon)
      Cancels a coupon after it has been used.
      void deleteCoupon(com.ibm.commerce.marketing.promotion.coupon.Coupon coupon)
      Deletes a coupon.
      void deselectCouponForUseInOrder(com.ibm.commerce.marketing.promotion.coupon.CouponKey ckey)
      Removes a coupon from an order so that it will not be applied to an order.
      void deselectCouponForUseInOrder(com.ibm.commerce.marketing.promotion.coupon.CouponKey ckey, java.util.Date date)
      Deprecated. 
      Use deselectCouponForUseInOrder(CouponKey ckey)
      com.ibm.commerce.marketing.promotion.coupon.Coupon issueCoupon(CustomerKey user, Promotion promotion, java.lang.String code)
      Issues a coupon for a registered user.
      com.ibm.commerce.marketing.promotion.coupon.Coupon issueCoupon(CustomerKey user, Promotion promotion, java.lang.String code, java.util.Date time)
      Deprecated. 
      Use issueCoupon(CustomerKey user,Promotion promotion,String code)
      com.ibm.commerce.marketing.promotion.coupon.Coupon[] listCouponsFor(CustomerKey customerKey, int state)
      Lists coupons in a state for a user.
      com.ibm.commerce.marketing.promotion.coupon.Coupon[] listCouponsFor(CustomerKey customerKey, int state, java.util.Date date)
      Deprecated. 
      Use listCouponsFor(CustomerKey customerKey, int state)
      com.ibm.commerce.marketing.promotion.coupon.Coupon[] listCouponsInUseForOrder(OrderKey okey)
      Lists coupons in use for an order.
      com.ibm.commerce.marketing.promotion.coupon.Coupon[] listCouponsInUseForOrder(OrderKey okey, java.util.Date date)
      Deprecated. 
      Use listCouponsInUseForOrder(OrderKey okey)
      void restoreCancelledCouponsInOrder(OrderKey okey)
      This method restores all cancelled coupons in a specified order.
      void restoreUnusedCouponsInOrder(OrderKey okey)
      Restores all unused coupons in an order.
      void restoreUnusedCouponsInOrder(OrderKey okey, java.util.Date date)
      Deprecated. 
      Use restoreUnusedCouponsInOrder(OrderKey okey)
      void selectCouponForUseInOrder(com.ibm.commerce.marketing.promotion.coupon.CouponKey ckey, CustomerKey ukey, OrderKey okey)
      Selects a coupon and adds it to an order so that the coupon will be used with the order.
      void selectCouponForUseInOrder(com.ibm.commerce.marketing.promotion.coupon.CouponKey ckey, CustomerKey ukey, OrderKey okey, java.util.Date date)
      Deprecated. 
      Use selectCouponForUseInOrder(CouponKey ckey,CustomerKey ukey,OrderKey okey)
      com.ibm.commerce.marketing.promotion.coupon.Coupon transferCoupon(com.ibm.commerce.marketing.promotion.coupon.Coupon coupon, CustomerKey to)
      Transfers a coupon from the original owner to another owner.
      com.ibm.commerce.marketing.promotion.coupon.Coupon transferCoupon(com.ibm.commerce.marketing.promotion.coupon.Coupon coupon, CustomerKey to, java.util.Date date)
      Deprecated. 
      Use transferCoupon(Coupon coupon, CustomerKey to)
      PromotionErrorReport validateCoupon(com.ibm.commerce.marketing.promotion.coupon.CouponKey ckey, CustomerKey ukey)
      Validates a coupon.
      PromotionErrorReport validateCoupon(com.ibm.commerce.marketing.promotion.coupon.CouponKey ckey, CustomerKey ukey, java.util.Date date)
      Deprecated. 
      Use validateCoupon(CouponKey ckey,CustomerKey ukey)
    • Method Detail

      • issueCoupon

        com.ibm.commerce.marketing.promotion.coupon.Coupon issueCoupon(CustomerKey user,
                                                                       Promotion promotion,
                                                                       java.lang.String code)
                                                                throws PromotionApplicationException
        Issues a coupon for a registered user.
        Parameters:
        user - the recipient, a registered user.
        promotion - the promotion for which a coupon is issued.
        code - optional code for this coupon, null if not provided.
        Returns:
        the coupon that has been just issued.
        Throws:
        PromotionApplicationException - is thrown when the system encounters an error.
      • issueCoupon

        com.ibm.commerce.marketing.promotion.coupon.Coupon issueCoupon(CustomerKey user,
                                                                       Promotion promotion,
                                                                       java.lang.String code,
                                                                       java.util.Date time)
                                                                throws PromotionApplicationException
        Deprecated. Use issueCoupon(CustomerKey user,Promotion promotion,String code)
        Issues a coupon for a registered user.
        Parameters:
        user - the recipient, a registered user
        promotion - the promotion for which a coupon is being issued.
        code - optional code for this coupon, null if not provided.
        time - Current or Preview time to check if the coupon is valid or not.
        Returns:
        the coupon that has been just issued
        Throws:
        PromotionApplicationException - is thrown when the system encounters an error
      • transferCoupon

        com.ibm.commerce.marketing.promotion.coupon.Coupon transferCoupon(com.ibm.commerce.marketing.promotion.coupon.Coupon coupon,
                                                                          CustomerKey to,
                                                                          java.util.Date date)
                                                                   throws PromotionApplicationException
        Deprecated. Use transferCoupon(Coupon coupon, CustomerKey to)
        Transfer a coupon from the original owner to to
        Parameters:
        coupon - the coupon to be transferred
        to - the recipient of the transfer, a registered user
        date - Current or Preview time to check if the coupon is valid or not.
        Returns:
        the coupon that has been just transferred
        Throws:
        PromotionApplicationException - is thrown when the system encounters an error
      • transferCoupon

        com.ibm.commerce.marketing.promotion.coupon.Coupon transferCoupon(com.ibm.commerce.marketing.promotion.coupon.Coupon coupon,
                                                                          CustomerKey to)
                                                                   throws PromotionApplicationException
        Transfers a coupon from the original owner to another owner.
        Parameters:
        coupon - the coupon to be transferred.
        to - is the recipient of coupon to be transferred, must be a registered user.
        Returns:
        the coupon that is transferred.
        Throws:
        PromotionApplicationException - is thrown when the system encounters an error.
      • cancelCoupon

        void cancelCoupon(com.ibm.commerce.marketing.promotion.coupon.Coupon coupon)
                   throws PromotionApplicationException
        Cancels a coupon after it has been used.
        Parameters:
        coupon - the coupon to be cancelled.
        Throws:
        PromotionApplicationException - is thrown when the system encounters an error.
      • listCouponsFor

        com.ibm.commerce.marketing.promotion.coupon.Coupon[] listCouponsFor(CustomerKey customerKey,
                                                                            int state)
        Lists coupons in a state for a user.
        Parameters:
        customerKey - the user, a registered user.
        state - the state of the coupon.
        Returns:
        an array of coupons for this user in this state, an array of length 0 is returned if no coupon is found.
      • listCouponsFor

        com.ibm.commerce.marketing.promotion.coupon.Coupon[] listCouponsFor(CustomerKey customerKey,
                                                                            int state,
                                                                            java.util.Date date)
        Deprecated. Use listCouponsFor(CustomerKey customerKey, int state)
        Lists coupons in a state for a user.
        Parameters:
        customerKey - the user, a registered user.
        state - the state of coupon.
        date - is the current or preview time to check if the coupon is valid or not.
        Returns:
        an array of coupons for this user in this state, an array of length 0 is returned if no coupons are found
      • listCouponsInUseForOrder

        com.ibm.commerce.marketing.promotion.coupon.Coupon[] listCouponsInUseForOrder(OrderKey okey)
        Lists coupons in use for an order.
        Parameters:
        okey - is the key of the order.
        Returns:
        an array of coupons for this order, an array of length 0 is returned if no coupon is found.
      • listCouponsInUseForOrder

        com.ibm.commerce.marketing.promotion.coupon.Coupon[] listCouponsInUseForOrder(OrderKey okey,
                                                                                      java.util.Date date)
        Deprecated. Use listCouponsInUseForOrder(OrderKey okey)
        Lists coupons in a state for a user
        Parameters:
        okey - key of the order.
        date - Current or Preview time to check if the coupon is valid or not.
        Returns:
        an array of coupons for this user in this state, an array of length 0 is returned if no coupons are found
      • selectCouponForUseInOrder

        void selectCouponForUseInOrder(com.ibm.commerce.marketing.promotion.coupon.CouponKey ckey,
                                       CustomerKey ukey,
                                       OrderKey okey)
                                throws PromotionApplicationException
        Selects a coupon and adds it to an order so that the coupon will be used with the order.
        Parameters:
        ckey - key of the coupon
        ukey - key of the user.
        okey - key of the order.
        Throws:
        PromotionApplicationException - when the coupon is not valid.
      • selectCouponForUseInOrder

        void selectCouponForUseInOrder(com.ibm.commerce.marketing.promotion.coupon.CouponKey ckey,
                                       CustomerKey ukey,
                                       OrderKey okey,
                                       java.util.Date date)
                                throws PromotionApplicationException
        Deprecated. Use selectCouponForUseInOrder(CouponKey ckey,CustomerKey ukey,OrderKey okey)
        Adds a coupon to an order so that the coupon will be used with the order.
        Parameters:
        ckey - key of the coupon
        ukey - key of the user.
        okey - key of the order.
        date - Current or Preview time to check if the coupon is valid or not.
        Throws:
        PromotionApplicationException - when the coupon is not valid
      • deselectCouponForUseInOrder

        void deselectCouponForUseInOrder(com.ibm.commerce.marketing.promotion.coupon.CouponKey ckey)
                                  throws PromotionApplicationException
        Removes a coupon from an order so that it will not be applied to an order.
        Parameters:
        ckey - the key of the coupon.
        Throws:
        PromotionApplicationException - is thrown when the system encounters an error.
      • deselectCouponForUseInOrder

        void deselectCouponForUseInOrder(com.ibm.commerce.marketing.promotion.coupon.CouponKey ckey,
                                         java.util.Date date)
                                  throws PromotionApplicationException
        Deprecated. Use deselectCouponForUseInOrder(CouponKey ckey)
        Removes a coupon from an order so that it will not be applied to an order.
        Parameters:
        ckey - the key of the coupon
        date - Current or Preview time to check if the coupon is valid or not.
        Throws:
        PromotionApplicationException - is thrown when the system encounters an error
      • restoreUnusedCouponsInOrder

        void restoreUnusedCouponsInOrder(OrderKey okey,
                                         java.util.Date date)
                                  throws PromotionApplicationException
        Deprecated. Use restoreUnusedCouponsInOrder(OrderKey okey)
        Restores all unused coupons in an order.
        Parameters:
        okey - key of the order
        date - Current or Preview time to check if the coupon is valid or not.
        Throws:
        PromotionApplicationException - is thrown when the system encounters an error
      • restoreCancelledCouponsInOrder

        void restoreCancelledCouponsInOrder(OrderKey okey)
                                     throws PromotionApplicationException
        This method restores all cancelled coupons in a specified order. Coupons used in an order are marked as cancelled when this order is submitted, and must be restored for the owning customer when this order is cancelled.
        Parameters:
        okey - key of the order
        Throws:
        PromotionApplicationException - is thrown when the system encounters an error
      • validateCoupon

        PromotionErrorReport validateCoupon(com.ibm.commerce.marketing.promotion.coupon.CouponKey ckey,
                                            CustomerKey ukey)
                                     throws PromotionApplicationException
        Validates a coupon. Performs the following tasks:
        1. Checks if the coupon is valid
        2. Checks if the promotion identified by this coupon is active
        3. Checks if the user who holds this coupon is the intended bearer of this coupon
        4. Checks if the promotion identified by this coupon has reached the redemption limit both overall and for this user in particular
        Not checked are:
        1. If the promotion identified by this coupon is applicable to the current order based on its content
        2. If the promotion identified by this coupon will be eliminated as a result of policy voilations.
        Parameters:
        ckey - is the key for the coupon.
        ukey - the key of the user who entered this coupon.
        Returns:
        null if coupon is valid, otherwise a populated PromotionErrorReport is returned.
        Throws:
        PromotionApplicationException - is thrown when the system encounters an error.
      • validateCoupon

        PromotionErrorReport validateCoupon(com.ibm.commerce.marketing.promotion.coupon.CouponKey ckey,
                                            CustomerKey ukey,
                                            java.util.Date date)
                                     throws PromotionApplicationException
        Deprecated. Use validateCoupon(CouponKey ckey,CustomerKey ukey)
        Validates a coupon. Performs the following tasks:
        1. Checks if the coupon is valid
        2. Checks if the promotion identified by this coupon is active
        3. Checks if the user who holds this coupon is the intended bearer of this coupon
        4. Checks if the promotion identified by this coupon has reached the redemption limit both overall and for this user in particular
        Not checked are:
        1. If the promotion identified by this coupon is applicable to the current order based on its content
        2. If the promotion identified by this coupon will be eliminated as a result of policy voilations.
        Parameters:
        ckey - is the key for the coupon.
        ukey - the user who entered this coupon
        date - Current or Preview time to check if the coupon is valid or not.
        Returns:
        null if coupon is valid, otherwise a populated PromotionErrorReport is returned
        Throws:
        PromotionApplicationException - is thrown when the system encounters an error