Skip to content

Option_Update

Jacob McConnell edited this page Jun 11, 2014 · 1 revision

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

##Method

###update

Use to update a product option.

####Arguments

  • object - Object containing option parameters. Parameters -> API Update Option
  • callback - Function to be called on success/error

####Returns

Response Object

####Example Usage:

args = {
    option_name: "test option",
    option_value_name: "value name",
    option_value_surcharge: "0.01"
};

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

####Example Response:

{
    "response_code": "OK",
    "response_message": "Option updated successfully"
}
Clone this wiki locally