com.ibm.commerce.rest.order.handler

Class AssignedCouponHandler

  • All Implemented Interfaces:
    DocumentedResourceHandler, IResourceHandler


    @Path(value="store/{storeId}/cart/@self/assigned_coupon")
     @Encoded
    public class AssignedCouponHandler
    extends AbstractResourceHandler
    This class provides RESTful services to add, get, update, and delete assigned coupons for the current shopping cart.
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
      • RESOURCE_NAME

        public static final java.lang.String RESOURCE_NAME
        The Constant RESOURCE_NAME.
        See Also:
        Constant Field Values
      • RESOURCE_MAPPING_KEY

        public static final java.lang.String RESOURCE_MAPPING_KEY
        The Constant RESOURCE_MAPPING_KEY.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AssignedCouponHandler

        public AssignedCouponHandler()
    • Method Detail

      • getResourceName

        public java.lang.String getResourceName()
        Description copied from interface: IResourceHandler
        This method returns the name of the resource used primarily to determine the representation of the resource. This class can be overridden to change the name of the resource and therefore the representation, while keeping all the methods in this class.
        Returns:
        the resource name
      • getCalculationUsageIds

        public java.lang.String getCalculationUsageIds()
        This method returns the calculation usage ids.
        Returns:
        calulation usage ids.
      • setCalculationUsageIds

        public void setCalculationUsageIds(java.lang.String ids)
        This method sets the value for calculation usage ids.
        Parameters:
        ids - identifiers.
      • getHelper

        public OrderHelper getHelper()
        This method returns the Order helper.
        Returns:
        OrderHelper
      • getAssignedCouponInfo

        @GET
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
        public javax.ws.rs.core.Response getAssignedCouponInfo(@PathParam(value="storeId")
                                                                                                                                                                            java.lang.String storeId,
                                                                                                                                                                            @QueryParam(value="responseFormat")
                                                                                                                                                                            java.lang.String responseFormat)
        Get assigned coupon info for the shopping cart.
        Parameters:
        storeId - the store id
        responseFormat - the response format
        Returns:
        the assigned coupon info
      • applyCoupon

        @POST
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Consumes(value={"application/json","application/xml"})
        public javax.ws.rs.core.Response applyCoupon(@PathParam(value="storeId")
                                                                                                                                                                                                                            java.lang.String storeId,
                                                                                                                                                                                                                            @QueryParam(value="responseFormat")
                                                                                                                                                                                                                            java.lang.String responseFormat)
        This method apply coupon to the shopping cart.
        Parameters:
        storeId - the store id.
        responseFormat - the response format (xml, json, or atom).
        Returns:
        A map of String [] that contains the following response parameters: orderId, couponId.
      • removeCoupon

        @DELETE
         @Produces(value={"application/json","application/xml","application/xhtml+xml","application/atom+xml"})
         @Path(value="{couponId}")
        public javax.ws.rs.core.Response removeCoupon(@PathParam(value="storeId")
                                                                                                                                                                                                 java.lang.String storeId,
                                                                                                                                                                                                 @PathParam(value="couponId")
                                                                                                                                                                                                 java.lang.String couponId,
                                                                                                                                                                                                 @QueryParam(value="responseFormat")
                                                                                                                                                                                                 java.lang.String responseFormat)
        Remove a coupon from the shopping cart.
        Parameters:
        storeId - the store id.
        couponId - the coupon id.
        responseFormat - the response format.
        Returns:
        the response.