Language

2Checkout Documentation

Retrieve

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

Arguments

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

Returns

  • Single Coupon Object.

Example Usage:

args = {
    coupon_code: 4631234571
};

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

Example Response:

{
    "coupon": {
        "coupon_code": "APITEST002",
        "date_expire": "2012-12-31",
        "minimum_purchase": "5.00",
        "percentage_off": "5",
        "product": [
            {
                "product_id": "0",
                "product_url": "https://www.2checkout.com/api/products/detail_product?product_id=0"
            }
        ],
        "type": "sale",
        "value_off": null
    },
    "response_code": "OK",
    "response_message": "Coupon detail retrieved successfully."
}