Language

2Checkout Documentation

Create

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

Method

create

Use to create a coupon.

Arguments

  • HashMap Parameters

Returns

Returns a TwocheckoutResponse object.

Example Usage:

HashMap params = new HashMap();
params.put("coupon_code", "JAVATEST1");
params.put("date_expire", "2020-12-12");
params.put("type", "shipping");
params.put("minimum_purchase", "1.00");

TwocheckoutResponse result = TwocheckoutCoupon.create(params);

Example Response (toJson):

{
   "coupon_code" : "JAVATEST1",
   "response_code" : "OK",
   "response_message" : "Coupon successfully created"
}