Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/astrxnomo/shop-microservers/llms.txt

Use this file to discover all available pages before exploring further.

This endpoint fetches a single product from the catalog database by its CUID. It requires no authentication and returns the complete product object, including the live stock count. Use this endpoint when you need up-to-date inventory information before displaying a product detail page or initiating a checkout.

Endpoint

GET /api/catalog/products/:id
No authentication is required to fetch a product by ID.

Request

Path parameters

id
string
required
The CUID of the product to fetch. CUIDs are returned in the id field of every product object from List Products.

Example request

curl http://localhost/api/catalog/products/clxxxxxxxxxxxxx

Response

200 — Success

Returns a JSON envelope containing the matching product as the data object.
{
  "success": true,
  "data": {
    "id": "clxxxxxxxxxxxxx",
    "name": "Wireless Headphones",
    "price": 79.99,
    "imageUrl": "https://example.com/headphones.jpg",
    "stock": 50,
    "category": "Electronics",
    "createdAt": "2024-01-15T10:30:00.000Z",
    "updatedAt": "2024-01-15T10:30:00.000Z"
  },
  "error": null
}

Response fields

id
string
required
CUID unique identifier for the product.
name
string
required
Human-readable display name of the product.
price
number
required
Unit price as a decimal number (e.g. 79.99). Stored as a PostgreSQL Float.
imageUrl
string
required
Fully qualified URL pointing to the product’s image asset.
stock
number
required
Current available inventory count. This value reflects any decrements applied by the orders service.
category
string
required
Category label assigned to the product (e.g. "Electronics", "Clothing").
createdAt
string
required
ISO 8601 timestamp recording when the product record was first created.
updatedAt
string
required
ISO 8601 timestamp recording the most recent update to the product record.

404 — Product Not Found

Returned when no product with the given id exists in the database. The service throws an AppError with status 404.
{
  "success": false,
  "data": null,
  "error": "Product not found"
}

Build docs developers (and LLMs) love