Language

2Checkout Documentation

Retrieve

The Twocheckout_Option class provides methods to create, retrieve, update and delete options and will return an Array or JSON response depending on your format specification.

Method

retrieve

Use to retrieve an option.

Arguments

  • Array containing detail_option parameters or just a option id. Parameters -> API Detail Option

Returns

Returns a JSON object or array depending on your specification.

Example Usage:

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

$args = array(
    'option_id' => 4836975248
);

$option = Twocheckout_Option::retrieve($args);

Example Response:

Array
(
    [option] => Array
        (
            [0] => Array
                (
                    [option_id] => 4836975248
                    [option_name] => Example Option
                    [option_values] => Array
                        (
                            [0] => Array
                                (
                                    [option_value_id] => 4836975251
                                    [option_value_name] => Test1
                                    [option_value_surcharge] => 1.00
                                )

                            [1] => Array
                                (
                                    [option_value_id] => 4836975266
                                    [option_value_name] => Test2
                                    [option_value_surcharge] => 1.00
                                )

                        )

                )

        )

    [response_code] => OK
    [response_message] => Option detail retrieved successfully.
)