shop.products.list(params?)
Returns a paginated list of visible products for the shop.
Parameters
| Param | Type | Default | Description | | | | |
|---|
limit | number | 50 | Max products to return (max 100) | | | | |
offset | number | 0 | Pagination offset | | | | |
category | string | — | Filter by category name | | | | |
search | string | — | Search by product name | | | | |
sort_by | `‘created_at' | 'name' | 'price' | 'sales' | 'updated_at’` | 'created_at' | Sort field |
sort_order | `‘asc' | 'desc’` | 'desc' | Sort direction | | | |
Response
Product type
Example — Category filter
Example — Search
shop.products.getBySlug(slug)
Returns a single product by its URL slug.
Parameters
| Param | Type | Description |
|---|
slug | string | The product’s URL slug |
Example — Product detail page
Returns ShopiError with status: 404 if the product does not exist or is not visible.