Language

2Checkout Documentation

List Products

The list_products call is used to retrieve list of all products in the account.

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

HTTP Method: GET


Input Parameters

Parameter Description
assigned_product_id Filter list results on 2CO ID. Optional.
vendor_product_id Filter list results on product ID. Optional.
name Filter list results on product name. Optional.
cur_page The page number to retrieve. First page = 1. Optional.
pagesize Total rows per page. Possible values are 1-100. If pagesize not specified, default of 20 items per page will be assigned internally. Optional.
sort_col The name of the column to sort on. Possibile values are product_id, name, description, option_id, price, vendor_product_id, assigned_product_id, tangible, weight, handling, description, long_description, pending_url, approved_url, startup_fee, recurrence, duration, category_id, commission_amount and commission_type. (case insensitive) Optional.
sort_dir The direction of the sort process. (‘ASC’ or ‘DESC’) (case insensitive) Optional.

Data Returned

page_info

Parameter Description
first_page Link to the first product page.
previous_page Link to the previous product page.
next_page Link to the next product page.
last_page Link to the last product page.
first First product ID in page.
last Last product ID in page.
total_entries Total number of products.
current_page Current product page.
pages_in_set Number of pages in set.
entries_per_page Product of product entries in set.

product

Parameter Description
product_id System Product ID.
name Product Name
vendor_product_id Merchant Assigned Product ID.
description Product Short Description.
long_description Product Long Description.
price Product Price.
tangible Tangible=1, Intangible=0.
weight Product Weight.
handling Product Handling Fee.
recurrence Product Recurrence.
startup_fee Recurring Startup Fee.
duration Product Duration.
assigned_product_id 2CO Assigned Product ID.
pending_url Product Pending URL.
approved_url Product Approved URL.
commission Affiliate commision.
commission_type Affiliate commision type.

images

Parameter Description
image_number Image number.
image_id Image ID.

options

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

categories

Parameter Description
category_id Category ID
name Category name.
parent_id Category parent ID.
description Category description.
parent_name Category parent name.

Example API Call

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


$result = Twocheckout_Product::retrieve();
Twocheckout::API.credentials = { :username => 'APIuser1817037', :password => 'APIpass1817037' }

product_list = Twocheckout::Product.list({:pagesize => 2})
args = {};

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

params = {
    'pagesize': 3
    }

product = twocheckout.Product.list(params)
var ServiceObject = new ProductService();
var ArgsObject = new ProductListServiceOptions();
ArgsObject.pagesize = 5;

var result = ServiceObject.List(ArgsObject);
HashMap params = new HashMap();
params.put("pagesize", "3");

ProductList result = TwocheckoutProduct.list(params);
curl -G https://www.2checkout.com/api/products/list_products \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'sort_col=assigned_product_id' -d 'sort_dir=desc'

Example Successful Response

    {
       "page_info" : {
          "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" : "15",
          "last_page" : 1,
          "last_page_url" : "https://www.2checkout.com/api/products/list_products?cur_page=1",
          "next_page" : null,
          "pagesize" : "20",
          "previous_page" : null,
          "total_entries" : "15"
       },
       "products" : [
          {
             "approved_url" : null,
             "assigned_product_id" : "23",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "Rental for a Double Room in Casino Royale",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : "Really cool.",
             "name" : "Casino Royale - Double Room",
             "options" : [],
             "pending_url" : null,
             "price" : "1.00",
             "product_id" : "4654080950",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "DRT",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "19",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "example short description",
             "duration" : "Forever",
             "handling" : "0.00",
             "images" : [],
             "long_description" : "no",
             "name" : "Example Product",
             "options" : [],
             "pending_url" : null,
             "price" : "10.00",
             "product_id" : "4504052346",
             "recurrence" : "1 Month",
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "123456789",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "15",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : null,
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "Classified Ad 1 month",
             "options" : [],
             "pending_url" : "",
             "price" : "29.00",
             "product_id" : "4485343987",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "One Month Ad",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "14",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "12-month subscription",
             "duration" : "Forever",
             "handling" : "0.00",
             "images" : [],
             "long_description" : "12-month subscription to the best magazine ever.",
             "name" : "Annual Subscription",
             "options" : [],
             "pending_url" : "",
             "price" : "29.00",
             "product_id" : "4485343981",
             "recurrence" : "1 Month",
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "AS-12M",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "13",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "Yet another test product.",
             "duration" : "Forever",
             "handling" : "0.00",
             "images" : [],
             "long_description" : "Yet another long description.",
             "name" : "YA-TestProduct",
             "options" : [],
             "pending_url" : "",
             "price" : "1.00",
             "product_id" : "4297596451",
             "recurrence" : "1 Week",
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "YA-TP",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "12",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "A small jar of air",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "Jar of Air",
             "options" : [],
             "pending_url" : "",
             "price" : "50.00",
             "product_id" : "4297596160",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "J-A",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "11",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "Authentic painting.",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "Buddha Painting (5x5)",
             "options" : [],
             "pending_url" : "",
             "price" : "39.95",
             "product_id" : "4297595302",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "1",
             "vendor_id" : "1311348",
             "vendor_product_id" : "JHB55AAE",
             "weight" : "2.00"
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "10",
             "categories" : [
                {
                   "category_id" : "17",
                   "description" : null,
                   "name" : "Photography",
                   "parent_id" : "1",
                   "parent_name" : "Art & Antiques"
                }
             ],
             "commission" : null,
             "commission_type" : null,
             "description" : "Product with options.",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "OPTION TEST",
             "options" : [
                {
                   "option_id" : "4688550010",
                   "option_name" : "Volume",
                   "option_values" : [
                      {
                         "option_value_id" : "4688550013",
                         "option_value_name" : "Low",
                         "option_value_surcharge" : "1.00"
                      },
                      {
                         "option_value_id" : "4688550016",
                         "option_value_name" : "Medium",
                         "option_value_surcharge" : "2.00"
                      },
                      {
                         "option_value_id" : "4688550019",
                         "option_value_name" : "High",
                         "option_value_surcharge" : "3.00"
                      }
                   ]
                }
             ],
             "pending_url" : null,
             "price" : "100.00",
             "product_id" : "4274737762",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "OP-T",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "9",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : null,
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "Hexagonal forged iron",
             "options" : [],
             "pending_url" : null,
             "price" : "0.00",
             "product_id" : "4257794737",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "HEX-002",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "8",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : null,
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "Hexagonal aluminum extrusion",
             "options" : [],
             "pending_url" : null,
             "price" : "3490.00",
             "product_id" : "4257793915",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "1",
             "vendor_id" : "1311348",
             "vendor_product_id" : "HEX-001",
             "weight" : "50.00"
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "7",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : null,
             "duration" : null,
             "handling" : "1.00",
             "images" : [],
             "long_description" : "photo frame with laser etched eagle motif.",
             "name" : "Patriotic photo frame",
             "options" : [],
             "pending_url" : null,
             "price" : "14.95",
             "product_id" : "4186286355",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "1",
             "vendor_id" : "1311348",
             "vendor_product_id" : "AFY",
             "weight" : "1.00"
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "6",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "Lead fishing weights",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : "Exceptional lead fishing weights, not to be eaten under any circumstance.",
             "name" : "Lead weights",
             "options" : [],
             "pending_url" : null,
             "price" : "25.00",
             "product_id" : "4166247708",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "LW-500",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "5",
             "categories" : [
                {
                   "category_id" : "80",
                   "description" : null,
                   "name" : "Education",
                   "parent_id" : null,
                   "parent_name" : null
                }
             ],
             "commission" : null,
             "commission_type" : null,
             "description" : null,
             "duration" : "Forever",
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "Anonymous Online Magazine",
             "options" : [],
             "pending_url" : null,
             "price" : "24.00",
             "product_id" : "4124411144",
             "recurrence" : "1 Month",
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "OMG-0001",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "4",
             "categories" : [
                {
                   "category_id" : "2",
                   "description" : null,
                   "name" : "Business Solutions & Office Products",
                   "parent_id" : null,
                   "parent_name" : null
                }
             ],
             "commission" : null,
             "commission_type" : null,
             "description" : "A metallic ring",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : "A hand-crafted ring produced from locally sourced material.",
             "name" : "Brass Ring",
             "options" : [],
             "pending_url" : null,
             "price" : "1.00",
             "product_id" : "3987434616",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "1",
             "vendor_id" : "1311348",
             "vendor_product_id" : "BRSRNG",
             "weight" : "0.50"
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "3",
             "categories" : [
                {
                   "category_id" : "2",
                   "description" : null,
                   "name" : "Business Solutions & Office Products",
                   "parent_id" : null,
                   "parent_name" : null
                }
             ],
             "commission" : null,
             "commission_type" : null,
             "description" : "The Short Description",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : "The Long Description",
             "name" : "Live Test Product",
             "options" : [],
             "pending_url" : null,
             "price" : "10.00",
             "product_id" : "3970322775",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "LTP-003",
             "weight" : null
          }
       ],
       "response_code" : "OK",
       "response_message" : "Product list successfully retrieved."
    }

Common Error Codes

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