-
Notifications
You must be signed in to change notification settings - Fork 8
Product_Retrieve
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
###retrieve
Use to retrieve a product.
####Arguments
- object - Object containing product parameters. Parameters -> API Detail Product
- 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"
}Please feel free to contact 2Checkout directly for assistance with your integration.