-
Notifications
You must be signed in to change notification settings - Fork 16
Coupon_Retrieve
Jacob McConnell edited this page Jun 10, 2014
·
2 revisions
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
- string coupon_code
- Parameters -> API Detail Coupon
####Returns
Returns a CouponList object.
####Example Usage (toJson):
HashMap<String, String> params = new HashMap<String, String>();
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."
}Please feel free to contact 2Checkout directly for assistance with your integration.