Language

2Checkout Documentation

List

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 list of product options.

Arguments

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

Returns

  • Array of option objects.

Example Usage:

args = {
    pagesize: 20
};

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

Example Response:

{
    "options": [
        {
            "option_id": "4688550010",
            "option_name": "Volume",
            "option_values": [
                {
                    "option_value_id": "4688550013",
                    "option_value_name": "Low",
                    "option_value_surcharge": "1.00"
                },
                {
                    "option_value_id": "4688550016",
                    "option_value_name": "Medium",
                    "option_value_surcharge": "2.00"
                },
                {
                    "option_value_id": "4688550019",
                    "option_value_name": "High",
                    "option_value_surcharge": "3.00"
                }
            ]
        }
    ],
    "page_info": {
        "cur_page": "1",
        "first_entry": 1,
        "first_page": 1,
        "first_page_url": "https://www.2checkout.com/api/products/list_options?cur_page=1",
        "last_entry": "1",
        "last_page": 1,
        "last_page_url": "https://www.2checkout.com/api/products/list_options?cur_page=1",
        "next_page": null,
        "pagesize": "20",
        "previous_page": null,
        "total_entries": "1"
    },
    "response_code": "OK",
    "response_message": "Option information retrieved successfully."
}