Skip to content

Product_Retrieve

Jacob McConnell edited this page Jun 10, 2014 · 2 revisions

The Twocheckout_Product class provides methods to create, retrieve, update and delete products and will return an Array or JSON response depending on your format 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

####Returns

Returns a JSON object or array depending on your specification.

####Example Usage:

Twocheckout::username('APIuser1817037');
Twocheckout::password('APIpass1817037');

$args = array(
    'product_id' => 4838125968
);

$result = Twocheckout_Product::retrieve($args);

####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
)
Clone this wiki locally