Language

2Checkout Documentation

Create

You must specify your API username and password when creating your 2checkout-node object (named ‘tco’ in these examples) before calling this method.

Description

Use to create a product.

Arguments

  • object - Object containing Create Coupon
  • parameters.
  • callback - Function to be called on success/error

Returns

  • Response Object

Example Usage:

args = {
    date_expire: "2099-01-01",
    type: "sale",
    value_off: "0.01",
    minimum_purchase: "0.03"
};

tco.coupons.create(args, function (error, data) {
    if (error) {
        console.log(error);
    } else {
        console.log(data.response_code);
    }
});

Example Response:

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