Language

2Checkout Documentation

Retrieve

You must specify your API username and password using the Twocheckout.apiusername & Twocheckout.apipassword class variables before calling a method in this class.

Methods

retrieve

Use to retrieve a list of all active coupons or only those matching a variety of coupon attributes.

Arguments

Returns

Returns a CouponList object.

Example Usage (toJson):

HashMap params = new HashMap();
CouponList result = TwocheckoutCoupon.retrieve(params);

Example Response (toJson):

{
   "coupon" : [
      {
         "coupon_code" : "COUPON",
         "date_expire" : "3000-02-25",
         "minimum_purchase" : "1.00",
         "percentage_off" : "0.10",
         "type" : "product",
         "value_off" : null
      },
      {
         "coupon_code" : "FREESHIPPING",
         "date_expire" : "2013-04-13",
         "minimum_purchase" : "0.00",
         "percentage_off" : null,
         "type" : "shipping",
         "value_off" : null
      },
      {
         "coupon_code" : "SAVEJUNE",
         "date_expire" : "2013-03-31",
         "minimum_purchase" : "2999.99",
         "percentage_off" : null,
         "type" : "product",
         "value_off" : "100.00"
      }
   ],
   "response_code" : "OK",
   "response_message" : "Coupon information retrieved successfully."
}