Language

2Checkout Documentation

List

You must specify your API username and password when creating your 2checkout-node object (named ‘tco’ in these examples) before calling this method.

Description

Use to retrieve a list of products.

Arguments

  • object - Object containing List Products
  • parameters.
  • callback - Function to be called on success/error

Returns

  • Array of product objects.

Example Usage:

args = {
    pagesize: 20
};

tco.products.list(args, function (error, data) {
    if (error) {
        console.log(error);
    } else {
        console.log(data.response_code);
    }
});

Example 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."
}