» Products GET API Documentation

Getting all products

Endpoints: GET /products & GET /admin/products

Purpose

This API retrieves a list of products available for customers and administrators. The /products endpoint is used to fetch products based on a customer’s access level, meaning some products may be restricted based on user type or permissions. On the other hand, /admin/products provides access to all products, regardless of restrictions, allowing administrators full control over inventory and visibility. This helps businesses manage product accessibility, control pricing strategies, and ensure restricted products are only available to authorized users. Additionally, it supports filtering, sorting, and pagination to efficiently navigate large product catalogs.

Path Parameters

No path parameters for this endpoint.

Query Parameters

ParameterTypeDescription
maxIntegerNumber of products per request.
offsetIntegerStarting point for pagination. 
order_byStringField to sort results by.
directionStringSort order by ascending or descending.

Use Case

Customers use /products to browse and purchase available products, ensuring they only see items they are eligible to buy. Businesses can apply restrictions based on customer groups, scheduled availability, and password protection, making it ideal for exclusive sales or membership-based access. The /admin/products endpoint allows administrators to manage all products, even those hidden from regular customers, ensuring smooth inventory tracking, bulk updates, and product lifecycle management. This separation helps maintain control over restricted products while allowing flexibility for different user types.

Request Body

No data is required for the request body.

Response

This API returns a list of products along with details such as pricing, stock availability, variations, metadata, and access restrictions. For regular customers, the response includes only products they are allowed to purchase, while administrators receive full product listings, including restricted and password-protected items. Each product contains information such as base price, sale price, stock levels, categories, variations, and SEO metadata to support e-commerce functionality. The response also supports pagination, ensuring efficient retrieval of product lists for large inventories.

GET
https://newwc7.webcommander.com/api/v4/products
Try It Out
GET
https://newwc7.webcommander.com/api/v4/admin/products
Try It Out
{
    "products": [
        {
            "id": "PRODUCT_ID",
            "name": "PRODUCT_NAME",
            "sku": "PRODUCT_SKU",
            "heading": "PRODUCT_HEADING",
            "parents": [
                {
                    "id": "CATEGORY_ID",
                    "name": "CATEGORY_NAME",
                    "is_in_trash": "BOOLEAN",
                    "is_parent_in_trash": "BOOLEAN",
                    "is_disposable": "BOOLEAN"
                }
            ],
            "created_by": {
                "id": "USER_ID",
                "name": "USER_NAME"
            },
            "created_at": "YYYY-MM-DDTHH:MM:SSZ",
            "updated_at": "YYYY-MM-DDTHH:MM:SSZ",
            "product_type": "PRODUCT_TYPE",
            "available": "BOOLEAN",
            "product_page": "PRODUCT_PAGE",
            "product_layout": "PRODUCT_LAYOUT",
            "custom_class": "CUSTOM_CLASS",
            "available_on_date_range": "BOOLEAN",
            "available_from_date": "YYYY-MM-DDTHH:MM:SSZ",
            "available_to_date": "YYYY-MM-DDTHH:MM:SSZ",
            "available_for": "SELECTED_CUSTOMERS",
            "selected_customers": [],
            "restrict_for_selected_customers": [],
            "password_protected": "BOOLEAN",
            "password": "PRODUCT_PASSWORD",
            "available_on_weekdays": {
                "enabled": "BOOLEAN",
                "weekdays": [
                    {
                        "day": "DAY_NAME",
                        "start_hour": "START_HOUR",
                        "start_minute": "START_MINUTE",
                        "end_hour": "END_HOUR",
                        "end_minute": "END_MINUTE"
                    }
                ]
            },
            "base_price": "PRODUCT_BASE_PRICE",
            "cost_price": "PRODUCT_COST_PRICE",
            "is_on_sale": "BOOLEAN",
            "sale_price": "PRODUCT_SALE_PRICE",
            "administrative_status": "BOOLEAN",
            "product_summary": "PRODUCT_SUMMARY",
            "product_description": "PRODUCT_DESCRIPTION",
            "product_pricing_and_stock": {
                "track_inventory": "BOOLEAN",
                "available_stock": "PRODUCT_AVAILABLE_STOCK",
                "low_level_stock": "PRODUCT_LOW_LEVEL_STOCK",
                "minimum_order_quantity": "PRODUCT_MIN_ORDER_QUANTITY",
                "maximum_order_quantity": "PRODUCT_MAX_ORDER_QUANTITY",
                "tax_profile": "TAX_PROFILE",
                "shipping_profile": "SHIPPING_PROFILE",
                "enable_multiple_order": "BOOLEAN",
                "multiple_order_quantity": "PRODUCT_MULTIPLE_ORDER_QUANTITY",
                "on_sale": "BOOLEAN",
                "on_sale_price_type": "SALE_PRICE_TYPE",
                "on_sale_price": "SALE_PRICE",
                "expected_to_pay": "BOOLEAN",
                "expected_to_pay_price": "EXPECTED_TO_PAY_PRICE",
                "enable_call_for_price": "BOOLEAN",
                "restrict_price_for": "RESTRICT_PRICE_FOR",
                "restrict_price_for_except_customers": [],
                "restrict_purchase_for": "RESTRICT_PURCHASE_FOR",
                "restrict_purchase_for_selected_customers": [],
                "hide_price": "BOOLEAN",
                "variation_price": {
                    "label": "VARIATION_LABEL",
                    "display_type": "DISPLAY_TYPE"
                }
            },
            "image_and_video": {
                "images": [],
                "videos": [],
                "specs": [
                    {
                        "id": "SPEC_ID",
                        "filename": "FILE_NAME",
                        "link": "FILE_URL"
                    }
                ]
            },
            "advanced": {
                "advance_information": {
                    "global_trade_item_number": "GLOBAL_TRADE_ITEM_NUMBER",
                    "product_condition": "PRODUCT_CONDITION",
                    "loyality_points": "LOYALTY_POINTS"
                },
                "webtool_disable_tracking": "BOOLEAN",
                "meta_tags": [
                    {
                        "name": "TAG_NAME",
                        "value": "TAG_VALUE",
                        "id": "META_TAG_ID"
                    }
                ],
                "custom_information": "CUSTOM_INFORMATION"
            },
            "related_products": [
                {
                    "id": "RELATED_PRODUCT_ID",
                    "name": "RELATED_PRODUCT_NAME",
                    "url": "RELATED_PRODUCT_URL"
                }
            ],
            "similar_products": [
                {
                    "id": "SIMILAR_PRODUCT_ID",
                    "name": "SIMILAR_PRODUCT_NAME",
                    "url": "SIMILAR_PRODUCT_URL"
                }
            ],
            "seo_configs": [
                {
                    "configKey": "SEO_CONFIG_KEY",
                    "metaTags": [],
                    "id": "SEO_ID",
                    "type": "SEO_TYPE",
                    "value": "SEO_VALUE",
                    "version": "VERSION"
                }
            ],
            "tags": [],
            "custom_properties": "CUSTOM_PROPERTIES",
            "product_variation": {
                "variation_model": "VARIATION_MODEL",
                "types": [
                    {
                        "id": "VARIATION_TYPE_ID",
                        "name": "VARIATION_NAME",
                        "standard": "VARIATION_STANDARD",
                        "options": [
                            {
                                "id": "OPTION_ID",
                                "label": "OPTION_LABEL",
                                "value": "OPTION_VALUE",
                                "default": "BOOLEAN"
                            }
                        ]
                    }
                ],
                "available_combinations": [
                    {
                        "options": [
                            {
                                "id": "OPTION_ID",
                                "index": "OPTION_INDEX",
                                "type": {
                                    "standard": "OPTION_STANDARD",
                                    "isDisposable": "BOOLEAN",
                                    "role": "OPTION_ROLE",
                                    "name": "OPTION_NAME",
                                    "options": [
                                        {
                                            "colorSwatchValue": "COLOR_SWATCH_VALUE",
                                            "cloudConfig": "CLOUD_CONFIG",
                                            "isDefault": "BOOLEAN",
                                            "imageBaseUrl": "IMAGE_BASE_URL",
                                            "id": "OPTION_ID",
                                            "label": "OPTION_LABEL",
                                            "colorHasSwatch": "BOOLEAN",
                                            "type": "OPTION_TYPE",
                                            "idx": "OPTION_INDEX",
                                            "value": "OPTION_VALUE"
                                        }
                                    ],
                                    "id": "OPTION_ID",
                                    "version": "VERSION"
                                },
                                "label": "OPTION_LABEL",
                                "value": "OPTION_VALUE",
                                "color_has_swatch": "BOOLEAN",
                                "color_swatch_value": "COLOR_SWATCH_VALUE",
                                "image_base_url": "IMAGE_BASE_URL"
                            }
                        ],
                        "details": {
                            "variation_id": "VARIATION_ID",
                            "product_name": "PRODUCT_NAME",
                            "sku": "PRODUCT_SKU",
                            "custom_sku": "CUSTOM_SKU",
                            "urls": {
                                "url": "PRODUCT_URL",
                                "product_url": "PRODUCT_URL"
                            },
                            "meta_tags": [],
                            "is_inventory_enabled": "BOOLEAN",
                            "available_stock": "PRODUCT_AVAILABLE_STOCK",
                            "low_stock_level": "PRODUCT_LOW_LEVEL_STOCK",
                            "spec": "SPEC",
                            "is_multiple_order_quantity": "BOOLEAN",
                            "is_on_sale": "BOOLEAN",
                            "is_expect_to_pay": "BOOLEAN",
                            "is_call_for_price_enabled": "BOOLEAN",
                            "is_new": "BOOLEAN",
                            "on_sale_amount_type": "SALE_PRICE_TYPE",
                            "title": "TITLE",
                            "heading": "PRODUCT_HEADING",
                            "summary": "PRODUCT_SUMMARY",
                            "description": "PRODUCT_DESCRIPTION",
                            "model": "PRODUCT_MODEL",
                            "product_condition": "PRODUCT_CONDITION",
                            "base_price": "PRODUCT_BASE_PRICE",
                            "cost_price": "PRODUCT_COST_PRICE",
                            "sale_price": "PRODUCT_SALE_PRICE",
                            "expect_to_pay_price": "EXPECTED_TO_PAY_PRICE",
                            "weight": "PRODUCT_WEIGHT",
                            "height": "PRODUCT_HEIGHT",
                            "length": "PRODUCT_LENGTH",
                            "width": "PRODUCT_WIDTH",
                            "display_price": "DISPLAY_PRICE",
                            "previous_price": "PREVIOUS_PRICE",
                            "min_order_quantity": "PRODUCT_MIN_ORDER_QUANTITY",
                            "max_order_quantity": "PRODUCT_MAX_ORDER_QUANTITY",
                            "multiple_of_order_quantity": "PRODUCT_MULTIPLE_ORDER_QUANTITY",
                            "supported_max_order_quantity": "SUPPORTED_MAX_ORDER_QUANTITY",
                            "images": [],
                            "videos": [],
                            "tax": "PRODUCT_TAX",
                            "taxMessage": "PRODUCT_TAX_MESSAGE"
                        }
                    }
                ]
            }
        }
    ],
    "pagination": {
        "records": "PRODUCT_RECORDS",
        "limit": "PRODUCT_LIMIT",
        "offset": "PRODUCT_OFFSET",
        "previous_page": "PREVIOUS_PAGE",
        "next_page": "NEXT_PAGE_URL"
    }
}

Getting specific product

Endpoints: GET /products/{product_id} &  GET /admin/products/{product_id}

Purpose

The purpose of these endpoints is to retrieve detailed product information. For the admin /admin/products/{product_id} endpoint, it provides all configuration details of the product, including availability, pricing, stock management, SEO settings, and multimedia assets.

Path Parameters

Field
Type
Description
product_id
integer
The unique identifier of the product

Query Parameters 

This endpoint does not have any query parameters.

Use Case

A user retrieves a product's basic details using the first endpoint. An admin /admin/products/{product_id} endpoint retrieves the complete configuration of a product, including stock, pricing, availability, and advanced settings.

Request Body

No data is required for the request body.

Response

The response contains detailed information about a product, including its id, name, SKU, type, availability, and layout. It provides pricing details such as base price, sale price, and inventory tracking. The response also includes availability configurations, such as date range and weekday restrictions. Additionally, it covers product categorization, including parent categories, related products, and similar products. The SEO configurations specify metadata and tracking settings. Multimedia details include images, videos, and specification files. For administrators, the response contains advanced settings, stock limitations, and purchase restrictions. The response ensures a comprehensive overview, enabling efficient management and display of product details.

GET
https://newwc7.webcommander.com/api/v4/products/{product_id}
Try It Out
GET
https://newwc7.webcommander.com/api/v4/admin/products/{product_id}
Try It Out
{
    "product": {
        "id": PRODUCT_ID,
        "name": "PRODUCT_NAME",
        "sku": "PRODUCT_SKU",
        "heading": "PRODUCT_HEADING",
        "parents": [
            {
                "id": PARENT_ID,
                "name": "PARENT_NAME",
                "is_in_trash": false,
                "is_parent_in_tTrash": false,
                "is_disposable": false
            }
        ],
        "product_type": "PRODUCT_TYPE",
        "available": true,
        "product_page": "PRODUCT_PAGE",
        "product_layout": {
            "id": LAYOUT_ID,
            "name": "LAYOUT_NAME"
        },
        "custom_class": "CUSTOM_CLASS",
        "available_on_date_range": true,
        "available_from_date": "AVAILABLE_FROM_DATE",
        "available_to_date": "AVAILABLE_TO_DATE",
        "available_for": "AVAILABLE_FOR",
        "selected_customers": [],
        "restrict_for_selected_customers": [],
        "password_protected": false,
        "password": "",
        "available_on_weekdays": {
            "enabled": true,
            "weekdays": [
                {
                    "day": "WEEKDAY",
                    "start_hour": START_HOUR,
                    "start_minute": START_MINUTE,
                    "end_hour": END_HOUR,
                    "end_minute": END_MINUTE
                }
            ]
        },
        "base_price": BASE_PRICE,
        "cost_price": COST_PRICE,
        "is_on_sale": true,
        "sale_price": SALE_PRICE,
        "administrative_status": true,
        "product_summary": "PRODUCT_SUMMARY",
        "product_description": "PRODUCT_DESCRIPTION",
        "product_pricing_and_stock": {
            "track_inventory": false,
            "available_stock": AVAILABLE_STOCK,
            "low_level_stock": LOW_LEVEL_STOCK,
            "minimum_order_quantity": MIN_ORDER_QUANTITY,
            "maximum_order_quantity": MAX_ORDER_QUANTITY,
            "tax_profile": {},
            "shipping_profile": {
                "id": SHIPPING_ID,
                "name": "SHIPPING_NAME"
            },
            "enable_multiple_order": true,
            "multiple_order_quantity": MULTIPLE_ORDER_QUANTITY,
            "on_sale": true,
            "on_sale_price_type": "ON_SALE_PRICE_TYPE",
            "on_sale_price": ON_SALE_PRICE,
            "expected_to_pay": false,
            "expected_to_pay_price": EXPECTED_TO_PAY_PRICE,
            "enable_call_for_price": true,
            "restrict_price_for": "RESTRICT_PRICE_FOR",
            "restrict_price_for_except_customers": [],
            "restrict_purchase_for": "RESTRICT_PURCHASE_FOR",
            "restrict_purchase_for_selected_customers": [],
            "hide_price": false
        },
        "image_and_video": {
            "images": [
                {
                    "id": IMAGE_ID,
                    "filename": "IMAGE_FILENAME",
                    "thumbnail": "IMAGE_THUMBNAIL",
                    "link": "IMAGE_LINK"
                }
            ],
            "videos": [
                {
                    "id": VIDEO_ID,
                    "filename": "VIDEO_FILENAME",
                    "thumbnail": "VIDEO_THUMBNAIL",
                    "link": "VIDEO_LINK"
                }
            ],
            "specs": [
                {
                    "id": SPEC_ID,
                    "filename": "SPEC_FILENAME",
                    "link": "SPEC_LINK"
                }
            ]
        },
        "advanced": "ADVANCED_SETTINGS",
        "related_products": [
            {
                "id": RELATED_PRODUCT_ID,
                "name": "RELATED_PRODUCT_NAME",
                "url": "RELATED_PRODUCT_URL"
            }
        ],
        "similar_products": [
            {
                "id": SIMILAR_PRODUCT_ID,
                "name": "SIMILAR_PRODUCT_NAME",
                "url": "SIMILAR_PRODUCT_URL"
            }
        ],
        "seo_configs": [
            {
                "configKey": "CONFIG_KEY",
                "metaTags": [],
                "id": CONFIG_ID,
                "type": "CONFIG_TYPE",
                "value": "CONFIG_VALUE",
                "version": null
            }
        ],
        "tags": [],
        "custom_properties": "CUSTOM_PROPERTIES"
    }
}

Getting all Product settings

Endpoint: GET /products/settings

Purpose

This endpoint /products/settings retrieves global product settings used across the platform. These settings control how product pricing, purchasing, and variations are displayed to customers.

Path Parameters

No path parameters for this endpoint.

Query Parameters 

This endpoint does not have any query parameters.

Use Case

This endpoint allows the system to fetch predefined labels and configurations related to pricing, purchasing, and variation display settings. It helps maintain consistency across product pages and ensures that all relevant product configurations are correctly applied.

Request Body

No data is required for the request body.

Response

The response provides global product settings, including custom labels for call-for-price and expected payment, ensuring clarity in product pricing display. It includes a base price label that defines how standard product prices are shown. Additionally, it indicates whether the "Add to Cart" button should be enabled for purchasing. The response also defines the variation option view, determining whether product variations are displayed as a dropdown or another format. These settings are essential for configuring the product page experience and ensuring a seamless shopping interface.
GET
https://newwc7.webcommander.com/api/v4/products/settings
Try It Out
{
    "label_for_call_for_price": "LABEL_CALL_FOR_PRICE",
    "label_for_expect_to_pay": "LABEL_EXPECT_TO_PAY",
    "label_for_base_price": "LABEL_BASE_PRICE",
    "add_to_cart": "ADD_TO_CART_STATUS",
    "variation_option_view": "VARIATION_OPTION_VIEW"
}

Getting products count

Endpoints: GET /products/count & GET /admin/products/count

Purpose

Retrieves the total number of products available. For products/count, it returns the count for customers, groups, or anonymous users based on their access, whereas /admin/products/count provides the full count for all products accessible by the admin.

Path Parameters

No path parameters for this endpoint.

Query Parameters 

This endpoint does not have any query parameters.

Use Case

Customers can use /products/count to get an idea of how many products are available to them in the store, ensuring they see only items they can purchase. Administrators use /admin/products/count for inventory management, tracking total product numbers, including hidden or restricted items. This distinction is useful for managing special promotions, private sales, or exclusive memberships where not all products should be publicly accessible

Request Body

No data is required for the request body.

Response

The response returns the number of products available. For /products/count, this number represents only the products the current customer can access. In contrast, /admin/products/count provides the total number of products in the system, including restricted items. This helps businesses understand inventory size from both a customer and administrative perspective.

GET
https://newwc7.webcommander.com/api/v4/products/count
Try It Out
GET
https://newwc7.webcommander.com/api/v4/admin/products/count
Try It Out
{
    "count": TOTAL_NUMBER_OF_PRODUCT
}