Products
Physical products with cost, barcode, category and brand, on top of the catalog.
Overview
A product is a catalog item (itm_...) of type product with an extra profile: cost price, barcode, category, brand and shelf life. Products can be used in quotes and invoices like any item, and they are what the Inventory, Purchases, Point of sale and Work orders modules move.
Requires the Products module. An owner or admin turns it on in Settings > Modules. While it is off, every endpoint on this page returns 403 with type permission_error and code module_disabled.
The Product Object
| Field | Description |
|---|---|
item_code | Generated with the module numbering when you omit it (prefix editable in Settings > Prefixes) |
unit_price | Sale price in the major unit of currency (2 decimals) |
cost_price | Unit cost, up to 4 decimals. Used for margins and as the default cost of stock |
barcode | Unique per company. A duplicate returns 409 resource_conflict |
category_id / brand_id | Optional masters (pcat_..., pbrd_...) with their names expanded |
expiry_days | Shelf life in days (0 to 36500), or null |
image_url | Signed URL valid for about 24 hours |
Endpoints
| Method | Path | Permission | Description |
|---|---|---|---|
GET | /v1/products | read | List products (query, category_id, brand_id, barcode, is_active) |
POST | /v1/products | write | Create a product (Idempotency-Key supported) |
GET | /v1/products/{id} | read | Retrieve a product |
POST | /v1/products/{id} | write | Update a product (PATCH is accepted as an alias) |
DELETE | /v1/products/{id} | admin | Delete a product (soft delete) |
GET | /v1/product-categories | read | List categories (query) |
POST | /v1/product-categories | admin | Create a category |
GET | /v1/product-brands | read | List brands (query) |
POST | /v1/product-brands | admin | Create a brand |
Create a Product
name and unit_price (a JSON number) are required. The product starts active, unit defaults to unit and currency to USD. Creating a product emits item.created; updating it emits item.updated and deleting it item.deleted.
Find a Product by Barcode
Categories and Brands
Categories and brands are simple masters with a name. Creating them is module configuration, so it needs an admin key; a name that already exists returns 409 resource_conflict.