-
Notifications
You must be signed in to change notification settings - Fork 8
Coupon_Create
Jacob McConnell edited this page Jun 11, 2014
·
2 revisions
You must specify your API username and password when creating your 2checkout-node object (named ‘tco’ in these examples) before calling this method.
##Method
###create
Use to create a coupon.
####Arguments
- object - Object containing coupon parameters. Parameters -> API Create Coupon
- 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"
}Please feel free to contact 2Checkout directly for assistance with your integration.