Language

2Checkout Documentation

Retrieve

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 containing list_products parameters or just a product id. Parameters -> API List Products

Returns

Returns an Array or JSON depending on your format 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
)