Skip to main content

Get Products

Retrieve a list of products from your store.

Only draft and published products are returned, newest first; archived products never appear. Narrow the list with the optional filters below — for example status=draft to return only unpublished products, or query=coffee to search by name or description. All filters combine with AND.

Request

GET /products

Query Parameters

ParameterTypeRequiredDefaultDescription
pageintegerNo1Page number for pagination
per_pageintegerNo10Items per page (min: 1, max: 100).
sortstringNo-created_atSort order: created_at or name. Prefix with - for descending.
statusstringNoFilter by publication status. One of draft or published.
created_fromstringNoOnly products created on or after this date (inclusive), YYYY-MM-DD.
created_tostringNoOnly products created on or before this date (inclusive), YYYY-MM-DD.
querystringNoSearch term. Partial, case-insensitive match on product name or description.

Omitting a filter or passing it empty means "no filter on that field". Passing a non-empty but unparseable value — an unknown status, a malformed date, an out-of-range per_page, or an unknown sort field — returns a 400 (see Bad Request). The query term is matched loosely and never returns a 400.

Ordering: Products default to created_at descending (newest first) unless sort is supplied.

Counting matches: every response includes the filtered total in pagination.total. To get only a count, request per_page=1 and read pagination.total.

Example Request

curl -X GET "https://cart.easy.tools/api/v1/products?status=published&query=coffee" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Response

Success Response (200)

Returns a paginated list of products.

{
"items": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "published",
"name": "Premium Coffee Beans",
"description": "High-quality arabica coffee beans from Colombia",
"image_url": "https://example.com/images/coffee-beans.jpg",
"checkout_url": "https://cart.easy.tools/checkout/550e8400-e29b-41d4-a716-446655440000",
"currency": "usd"
},
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"status": "draft",
"name": "Organic Tea Selection",
"description": null,
"image_url": null,
"checkout_url": "https://cart.easy.tools/checkout/550e8400-e29b-41d4-a716-446655440001",
"currency": "eur"
}
],
"pagination": {
"current_page": 1,
"total_pages": 5,
"per_page": 10,
"total": 45
}
}

Response Fields

FieldTypeNullableDescription
idstringNoUnique identifier for the product (UUID)
statusstringNoProduct status (e.g., "published" or "draft")
namestringNoProduct name
descriptionstringYesProduct description
image_urlstringYesURL to the product image
checkout_urlstringNoDirect checkout URL for the product
currencystringNoISO currency code (e.g., "usd", "eur")

Pagination Object

FieldTypeDescription
current_pageintegerCurrent page number
total_pagesintegerTotal number of pages
per_pageintegerEffective page size (echoes the per_page request parameter)
totalintegerTotal number of products, across all pages

Error Responses

Bad Request (400)

Returned when status is not a valid value, a date is malformed, per_page is out of range, or sort names an unknown field. The message names the offending parameter and the value received.

{
"message": "Invalid value for 'status': 'archived'"
}

Unauthorized (401)

{
"message": "Unauthenticated."
}