-
Notifications
You must be signed in to change notification settings - Fork 66
Product_Retrieve
2Checkout's back office API allows you to retrieve product information. You must specify your API username and password using the the Twocheckout::setCredentials method before calling a method in this class. The Twocheckout_Product class provides methods to create, retrieve, update and delete products and will return a JSON object or array depending on your specification.
##Method
###retrieve
Use to retrieve a product.
####Arguments
-
array Array
-
Array containing list_products parameters or just a
product_id
. Parameters -> API List Products -
string format
-
Supports 'json' or 'array'. Defines response format. Default: 'json'
####Returns
Returns a JSON object or array depending on your specification.
####Example Usage:
<?php
Twocheckout::setCredentials("APIuser1817037", "APIpass1817037");
$args = array(
'product_id' => 4838125968
);
$result = Twocheckout_Product::retrieve($args, 'array');
print_r($result);
####Example Response:
Array
(
[product] => Array
(
[approved_url] =>
[assigned_product_id] => 445
[categories] => Array
(
)
[commission] => 0
[commission_amount] =>
[commission_type] =>
[description] => This is an example description
[duration] =>
[handling] =>
[images] => Array
(
)
[long_description] =>
[name] => Example Product
[options] => Array
(
)
[pending_url] =>
[price] => 1.00
[product_id] => 4838125968
[recurrence] =>
[recurrence_p] =>
[recurring] => 0
[startup_fee] =>
[tangible] => 0
[vendor_id] => 1817037
[vendor_product_id] =>
[weight] =>
)
[response_code] => OK
[response_message] => Product detail information retrieved successfully
)
Please feel free to contact 2Checkout directly for assistance with your integration.