POST /api/product/list-product — Paginated product catalog
Fetch a paginated list of all products in the catalog, sorted newest-first. Authentication is optional — accessible to both guests and logged-in users.
Use this file to discover all available pages before exploring further.
The list endpoint returns a paginated slice of the full product catalog, sorted newest-first. It is accessible without authentication, making it suitable for public-facing storefronts. When called with a valid token the request is processed identically — the TokenOptional middleware simply attaches user context when a token is present, without blocking unauthenticated requests.Pagination is controlled via path parameters. If pag and perpage are omitted, the server defaults to page 1 with 10 items per page.
# Fetch the first page with 10 products (default)curl -X POST https://your-domain.com/api/product/list-product# Fetch page 2 with 5 products per pagecurl -X POST https://your-domain.com/api/product/list-product/2/5# Authenticated request (token optional — same response shape)curl -X POST https://your-domain.com/api/product/list-product/1/20 \ -H "Authorization: Bearer <token>"