Skip to main content
GET
Error

Query Parameters

page
integer
default:1

Current page of the collection.

per_page
integer
default:10

Maximum number of items to return per page.

Required range: x <= 100

Limit results to those matching a search string.

category
string

Limit results to products in specific categories.

tag
string

Limit results to products with specific tags.

type
enum<string>

Limit results to products of specific type.

Available options:
simple,
grouped,
external,
variable

Limit results to featured products.

on_sale
boolean

Limit results to products on sale.

min_price
string

Limit results to products with price greater than or equal to this value.

max_price
string

Limit results to products with price less than or equal to this value.

stock_status
enum<string>

Limit results to products with specified stock status.

Available options:
instock,
outofstock,
onbackorder
orderby
enum<string>
default:date

Sort products by field.

Available options:
date,
id,
include,
title,
slug,
price,
popularity,
rating,
menu_order,
alphabetical,
reverse_alpha,
relevance,
rand,
by_stock,
review_count,
on_sale_first,
featured_first,
price_asc,
price_desc,
sales
order
enum<string>
default:DESC

Sort order.

Available options:
ASC,
DESC
slug
string

Limit result set to products with a specific slug.

after
string<date-time>

Limit response to products created after a given ISO8601 compliant date.

before
string<date-time>

Limit response to products created before a given ISO8601 compliant date.

sku
string

Limit result set to products with specific SKU(s). Use commas to separate.

hide_free
boolean
default:false

Limit result set to hide free products.

category_operator
enum<string>
default:in

Operator to compare product category terms.

Available options:
in,
not_in,
and
tag_operator
enum<string>
default:in

Operator to compare product tags.

Available options:
in,
not_in,
and
brand
string

Limit result set to products assigned a set of brand IDs or slugs, separated by commas.

brand_operator
enum<string>
default:in

Operator to compare product brand terms.

Available options:
in,
not_in,
and
show_reviews
boolean
default:false

Returns product reviews for all products or an individual product.

return_variations
boolean
default:false

Returns all variations for variable products.

attribute_relation
enum<string>
default:and

The logical relationship between attributes when filtering across multiple at once.

Available options:
in,
and
catalog_visibility
enum<string>
default:visible

Determines if hidden or visible catalog products are shown.

Available options:
any,
visible,
catalog,
search,
hidden
rating
enum<integer>[]

Limit result set to products with a certain average rating.

Available options:
1,
2,
3,
4,
5
offset
integer

Offset the result set by a specific number of items.

include
integer[]

Limit result set to specific IDs.

exclude
integer[]

Ensure result set excludes specific IDs.

parent
integer[]

Limit result set to those of particular parent IDs.

parent_exclude
integer[]

Limit result set to exclude particular parent IDs.

Response

Products retrieved successfully.

CoCart v2 Products collection response with pagination

products
object[]

Array of products

page
integer

Current page number

total_pages
integer

Total number of pages

total_products
integer

Total number of products