Skip to content

Option_List

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

The OptionService class provides methods to create, retrieve, update and delete options.

##Methods

###List

Use to retrieve a list of all active options or only those matching a variety of option attributes.

####Arguments

  • TwoCheckoutConfig - Set your ApiUsername and ApiPassword.
  • OptionListServiceOptions Object containing list option attributes

####Returns

Returns a OptionList object.

####Example Usage:

var ServiceObject = new OptionService();
var result = ServiceObject.List();

####Example Response:

{TwoCheckout.OptionList}
  page_info: { }
    {TwoCheckout.PageInfo}
      cur_page: 1
      first_entry: 1
      first_page: 1
      first_page_url: "https://www.2checkout.com/api/products/list_options?cur_page=1"
      last_entry: 20
      last_page: 8
      last_page_url: "https://www.2checkout.com/api/products/list_options?cur_page=8"
      next_page: 2
      pagesize: 20
      previous_page: null
      total_entries: 155
  options: ...
    {TwoCheckout.Option}
      option_id: 4825646098
      option_name: "test"
      option_values: ...
        {TwoCheckout.OptionValues}
          option_value_id: 4825646101
          option_value_name: "test"
          option_value_surcharge: 1.00
    {TwoCheckout.Option}
      option_id: 4824981183
      option_name: "test"
      option_values: ...
        {TwoCheckout.OptionValues}
          option_value_id: 4824981186
          option_value_name: "test"
          option_value_surcharge: 1.00
    {TwoCheckout.Option}
      option_id: 4824885367
      option_name: "test"
      option_values: ...
        {TwoCheckout.OptionValues}
          option_value_id: 4824885370
          option_value_name: "test"
          option_value_surcharge: 1.00
...
Clone this wiki locally