Skip to content

Coupon_Create

Jacob McConnell edited this page Jun 10, 2014 · 2 revisions

The Twocheckout_Coupon class provides methods to create, retrieve, update and delete coupons and will return an Array or JSON response depending on your format specification.

##Method

###create

Use to create a coupon.

####Arguments

  • array Array
  • Array containing create_coupon parameters in key => value pairs. Parameters -> API Create Coupon

####Returns

Returns an Array or JSON object depending on your specification.

####Example Usage:

Twocheckout::username('APIuser1817037');
Twocheckout::password('APIpass1817037');

$args = array(
    'coupon_code' => '123TEST',
    'date_expire' => '2020-07-31',
    'value_off' => 1.00,
    'type' => sale,
    'minimum_purchase' => 2.00
);

$result = Twocheckout_Coupon::create($args);

####Example Response:

Array
(
    [coupon_code] => 123TEST
    [response_code] => OK
    [response_message] => Coupon successfully created
)
Clone this wiki locally