Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CodexaCP/DG_BACK/llms.txt

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

Dragon Guard maintains a company-scoped product catalog in which every item record carries master data (UOM, barcodes, tracking flags, dimensions), inventory policy flags such as AllowNegativeAvailable, and optional image attachments. All catalog endpoints are tenant-isolated: the resolved CompanyId from the JWT or the optional ?companyId= override is enforced on every query and mutation.

Items

List items

activeOnly=true is the default. Pass activeOnly=false to include inactive items (useful for admin audit views).
GET /api/items
Query parameters
companyId
uuid
Override company. Resolved from JWT when omitted.
activeOnly
boolean
default:"true"
Filter to active items only.
Free-text match on itemNo, description, uom, or itemType.
pageNumber
integer
default:"1"
1-based page number.
pageSize
integer
default:"20"
Records per page.
Response PagedResponse<ItemDto>
data[].id
uuid
UUID primary key.
data[].itemNo
string
Business item number (e.g. ITM-000001 or ERP code).
data[].description
string
Item description.
data[].uom
string
Primary unit of measure.
data[].isActive
boolean
Active flag.
data[].allowNegativeAvailable
boolean
Whether the item permits negative available inventory.
data[].itemType
string
Type classification (e.g. Inventory, Service).
data[].barcode
string
Primary barcode.
data[].baseUOM
string
Base unit of measure used for conversions.
data[].categoryCode
string
Category classification code.
data[].brand
string
Brand name.
data[].abcClass
string
ABC inventory classification.
data[].images
array
List of {id, url, isPrimary} image summaries.

Get item by ID

GET /api/items/{id}
Returns a full ItemDetailDto which includes all ItemDto fields plus:
salesUOM
string
Sales unit of measure.
purchaseUOM
string
Purchase unit of measure.
conversionFactor
decimal
UOM conversion factor.
isLotTracked
boolean
Lot tracking flag.
isSerialTracked
boolean
Serial tracking flag.
isExpirationTracked
boolean
Expiration date tracking flag.
unitWeight
decimal
Weight per unit.
unitVolume
decimal
Volume per unit.
length
decimal
Physical length.
width
decimal
Physical width.
height
decimal
Physical height.
part_No
string
Manufacturer part number.
alternative_Code
string
Alternative item code.
quantityOnHand
decimal
Current on-hand quantity from CurrentStock.
qtyOnPurchOrder
decimal
Quantity pending on open receiving lines.
qtyOnSalesOrder
decimal
Quantity committed on open shipment lines.
qtyAvailable
decimal
On-hand minus qty on sales order.
stockoutWarning
boolean
true when on-hand ≤ 0.

Get item by item number

GET /api/items/by-itemno/{itemNo}
Identical shape to GET /api/items/{id}. For GrupoMASNative tenants this endpoint proxies to the MAS item-lookup service first; it falls back to the local catalog automatically when the provider is unavailable.

Create item

POST /api/items/create_item
Only allowed for Standalone tenants. GrupoMASNative, GenericApi, and BusinessCentralNative tenants must manage items through their ERP integration. Creating on an ERP-managed tenant returns 409 Conflict with messageKey: "validation.itemsErpManaged". Requires ADMIN or SUPERVISOR role.
Request body (CreateItemDto)
description
string
Item description.
uom
string
required
Primary unit of measure.
itemType
string
required
Item type classification.
barcode
string
Primary barcode.
altBarcode
string
Alternate barcode.
part_No
string
Manufacturer part number.
alternative_Code
string
Alternative item code.
isLotTracked
boolean
Enable lot tracking.
isSerialTracked
boolean
Enable serial tracking.
isExpirationTracked
boolean
Enable expiration tracking.
allowNegativeAvailable
boolean
default:"false"
Permit negative available inventory. Defaults to false for new items.
unitWeight
decimal
Weight per unit.
unitVolume
decimal
Volume per unit.
baseUOM
string
required
Base unit of measure.
salesUOM
string
Sales unit of measure.
purchaseUOM
string
Purchase unit of measure.
categoryCode
string
Category code.
brand
string
Brand name.
initialQuantity
decimal
Opening stock quantity. When > 0, an InventoryMovement with movementType = "WEB_CREATION" is written to the resolved bin.
locationId
uuid
Target location for initial stock.
binId
uuid
Target bin for initial stock. Falls back to tenant default bin.
images
array
List of {url, isPrimary} image objects.
Response
{ "message": "Item created successfully", "id": "...", "itemNo": "ITM-000001" }
The item number is auto-generated from a DocumentSequences row with documentType = "ITEM_CREATED" using format ITM-NNNNNN.

Update item

PUT /api/items/{id}
Accepts the same fields as CreateItemDto (via UpdateItemDto) plus isActive. If images is supplied, existing images are replaced entirely.

Item Images

Upload an image

POST /api/item-images/upload
Content-Type: multipart/form-data
Multipart form upload. Associates the image with the specified itemId and stores the URL.
file
file
required
Image file (.jpg, .jpeg, .png, or .webp, max 5 MB).
itemId
uuid
required
UUID of the item to attach the image to.
Response ItemImageDto
{ "id": "...", "url": "/images/items/{itemId}/{filename}", "isPrimary": false }

Bulk Import & Export

Dragon Guard supports Excel-based bulk operations using the ITEMS_MASTER configuration package format, validated by an embedded __wms_package metadata sheet.

Export items as Excel

GET /api/items/export-config
Downloads items_config_package.xlsx with all current items plus a pre-populated LocationCode/BinCode column pair drawn from the tenant default warehouse.

Preview an import

POST /api/items/preview-config
Content-Type: multipart/form-data
file
file
required
Excel file (.xlsx).
Returns a preview showing which rows would be CREATE vs UPDATE, validation errors, and a confirmationToken to use when applying.

Apply an import

POST /api/items/apply-config
Content-Type: multipart/form-data
file
file
required
Excel file (.xlsx).
confirmationToken
string
required
Token from preview response.
Required columns (minimum 24): ItemNo, Description, UOM, BaseUOM, SalesUOM, PurchaseUOM, ItemType, IsActive, Barcode, AltBarcode, IsLotTracked, IsSerialTracked, IsExpirationTracked, UnitWeight, UnitVolume, Length, Width, Height, CategoryCode, Brand, ABCClass, Part_No, Alternative_Code, AllowNegativeAvailable. Optional trailing columns: LocationCode, BinCode. When omitted the tenant default location/bin is applied.
LocationCode + BinCode must exist and be active for the tenant. The API validates all location/bin combinations during preview before any rows are committed.

Stock Queries

Basic stock

GET /api/stock
Returns paginated (itemId, binId, stockQty) tuples for all current stock in the active company.
companyId
uuid
Override company. Resolved from JWT when omitted.
pageNumber
integer
default:"1"
Page number.
pageSize
integer
default:"20"
Records per page.

Enriched stock

GET /api/stock/enriched
Joins stock with item master and bin/location data to return a rich StockEnrichedDto per row:
itemNo
string
Item number.
itemDescription
string
Item description.
itemUOM
string
Unit of measure.
binCode
string
Bin code where stock is held.
locationCode
string
Location code of the bin.
stockQty
decimal
Quantity on hand in this bin.
allowPicking
boolean
Whether the bin allows picking.
allowPutaway
boolean
Whether the bin allows putaway.
isBlocked
boolean
Whether the bin is currently blocked.
imageUrl
string
First image URL for the item.
companyId
uuid
Override company. Resolved from JWT when omitted.
search
string
Filter by item number, description, bin code, or location code.
pageNumber
integer
default:"1"
Page number.
pageSize
integer
default:"20"
Records per page.

Handheld Product Inquiry

The products-inquiry endpoint is purpose-built for the Dragon Guard mobile handheld. It returns a flat list — one row per ItemNo + Location + Bin — and is the preferred catalog view for handheld devices because it includes items with zero or negative stock.
GET /api/items/products-inquiry
companyId
uuid
Override company. Resolved from JWT when omitted.
search
string
Free-text search across item number, description, barcode, alternate code, location, and bin.
locationCode
string
Filter to a specific warehouse location.
hasStockOnly
boolean
default:"false"
Restrict results to items with quantity > 0.
pageNumber
integer
default:"1"
Page number.
pageSize
integer
default:"20"
Page size.
Response (GrupoMasItemLookupPageDto)
items
array
Paged item rows with itemNo, description, barcode, locationCode, binCode, quantity, imageUrl, etc.
totalQuantity
decimal
Sum of quantity across all matching rows. Only populated when search or locationCode is provided — returns 0 for full unfiltered requests to avoid expensive aggregation.
totalRecords
integer
Total matching rows.
totalPages
integer
Total pages.
GrupoMASNative tenants: this endpoint proxies to the MAS /api/wms/items/lookup service using the tenant’s company code. If MAS is unavailable, Dragon Guard falls back to the local catalog automatically.

Handheld locations dropdown

GET /api/items/products-locations
Returns the ordered list of active warehouse locations for use in the location filter dropdown. Always prepends a synthetic { locationCode: "", locationDescription: "Todos" } option as the default “all locations” selection. For GrupoMASNative tenants, the list is sourced from MAS /api/wms/locations with the same automatic fallback to local locations.

The allowNegativeAvailable Flag

When allowNegativeAvailable is false (the default for new items), Dragon Guard enforces that shipment creation, update, and posting cannot reduce available inventory below zero. Attempting to do so returns a field-level validation.negativeAvailableNotAllowed error.
For historical items that predate this constraint, the database migration sets allowNegativeAvailable = true to preserve existing overselling behavior. You can audit and tighten this flag per item using PUT /api/items/{id}.

Build docs developers (and LLMs) love