/v1/wms/inventory-counts/*)REST API specification for OPE-ALM-PRO-003: Physical Inventory Audit & Cycle Count in GOAL Backend (Lumen 11 / PHP 8.2). Supports task creation across 5 selection modes, operator assignment, mobile counting & recounting (TStock), in-flight product master enrichment (barcode, UoM, weight/dimensions), line-level reconciliation (INPUT, OUTPUT, LOCATION_TRANSFER), immutable audit logs, official form print payloads (OPE-ALM-FOR-005, OPE-ALM-FOR-006, OPE-ALM-FOR-007), and strict close validation (system_qty == effective_qty).
All endpoints require standard GOAL authentication, tenant headers, and GOAL_V2_WMS_WMS_INVENTORY_COUNT_* permissions:
Authorization: Bearer <token>
x-app-stage: <stage>
x-app-uid: <app_uid>
Accept: application/json
All responses conform to App\Values\Core\ActionResult:
{
"success": true,
"message": "Operation completed successfully.",
"data": {}
}
| Status | Meaning |
|---|---|
200 |
Request succeeded (ActionResult with success: true) |
201 |
Resource created successfully |
400 |
Malformed request or invalid state transition |
401 |
Missing, expired, or invalid Bearer token |
403 |
Missing required GOAL_V2_WMS_WMS_INVENTORY_COUNT_* permission |
404 |
Inventory count, line, or product not found within active company scope |
422 |
Validation error or business invariant failure (e.g., system_qty != effective_qty on close) |
500 |
Unexpected internal server error |
| Method | Endpoint | Permission | Purpose |
|---|---|---|---|
GET |
/v1/wms/inventory-counts |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_LIST |
List inventory count tasks |
POST |
/v1/wms/inventory-counts |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_CREATE |
Create audit task (5 selection modes) |
GET |
/v1/wms/inventory-counts/{uuid} |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_DETAILS |
Retrieve task header and lines |
POST |
/v1/wms/inventory-counts/{uuid}/assign |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_ASSIGN |
Assign operators to task |
POST |
/v1/wms/inventory-counts/{uuid}/count |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_COUNT |
Save partial or submit final count |
POST |
/v1/wms/inventory-counts/{uuid}/flag-recount |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_FLAG_RECOUNT |
Flag lines for recount |
POST |
/v1/wms/inventory-counts/{uuid}/recount |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_RECOUNT |
Submit recount quantities |
POST |
/v1/wms/inventory-counts/{uuid}/lines/{lineUuid}/reconcile |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_RECONCILE |
Reconcile line (INPUT / OUTPUT / LOCATION_TRANSFER) |
POST |
/v1/wms/inventory-counts/{uuid}/close |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_CLOSE |
Close task (system_qty == effective_qty) |
POST |
/v1/wms/inventory-counts/{uuid}/cancel |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_CANCEL |
Cancel task |
GET |
/v1/wms/inventory-counts/{uuid}/logs |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_DETAILS |
Retrieve immutable audit log |
GET |
/v1/wms/inventory-counts/{uuid}/print-data |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_DETAILS |
Retrieve print payload (OPE-ALM-FOR-005/006/007) |
POST |
/v1/wms/inventory-counts/{uuid}/products/{productId}/barcode |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_REGISTER_BARCODE |
Register product barcode during count |
POST |
/v1/wms/inventory-counts/{uuid}/products/{productId}/unit-measures |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_MANAGE_UOM |
Create/confirm product UoM factor |
PATCH |
/v1/wms/inventory-counts/{uuid}/products/{productId}/dimensions |
GOAL_V2_WMS_WMS_INVENTORY_COUNT_UPDATE_DIMENSIONS |
Update product weight & dimensions |
GET /v1/wms/inventory-countsLists paginated inventory count tasks scoped by companyId.
GOAL_V2_WMS_WMS_INVENTORY_COUNT_LISTcompanyId (required, integer), warehouse_id (integer), status (string), selection_mode (string), search (string), page (integer), per_page (integer).200 OK){
"success": true,
"message": "Inventory counts retrieved successfully.",
"data": {
"items": [
{
"uuid": "9c4f8a1e-3d21-4b5a-9e10-1234567890ab",
"code": "AUD-2026-0042",
"warehouse_id": 1,
"selection_mode": "LOCATION_RANGE",
"status": "IN_PROGRESS",
"total_lines": 48,
"counted_lines": 32,
"variance_lines": 3,
"created_at": "2026-11-27T09:00:00Z"
}
],
"total": 1
}
}
POST /v1/wms/inventory-countsCreates a new inventory count task and materializes target lines using one of the 5 selection modes:
ALL_STOCK, LOCATION_RANGE, MOVED_LAST_3_MONTHS, INVENTORY_CATALOG, or MANUAL.
GOAL_V2_WMS_WMS_INVENTORY_COUNT_CREATE{
"company_id": 8,
"warehouse_id": 1,
"selection_mode": "LOCATION_RANGE",
"notes": "Conteo cíclico Pasillo A",
"filters": {
"zone_id": 3,
"location_from": "ALM01-A-01-01",
"location_to": "ALM01-A-04-03"
}
}
[!NOTE]
Mode-specificfilters/ payload fields:
ALL_STOCK: No extra filter required; snapshots all active stock inwarehouse_id.LOCATION_RANGE:zone_id,location_from,location_to.MOVED_LAST_3_MONTHS: Automatically selects SKUs with movements in the last 90 days.INVENTORY_CATALOG:catalog_id,category_id,line_id, orbrand_id.MANUAL:itemsarray of{ "product_id": 101, "location_id": 12 }.
201 Created){
"success": true,
"message": "Inventory count created successfully.",
"data": {
"uuid": "9c4f8a1e-3d21-4b5a-9e10-1234567890ab",
"code": "AUD-2026-0042",
"selection_mode": "LOCATION_RANGE",
"status": "DRAFT",
"total_lines": 48
}
}
GET /v1/wms/inventory-counts/{uuid}Returns full audit header, assigned operators, and line items (system_qty, counted_qty, recounted_qty, effective_qty, variance_qty, status).
GOAL_V2_WMS_WMS_INVENTORY_COUNT_DETAILSPOST /v1/wms/inventory-counts/{uuid}/assignAssigns one or more warehouse operators so the task becomes actionable in TStock.
GOAL_V2_WMS_WMS_INVENTORY_COUNT_ASSIGN{
"company_id": 8,
"operator_user_ids": [42, 47]
}
200 OK){
"success": true,
"message": "Operators assigned successfully.",
"data": {
"uuid": "9c4f8a1e-3d21-4b5a-9e10-1234567890ab",
"status": "ASSIGNED",
"operator_user_ids": [42, 47]
}
}
POST /v1/wms/inventory-counts/{uuid}/countRecords physical counts from TStock. Supports partial draft saves (is_final: false) and final count submission (is_final: true).
GOAL_V2_WMS_WMS_INVENTORY_COUNT_COUNT{
"company_id": 8,
"is_final": true,
"lines": [
{
"line_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
"counted_qty": 55,
"notes": "4 cajas x 12 + 7 unidades"
}
]
}
200 OK){
"success": true,
"message": "Count submitted successfully.",
"data": {
"uuid": "9c4f8a1e-3d21-4b5a-9e10-1234567890ab",
"status": "COUNTED",
"variance_lines": 1
}
}
POST /v1/wms/inventory-counts/{uuid}/flag-recountFlags one or more lines with variances for physical recount (OPE-ALM-FOR-006).
GOAL_V2_WMS_WMS_INVENTORY_COUNT_FLAG_RECOUNT{
"company_id": 8,
"line_uuids": ["a1b2c3d4-0001-4000-8000-000000000001"],
"assigned_user_id": 47,
"reason": "Diferencia mayor al umbral permitido"
}
POST /v1/wms/inventory-counts/{uuid}/recountSubmits physical recount quantities (recounted_qty) for flagged lines, updating effective_qty.
GOAL_V2_WMS_WMS_INVENTORY_COUNT_RECOUNT{
"company_id": 8,
"is_final": true,
"lines": [
{
"line_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
"recounted_qty": 56,
"notes": "Confirmado en segundo conteo"
}
]
}
POST /v1/wms/inventory-counts/{uuid}/lines/{lineUuid}/reconcileReconciles a single line discrepancy using INPUT, OUTPUT, or LOCATION_TRANSFER, updating system_qty so it aligns with effective_qty.
GOAL_V2_WMS_WMS_INVENTORY_COUNT_RECONCILE{
"company_id": 8,
"reconciliation_type": "INPUT",
"quantity": 1,
"target_location_id": null,
"notes": "Sobrante confirmado tras reconteo"
}
[!IMPORTANT]
Whenreconciliation_typeisLOCATION_TRANSFER,target_location_idis required to move stock between bins within the warehouse.
200 OK){
"success": true,
"message": "Line reconciled successfully.",
"data": {
"line_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
"system_qty": 56,
"effective_qty": 56,
"reconciled": true
}
}
POST /v1/wms/inventory-counts/{uuid}/closeCloses the audit task. Strict invariant: all lines must satisfy system_qty == effective_qty with no pending recounts; otherwise returns 422 Unprocessable Entity.
GOAL_V2_WMS_WMS_INVENTORY_COUNT_CLOSE{
"company_id": 8,
"notes": "Acta OPE-ALM-FOR-007 conforme"
}
200 OK){
"success": true,
"message": "Inventory count closed successfully.",
"data": {
"uuid": "9c4f8a1e-3d21-4b5a-9e10-1234567890ab",
"status": "CLOSED",
"closed_at": "2026-11-27T16:40:00Z"
}
}
POST /v1/wms/inventory-counts/{uuid}/cancelCancels an active audit task prior to closure and records the reason in the immutable audit log.
GOAL_V2_WMS_WMS_INVENTORY_COUNT_CANCEL{
"company_id": 8,
"reason": "Alcance de pasillo duplicado"
}
OPE-ALM-FOR-005/006/007)GET /v1/wms/inventory-counts/{uuid}/logsReturns the chronological, append-only audit trail for the inventory count task (assignments, counts, recounts, master-data updates, reconciliations, close/cancel).
GOAL_V2_WMS_WMS_INVENTORY_COUNT_DETAILS200 OK){
"success": true,
"message": "Audit logs retrieved successfully.",
"data": {
"items": [
{
"id": 901,
"action": "RECONCILED",
"user_id": 15,
"line_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
"payload": {
"reconciliation_type": "INPUT",
"quantity": 1,
"system_qty_before": 55,
"system_qty_after": 56
},
"created_at": "2026-11-27T16:35:00Z"
}
]
}
}
GET /v1/wms/inventory-counts/{uuid}/print-dataReturns structured data for rendering official forms:
OPE-ALM-FOR-005: Hoja de Conteo FísicoOPE-ALM-FOR-006: Hoja de ReconteoOPE-ALM-FOR-007: Acta de Reconciliación y CierreGOAL_V2_WMS_WMS_INVENTORY_COUNT_DETAILScompanyId (required, integer), form_code (optional: OPE-ALM-FOR-005 | OPE-ALM-FOR-006 | OPE-ALM-FOR-007).POST /v1/wms/inventory-counts/{uuid}/products/{productId}/barcodeRegisters a newly scanned barcode on the product master during an active count and logs the enrichment event.
GOAL_V2_WMS_WMS_INVENTORY_COUNT_REGISTER_BARCODE{
"company_id": 8,
"barcode": "7750182001234",
"unit_measure_id": 3
}
POST /v1/wms/inventory-counts/{uuid}/products/{productId}/unit-measuresCreates or confirms a product unit-of-measure presentation (STORAGE, PURCHASE, SALE usage flags and conversion factor).
GOAL_V2_WMS_WMS_INVENTORY_COUNT_MANAGE_UOM{
"company_id": 8,
"unit_measure_id": 5,
"conversion_factor": 12,
"is_storage": true,
"is_purchase": true,
"is_sale": false
}
PATCH /v1/wms/inventory-counts/{uuid}/products/{productId}/dimensionsUpdates product weight and physical dimensions captured during the floor audit.
GOAL_V2_WMS_WMS_INVENTORY_COUNT_UPDATE_DIMENSIONS{
"company_id": 8,
"weight": 4.85,
"weight_unit": "KG",
"length": 35.0,
"width": 25.0,
"height": 20.0,
"dimension_unit": "CM"
}
OPE-ALM-PRO-003): Auditoría Física de Inventario y Conteo Cíclico