The Products API manages the core inventory item master data, SKU lifecycle, unit measure conversions, barcode assignments, stock balances, recent acquisition costs, and picker lookups across the GOAL ecosystem.
remote_id)Each product row may store remote_id, mapped from SAP Business One OITM.DocEntry. This stable identifier is used when synchronizing from SAP so that an ItemCode change in the ERP updates the same GOAL product instead of creating a duplicate.
Match order during SAP sync:
products.code = SAP ItemCodeproducts.remote_id = SAP DocEntryIf both lookups resolve to different GOAL rows, sync fails with a conflict error (manual data cleanup required).
/v1/inventory/product/products/v1/inventory/product/product-resources| Header | Type | Description |
|---|---|---|
Authorization |
string |
Bearer <token> OAuth2 token. |
x-app-stage |
string |
Current tenant stage (dev, staging, prod). |
x-app-uid |
string |
Authenticated client UUID. |
| Parameter | Type | Default | Description |
|---|---|---|---|
companyId |
integer |
Required | Active operating company ID. |
view |
string |
A |
Filter: A (Active), I (Inactive), D (Trashed), ALL (All records). |
search |
string |
- | Case-insensitive search on SKU, name, or external code. |
page |
integer |
1 |
Pagination page number. |
limit |
integer |
15 |
Page size. |
Retrieve paginated product catalog with filtering on categories, brands, and suppliers.
GET /v1/inventory/product/products?companyId=1&view=A&search=PILSEN&limit=15
200 OK{
"success": true,
"message": "Proceso realizado correctamente",
"data": [
{
"id": 1042,
"uuid": "7a8b9c0d-1234-4567-89ab-cdef01234567",
"company_id": 1,
"code": "7750106001201",
"sku": "CERV-PIL-355",
"name": "CERVEZA PILSEN CALLAO LATA 355ML",
"description": "Sixpack lata 355ml Pilsen Callao",
"brand_id": 14,
"brand_name": "Pilsen Callao",
"supplier_id": 2,
"supplier_name": "BACKUS Y JOHNSTON",
"category_id": 5,
"clasification_id": 2,
"line_id": 8,
"status": "A",
"created_at": "2026-01-15T08:00:00.000Z"
}
],
"meta": {
"total": 1,
"current_page": 1,
"last_page": 1,
"per_page": 15
}
}
Denormalized read model for the inventory products maintenance grid (v_inventory_products_grid). Returns a flat array (max 5000 rows) suitable for client-side GMGrid export.
GET /v1/inventory/product/products/grid?companyId=1&view=A&supplier_id=2&limit=5000
| Parameter | Type | Required | Description |
|---|---|---|---|
companyId |
integer |
Yes | Target company ID. |
view |
string |
No | A (active), I (inactive), ALL (active + inactive; excludes soft-deleted). Default A. |
supplier_id |
integer |
No | Filter by supplier. |
brand_id |
integer |
No | Filter by brand. |
category_ids |
string |
No | Comma-separated category IDs (parent expands to children). |
clasification_line_id |
integer |
No | Classification line ID. |
clasification_class_id |
integer |
No | Classification class ID. |
clasification_family_id |
integer |
No | Classification family ID. |
clasification_subfamily_id |
integer |
No | Classification subfamily ID. |
classification_keys |
string |
No | Comma-separated keys: class-{id}, family-{id}, subfamily-{id}, line-{id}. |
product_codes |
string |
No | Comma-separated product codes. |
product_ids |
string |
No | Comma-separated product IDs (e.g. from product finder selection). |
search |
string |
No | ILIKE on code, name, or barcode. |
is_refrigerated |
string |
No | Y or N — cold-chain SKUs. |
is_medical |
string |
No | Y or N — regulated / medical SKU. |
frozen_level |
string |
No | low, medium, high, or extreme (only meaningful when is_refrigerated=Y). |
limit |
integer |
No | Max rows (default 5000, cap 5000). |
200 OK{
"success": true,
"message": "Proceso realizado correctamente",
"data": [
{
"id": 1042,
"product_id": 1042,
"uuid": "7a8b9c0d-1234-4567-89ab-cdef01234567",
"company_id": 1,
"code": "CERV-PIL-355",
"name": "CERVEZA PILSEN CALLAO LATA 355ML",
"status": "A",
"supplier_code": "PROV-01",
"supplier_name": "BACKUS Y JOHNSTON",
"brand_name": "Pilsen Callao",
"category_name": "Cervezas",
"class_name": "Bebidas",
"family_name": "Cerveza",
"subfamily_name": "Lata",
"line_name": "355ml",
"barcode": "7750106001201",
"stock": 1200,
"image_code": "IMG-001",
"is_refrigerated": true,
"frozen_level": "high",
"is_medical": false
}
]
}
| HTTP | When |
|---|---|
401 |
Missing or invalid bearer token. |
403 |
User lacks inventory product list permission. |
422 |
Invalid companyId or parameters. |
500 |
Server error. |
High-performance endpoint optimized for admin assortment selectors, promotion product pickers, and order lines.
GET /v1/inventory/product/products/picker?companyId=1&search=PILSEN&category_ids[]=5
| Parameter | Type | Required | Description |
|---|---|---|---|
companyId |
integer |
Yes | Target company ID. |
search |
string |
No | Search query for SKU or product name. |
supplier_id |
integer |
No | Filter by supplier. |
brand_id |
integer |
No | Filter by brand. |
category_ids |
array |
No | Array of category IDs. |
clasification_line_id |
integer |
No | Scope to classification line. |
200 OK{
"success": true,
"data": {
"data": [
{
"product_id": 1042,
"uuid": "7a8b9c0d-1234-4567-89ab-cdef01234567",
"code": "CERV-PIL-355",
"name": "CERVEZA PILSEN CALLAO LATA 355ML",
"brand_name": "Pilsen Callao",
"supplier_name": "BACKUS Y JOHNSTON"
}
],
"total": 1,
"current_page": 1,
"per_page": 15
}
}
GET /v1/inventory/product/products/1042?companyId=1
Returns real-time physical, committed, and available stock across all warehouses.
GET /v1/inventory/product/products/1042/stock?companyId=1
{
"success": true,
"data": [
{
"warehouse_id": 1,
"warehouse_code": "01",
"warehouse_name": "CENTRAL HUACHIPA",
"on_hand": 1240.0,
"is_commited": 180.0,
"on_order": 500.0,
"available": 1060.0
}
]
}
GET /v1/inventory/product/products/1042/recent-costs?companyId=1
All calls require companyId (and should also send company_id with the same value). Master unit_measures referenced by presentations are scoped per company — see Unit Measures API.
GET /v1/inventory/product/products/1042/unit-measures?companyId=8&company_id=8
Returns defined units (UND, SIXPACK, CAJA) with calculated net weight and volume.
GET /v1/inventory/product/products/1042/unit-rows?companyId=8&company_id=8
Used by GOAL Web tab Presentaciones (product-unit-measures-panel.js).
PUT /v1/inventory/product/products/1042/unit-measures?companyId=8&company_id=8
Content-Type: application/json
{
"id": 1042,
"company_id": 8,
"sale_product_unit_measure_id": 5012,
"sell_product_factor": 6
}
Assign specific EAN-13 barcodes to units of measure.
PUT /v1/inventory/product/products/1042/unit-rows?companyId=8&company_id=8
Content-Type: application/json
{
"unit_id": 3,
"barcode": "7750106001256",
"external_code": "EAN-SIXPACK"
}
gproc.gitm2)Legacy Presentaciones de compra tab (supplier packaging codes on SAP). Replaces Gadmin measures / measure-add / measure-update.
GET /v1/inventory/product/products/{id}/purchase-measures?companyId=8
Authorization: Bearer <token>
x-app-stage: dev
x-app-uid: <client-uuid>
Response (ActionResult):
{
"success": true,
"message": "Presentaciones de compra obtenidas",
"data": {
"measures": [
{
"id": 12,
"seq": 1,
"itemcode": "SKU001",
"FrgnName": "PROV-CODE-1",
"CardCode": "P001",
"CardName": "Proveedor Demo",
"unitmsr": "PZA",
"numpermsr": 1,
"isdefault": "Y"
}
],
"cardCode": "P001",
"ItemName": "Producto demo",
"itemcode": "SKU001"
}
}
Create
POST /v1/inventory/product/products/{id}/purchase-measures?companyId=8
Content-Type: application/json
{
"FrgnName": "PROV-CODE-1",
"CardCode": "P001",
"unitmsr": "PZA",
"numpermsr": 1,
"isdefault": "N",
"seq": 0
}
Update (by gitm2.id):
PUT /v1/inventory/product/products/{id}/purchase-measures/12?companyId=8
Content-Type: application/json
{
"changes": {
"FrgnName": "PROV-CODE-2",
"numpermsr": 6,
"isdefault": "Y"
}
}
Delete
DELETE /v1/inventory/product/products/{id}/purchase-measures/12?companyId=8
| HTTP | Permission |
|---|---|
GET |
GOAL_V2_INVENTORY_MASTER_PRODUCT_DETAILS |
POST, PUT, DELETE |
GOAL_V2_INVENTORY_MASTER_PRODUCT_UPDATE_MEASURES |
Suppliers for the form dropdown: GET /v1/inventory/product/product-resources/suppliers?companyId=8 (Supplier::getMySupplier).
GET /v1/inventory/product/products/1042/prices?companyId=1
Forces recalculation of selling prices based on active margin policies.
POST /v1/inventory/product/products/1042/renew-prices?companyId=1
POST /v1/inventory/product/products/1042/reset-margin?companyId=1
POST /v1/inventory/product/products?companyId=1
Content-Type: application/json
Behaviour (post-create bootstrap): After validation, the API runs BootstrapProductDependenciesAction inside a DB transaction. For inventory products (for_inventory: Y), it ensures an active minimum product_unit_measures row (conversion_factor = 1) and wires operational roles (mínima, almacén, compra, venta) via Product::trySet*. SyncProductMinimumPresentationIdentifiersAction then copies barcode → minimum PUM barecode and supplier_catalog_code → minimum PUM external_code (dual-write: products columns remain the SAP mirror). The request may send a global unit_measures.id in unit_measure_id; the response reflects ProductUnitMeasure ids on unit_measure_id and *_product_unit_measure_id.
Required fields (create): company_id, code, name, unit_measure_id (global UM id), buy_product_factor, sell_product_factor.
Unit-measure fields (send on express / fast create): unit, factor_um, warehousing_measure, warehousing_factor, buy_product_measure, buy_product_factor, sell_product_measure, sell_product_factor, sub_unit_factor, optional sub_unit_measure_id, physical UMs weight_um / dimension_um / volume_um, supplier_umes, supplier_umes_unit_id. Operational *_unit_measure_id FKs may be omitted or null on create; bootstrap assigns them.
{
"company_id": 1,
"code": "CERV-CUS-330",
"name": "CERVEZA CUSQUEÑA TRIGO BOTELLA 330ML",
"type": "I",
"brand_id": 15,
"product_category_id": 5,
"product_clasification_id": 12,
"product_accounting_group_id": 3,
"division_id": 1,
"supplier_id": 2,
"unit_measure_id": 10,
"unit": "NIU",
"factor_um": 1,
"warehousing_measure": "NIU",
"warehousing_factor": 1,
"buy_product_measure": "NIU",
"buy_product_factor": 1,
"sell_product_measure": "NIU",
"sell_product_factor": 1,
"sub_unit_factor": 1,
"for_purchase": "Y",
"for_sale": "Y",
"for_inventory": "Y",
"weight_um": 2,
"dimension_um": 4,
"volume_um": 6
}
200 OKReturns ProductResource with PUM-linked unit_measure_id when bootstrap succeeded.
PUT /v1/inventory/product/products/{id}?companyId=1
Content-Type: application/json
Accepts the same field subset as create (partial update). When the company uses SAP B1, mappable attributes are pushed to OITM inside an SB1 DB transaction; GOAL changes are committed in a paired GOAL transaction. After save, SyncProductMinimumPresentationIdentifiersAction updates the minimum presentation row (barecode, external_code) from barcode and supplier_catalog_code.
| Field | Type | Rules |
|---|---|---|
is_refrigerated |
Y / N |
Default N. |
frozen_level |
string | null |
Required when is_refrigerated=Y. Allowed: low, medium, high, extreme. Cleared when not refrigerated. |
is_medical |
Y / N |
Default N. |
ProductResource also returns frozen_level_info: { id, name } when frozen_level is set.
{
"is_refrigerated": "Y",
"frozen_level": "medium",
"is_medical": "N"
}
GET product (show): ProductResource exposes barcode and supplier_catalog_code for forms preferring non-empty values from the linked minimum product_unit_measures row (unitMeasure) when present. unitRows[0] continues to show the raw PUM fields.
ERP item missing: If SAP has no row for the product code, GOAL still saves the update and the API returns success: true with message
El producto no existe en el ERP; los cambios se guardaron solo en GOAL.
(HTTP 200 — informational, not an error.)
ERP item present: Both GOAL and SB1 commits succeed together; on SAP update failure, both transactions roll back.
POST /v1/inventory/product/products/bulk-update-weight-volume?companyId=1
Content-Type: application/json
{
"items": [
{
"product_id": 1042,
"weight_kg": 0.380,
"volume_m3": 0.00045
}
]
}
Forces synchronization of OITM attributes from SAP B1. Resolves the GOAL product by ItemCode, then by DocEntry (remote_id), and refreshes code when SAP renamed the item.
POST /v1/inventory/product/products/1042/sync-product?companyId=1
CLI (bulk or single item): see goal:products:sync-from-sap in Artisan Commands Catalog.
Fast cached lookups used to populate product forms and filters:
| Endpoint | Description |
|---|---|
GET /v1/inventory/product/product-resources/companies |
List operating companies |
GET /v1/inventory/product/product-resources/suppliers |
List product suppliers |
GET /v1/inventory/product/product-resources/goods-suppliers |
List goods procurement suppliers |
GET /v1/inventory/product/product-resources/clasifications |
Classifications dictionary |
GET /v1/inventory/product/product-resources/categories |
Categories dictionary |
GET /v1/inventory/product/product-resources/brands |
Brands dictionary |
GET /v1/inventory/product/product-resources/units |
Measurement units dictionary |
GET /v1/inventory/product/product-resources/divisions |
Operating divisions dictionary |
GET /v1/inventory/product/product-resources/labels |
Commercial labeling flags |
GET /v1/inventory/product/product-resources/default-attributes?companyId={id} |
Product create defaults (flags, factors, unit codes from settings.inventory.product_defaults) |
Company-maintained unit defaults live under Configuración → Inventario → Unidades predeterminadas (producto) (settings.inventory.product_defaults). Codes must match global presentation / weight / dimension / volume unit catalogs.
product_unit_measures: Inventory, Purchase, Sale & Order Registry)Each product defines operational unit-of-measure references on products backed by presentation rows in product_unit_measures:
| Role / Context | Source / Rule | Enforcement |
|---|---|---|
| Minimum Unit Measure | products.unit_measure_id (conversion_factor = 1, default PZA x 1) |
Guaranteed active by EnsureProductMinimumUnitMeasuresAction (for_inventory = 'Y'). |
| Inventory / Warehouse | products.warehousing_unit_measure_id |
Must belong to the same product_id. |
Purchase (for_purchase) |
Any active row in product_unit_measures for the product (buy_product_unit_measure_id is the default) |
ProductUnitMeasurePolicy::eligibleForPurchaseQuery() |
Sale (for_sale) |
Only the minimum unit (conversion_factor = 1) and products.sale_product_unit_measure_id (when NULL, only CF = 1 is sellable) |
ProductUnitMeasurePolicy::isEligibleForSale(), for_sale flag sync, HTTP 422 on non-eligible manual for_sale = true, and filtered in SyncSalesTeamGroupProductMeasuresAction, SyncOnlineStoreProductMeasuresAction, BeesStoreProductMeasureQuery, and interactive WEB order lines. |
| Received Orders (Mobile, BEES, Online Store, ERP) | Inbound unit_of_measure and conversion_factor (CF) are preserved verbatim |
SaveGoalOrderAction, NormalizeMobileGoalOrderPayloadAction, CreateOrderFromBeesAction, ProcessAllBeesForceOrdersAction, and CreateOrderLineAction / UpdateOrderLineAction (when shouldPreserveReceivedPresentation() is true) never mutate, truncate, or reject received CF so ticket totals stay exact. |