Language

2Checkout Documentation

Detail Option

The detail_option call is used to retrieve the details for a single option.

URL: https://www.2checkout.com/api/products/detail_option

HTTP Method: GET


Input Parameters

Parameter Description
option_id ID value of option to get details for. Required.

Data Returned

Parameter Description
option_value_id System Option ID
vendor_id Merchant ID (2Checkout Account Number) of user.
option_value_surcharge Option value surcharge amount.
option_value_name Option value name.
option_id System Option ID.

Example API Call

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

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

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

Twocheckout::API.credentials = { :username => 'APIuser1817037', :password => 'APIpass1817037' }

option = Twocheckout::Option.find({:option_id => 4839042084})
args = {
    option_id: 4635212971
};

tco.productOptions.retrieve(args, function (error, data) {
    if (error) {
        console.log(error);
    } else {
        console.log(data.response_code);
    }
});
twocheckout.Api.credentials({'username':'APIuser1817037', 'password':'APIpass1817037'})

params = {
    'option_id': 4837092437
    }

option = twocheckout.Option.find(params)
var ServiceObject = new OptionService();
var ArgsObject = new OptionRetrieveServiceOptions();
ArgsObject.option_id = option_id;

var result = ServiceObject.Retrieve(ArgsObject);
ProductOption option = TwocheckoutOption.retrieve(option_id);
curl -G https://www.2checkout.com/api/products/detail_option \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'option_id=4688355343'

Example Successful Response

    {
       "option" : [
          {
             "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"
                }
             ]
          }
       ],
       "response_code" : "OK",
       "response_message" : "Option detail retrieved successfully."
    }

Common Error Codes

Code Description
PARAMETER_MISSING Required parameter missing:
PARAMETER_INVALID Invalid value for parameter:
RECORD_NOT_FOUND Unable to find record.
FORBIDDEN Access denied to option.