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 product.

Arguments

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

Returns

  • Single Product Object.

Example Usage:

args = {
    product_id: 4635212971
};

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

Example Response:

{
    "product": {
        "approved_url": null,
        "assigned_product_id": "2559",
        "categories": [],
        "commission": 0,
        "commission_amount": null,
        "commission_type": null,
        "description": "An API created product",
        "duration": null,
        "handling": null,
        "images": [],
        "long_description": null,
        "name": "API product",
        "options": [
            {
                "option_id": "4023756741",
                "option_name": "extra benefit",
                "option_values": [
                    {
                        "option_value_id": "4023756744",
                        "option_value_name": "full life coverage",
                        "option_value_surcharge": "1.00"
                    },
                    {
                        "option_value_id": "4023756747",
                        "option_value_name": "half life coverage",
                        "option_value_surcharge": "0.50"
                    },
                    {
                        "option_value_id": "4023756750",
                        "option_value_name": "extra lives coverage",
                        "option_value_surcharge": "2.00"
                    }
                ]
            },
            {
                "option_id": "4688355343",
                "option_name": "decibels",
                "option_values": [
                    {
                        "option_value_id": "4688355346",
                        "option_value_name": "150dB",
                        "option_value_surcharge": "11.00"
                    },
                    {
                        "option_value_id": "4688441332",
                        "option_value_name": "200dB",
                        "option_value_surcharge": "22.00"
                    },
                    {
                        "option_value_id": "4688441335",
                        "option_value_name": "250dB",
                        "option_value_surcharge": "33.00"
                    }
                ]
            }
        ],
        "pending_url": null,
        "price": "10.00",
        "product_id": "4635212971",
        "recurrence": null,
        "recurrence_p": null,
        "recurring": "0",
        "startup_fee": null,
        "tangible": "0",
        "vendor_id": "606917",
        "vendor_product_id": "",
        "weight": null
    },
    "response_code": "OK",
    "response_message": "Product detail information retrieved successfully"
}