Language

2Checkout Documentation

List

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

Methods

list

Use to retrieve a list of all products or only those matching a variety of product attributes.

Arguments

  • TwoCheckoutConfig - Set your ApiUsername and ApiPassword.
  • ProductListServiceOptions - Object composed of list product attributes.

Returns

Returns a ProductList object.

Example Usage:

var ServiceObject = new ProductService();
var ArgsObject = new ProductListServiceOptions();
ArgsObject.pagesize = 5;

var result = ServiceObject.List(ArgsObject);

Example Response:

{TwoCheckout.ProductList}
  page_info: { }
    {TwoCheckout.PageInfo}
      cur_page: 1
      first_entry: 1
      first_page: 1
      first_page_url: "https://www.2checkout.com/api/products/list_products?cur_page=1"
      last_entry: 20
      last_page: 13
      last_page_url: "https://www.2checkout.com/api/products/list_products?cur_page=13"
      next_page: 2
      pagesize: 20
      previous_page: null
      total_entries: 247
  products: ...
    {TwoCheckout.Product}
      approved_url: null
      assigned_product_id: 2
      categories: ...
      commission: null
      commission_type: null
      description: "Test Description"
      duration: null
      handling: 0.00
      images: ...
      long_description: null
      name: "Test Product"
      options: ...
      pending_url: null
      price: 0.01
      product_id: 4774387610
      recurrence: null
      startup_fee: null
      tangible: "1"
      vendor_id: 1817037
      vendor_product_id: "test"
      weight: null
    {TwoCheckout.Product}
      approved_url: null
      assigned_product_id: 3
      categories: ...
        {TwoCheckout.Categories}
          category_id: 21
          name: "Advice & Instruction"
          parent_id: 2
          description: null
          parent_name: "Business Solutions & Office Products"
      commission: null
      commission_type: null
      description: "This is a test product!"
      duration: "Forever"
      handling: 0.00
      images: ...
      long_description: null
      name: "Example Product"
      options: ...
        {TwoCheckout.Option}
          option_id: 4774403903
          option_name: "Example Option"
          option_values: ...
            {TwoCheckout.OptionValues}
              option_value_id: 4774403906
              option_value_name: "Test"
              option_value_surcharge: 1.00
      pending_url: null
      price: 1.00
      product_id: 4774388564
      recurrence: "1 Month"
      startup_fee: "0.01"
      tangible: "0"
      vendor_id: 1817037
      vendor_product_id: "example123"
      weight: null
...