Language

2Checkout Documentation

Update

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 update a coupon.

Arguments

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

Returns

  • Response Object

Example Usage:

args = {
    coupon_code: "APIMODIFY002",
    value_off: "0.02",
    minimum_purchase: "0.03"
};

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

Example Response:

{
    "coupon_code": "APIMODIFY002",
    "response_code": "OK",
    "response_message": "Coupon updated successfully"
}