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.

The RfidTagRegistry is the EPC master catalogue for a tenant. Every physical tag that Dragon Guard needs to recognise — whether on a unit, case, pallet, bin, or fixed asset — must have a corresponding registry entry. Entries are tenant-scoped (keyed by CompanyId), and active EPC uniqueness is enforced with a filtered unique index on (CompanyId, NormalizedEpc), so the same EPC cannot be active twice within one tenant. Deactivation is always logical; no hard-delete route exists.

Data model

Object types

ValueDescription
ITEM_UNITA single sellable or stockable unit — itemId required
CASEA case or outer containing individual units — itemId required
PACKA pack or inner grouping — itemId required
PALLETA full pallet — itemId required
BINA warehouse bin — currentBinId required
LOCATIONA warehouse location — currentLocationId required
ASSETA fixed or tracked asset — no item linkage required

Tag statuses

ValueMeaning
COMMISSIONEDTag has been programmed and registered; not yet in active circulation
AVAILABLETag is active and ready for warehouse operations
VOIDTag has been deactivated; IsActive is set to false

Key fields — RfidTagDto

FieldTypeNotes
idguidSurrogate key
epcstringNormalised EPC — used for uniqueness enforcement
rawEpcstringAs-read EPC string from the scanner
objectTypestringOne of the object type values above
quantitydecimalMust be ≥ 1 for inventory-bearing types; defaults to 1 for ITEM_UNIT
statusstringCOMMISSIONED, AVAILABLE, or VOID
itemIdguid?Required for ITEM_UNIT, CASE, PACK, PALLET
itemNostring?Item number (denormalised snapshot)
itemDescriptionstring?Item description (denormalised snapshot)
lotNostring?Lot number, if applicable
serialNostring?Serial number, if applicable
currentLocationIdguid?Required for LOCATION; optional for others
locationCodestring?Location code (denormalised snapshot)
currentBinIdguid?Required for BIN; optional for others
binCodestring?Bin code (denormalised snapshot)
lastSeenAtUtcdatetime?Updated each time the tag is scanned
isActiveboolfalse after deactivation
createdAtUtcdatetimeAudit timestamp
createdBystringOperator e-mail
updatedAtUtcdatetime?Audit timestamp
updatedBystring?Operator e-mail

Tag registry endpoints

List tags

GET /api/rfid/tags
Returns a paged list of tags scoped to the calling tenant.
Query parameterTypeDescription
searchstringFree-text search across EPC, item number, lot, and serial
itemstringFilter by item number
lotstringFilter by lot number
serialstringFilter by serial number
objectTypestringFilter by object type
statusstringFilter by status value
activeOnlyboolDefault true; set false to include voided tags
pageintPage number (1-based)
pageSizeintRecords per page

Get tag by ID

GET /api/rfid/tags/{id}
Returns a single RfidTagDto. Returns 404 if the tag does not exist or belongs to a different tenant.

Resolve EPC

GET /api/rfid/tags/resolve/{epc}
Resolves a raw or normalised EPC string to its item context. This is the primary endpoint used by handhelds during Item Inquiry. Returns an RfidTagResolveDto containing the matched item, quantity, location, and bin.
If corrupted or migrated data has left more than one active row for the same EPC within a tenant, resolution returns resolutionStatus: AMBIGUOUS_DUPLICATE rather than silently choosing one match. Resolve the duplicate via the PATCH or deactivate endpoints before scanning.
Response fields (RfidTagResolveDto):
FieldTypeNotes
requestedEpcstringThe EPC value supplied in the request
epcstringThe normalised EPC from the matched registry row
tagIdguid?ID of the matched RfidTagRegistry row
assignmentIdguid?ID of the active tag assignment, if resolved via assignment
objectTypestring?Object type of the matched tag
statusstring?Status of the matched tag
resolutionStatusstringRESOLVED, NOT_FOUND, AMBIGUOUS_DUPLICATE, or INACTIVE
resolutionSourcestringHow the tag was resolved (e.g. TAG_REGISTRY, TAG_ASSIGNMENT)
itemIdguid?Resolved item ID
itemNostring?Resolved item number
itemDescriptionstring?Resolved item description
quantitydecimal?Quantity associated with the tag
currentLocationIdguid?Current location ID
locationCodestring?Current location code
currentBinIdguid?Current bin ID
binCodestring?Current bin code
isActiveboolWhether the matched tag is active
isResolvedbooltrue when a matching registry row was found
messagestring?Human-readable explanation when resolution fails

Create a tag

POST /api/rfid/tags
Commissions a single new EPC tag.
normalizedEpc
string
required
The canonical EPC value used for uniqueness checks. Must be unique among active tags in the tenant.
rawEpc
string
The raw as-read EPC string. Defaults to normalizedEpc if omitted.
objectType
string
required
Object type of the physical entity bearing this tag. One of ITEM_UNIT, CASE, PACK, PALLET, BIN, LOCATION, ASSET.
itemId
guid
Required when objectType is ITEM_UNIT, CASE, PACK, or PALLET. Must reference an item that belongs to the calling tenant.
quantity
decimal
Quantity of the item represented by this tag. Defaults to 1 for ITEM_UNIT. Must be ≥ 1 for all inventory-bearing types.
status
string
Initial status. Defaults to COMMISSIONED if omitted. Accepted values: COMMISSIONED, AVAILABLE.
currentLocationId
guid
ID of the warehouse location where the tag currently resides. Required when objectType is LOCATION.
currentBinId
guid
ID of the bin where the tag currently resides. Required when objectType is BIN.
lastSeenAtUtc
datetime
Optional timestamp of the last known physical read. Omit to let the system set this on the first scan event.
Returns 201 Created with the full RfidTagDto. Returns 409 Conflict if an active tag with the same EPC already exists for the tenant.

Bulk import

POST /api/rfid/tags/bulk
Imports a batch of tags in a single request. Accepts an RfidBulkImportDto body and returns an RfidBulkImportResultDto with per-line create, update, and error counts. Useful when commissioning large tag batches printed from ZPL label jobs.
Body fieldTypeDescription
batchReferenceNostring?Optional reference label for this import batch
remarksstring?Free-text notes
continueOnErrorboolDefault true — skip failing rows rather than aborting the entire batch
allowUpdatesboolWhen true, update existing active tags instead of returning a conflict
itemsarrayArray of RfidBulkImportLineDto tag records (see fields below)
Each element in items mirrors CreateRfidTagDto with an additional optional index field for error reporting.

Update a tag (partial)

PATCH /api/rfid/tags/{id}
Applies a partial update to a tag using UpdateRfidTagDto. Supports changes to EPC, status, quantity, item linkage, location, bin, and lastSeenAtUtc. Setting status to VOID automatically sets IsActive = false; any other valid status reactivates the tag. UpdateRfidTagDto also exposes explicit clear flags — set the corresponding bool to true to null-out optional fields:
Clear flagClears field
clearItemIdSets ItemId to null
clearCurrentLocationIdSets CurrentLocationId to null
clearCurrentBinIdSets CurrentBinId to null
clearLastSeenAtUtcSets LastSeenAtUtc to null

Update a tag (full)

PUT /api/rfid/tags/{id}
Alias of PATCH using the same UpdateRfidTagDto payload. Provided for client compatibility.

Deactivate a tag

PUT /api/rfid/tags/{id}/deactivate
Logically deactivates a tag by setting Status = VOID and IsActive = false. The tag record is retained for audit and re-commissioning review. Returns 404 if the tag does not exist in the tenant.

Tag assignment endpoints

Tag assignments link a registry entry to a specific document, item, lot, serial, package, location, or bin for a defined time window. The RfidTagAssignmentsController exposes the following routes under api/rfid/tag-assignments.

List assignments

GET /api/rfid/tag-assignments
Returns a paged list of assignments scoped to the calling tenant.
Query parameterTypeDescription
rfidTagRegistryIdguidFilter by registry tag ID
assignmentTypestringFilter by assignment type
itemIdguidFilter by item ID
documentTypestringFilter by document type
documentNostringFilter by document number
isActiveboolFilter by active/inactive status
effectiveAtUtcdatetimeReturn only assignments effective at this point in time
pageintPage number (1-based)
pageSizeintRecords per page

Get assignment by ID

GET /api/rfid/tag-assignments/{id}
Returns a single RfidTagAssignmentDto. Returns 404 if not found or belonging to a different tenant.

Create assignment

POST /api/rfid/tag-assignments
Creates a new tag assignment. Returns 201 Created with the saved RfidTagAssignmentDto, or 409 Conflict if an active conflicting assignment already exists. Key request fields (CreateRfidTagAssignmentDto):
FieldTypeRequiredDescription
rfidTagRegistryIdguidThe registry tag being assigned
assignmentTypestringType of assignment (e.g. DOCUMENT, LOCATION, ITEM)
itemIdguid?Item linked to this assignment
lotNostring?Lot number
serialNostring?Serial number
packageCodestring?Package code
documentTypestring?Document type (e.g. RECEIPT)
documentNostring?Document number
documentLineNostring?Document line number
locationIdguid?Warehouse location ID
binIdguid?Bin ID
quantitydecimalQuantity for this assignment
sourcestringHow the assignment was created (e.g. MANUAL, SYSTEM)
effectiveFromUtcdatetime?Start of effective window; defaults to now if omitted
effectiveToUtcdatetime?End of effective window; null means open-ended
notesstring?Free-text notes

Update assignment

PUT /api/rfid/tag-assignments/{id}
Replaces the mutable fields of an existing assignment with an UpdateRfidTagAssignmentDto body. Returns 404 if the assignment is not found.

Deactivate assignment

PUT /api/rfid/tag-assignments/{id}/deactivate
Logically deactivates an assignment. Returns 204 No Content on success, 404 if not found.

Label print endpoint

Dragon Guard can generate a ZPL label string for a Zebra RFID printer. The ZPL includes ^RFW commands to program the RFID chip during the print pass, so the print and encode steps happen in a single pass through the Zebra printer.
POST /api/rfid/print/label
epc
string
EPC to encode. Provide either epc or tagId.
tagId
guid
ID of the RfidTagRegistry row to look up the EPC from. Provide either tagId or epc.
copies
int
Number of label copies embedded in the ZPL (^PQ). Range 1–99. Defaults to 1.
darkness
int
Print darkness (^MD). Range 0–30. Defaults to 15.
Response (PrintRfidLabelResponseDto):
FieldTypeDescription
successboolWhether the ZPL was generated successfully
messagestringHuman-readable outcome message
zplStringstringComplete ZPL string — send to the Zebra printer via TCP port 9100
epcstring?The EPC encoded in the label
itemIdstring?Item ID snapshot
objectTypestring?Object type snapshot
copiesintCopy count embedded in the ZPL
generatedAtUtcdatetimeUTC timestamp of generation

Business rules

itemId is required for object types ITEM_UNIT, CASE, PACK, and PALLET. Creating any of these without an item reference will return 400 Bad Request.
BIN tags must include a currentBinId. LOCATION tags must include a currentLocationId. Submitting without the matching reference will return 400 Bad Request.
  • Active EPC uniqueness — only one active row may exist per (CompanyId, NormalizedEpc). Attempting to create a duplicate returns 409 Conflict.
  • Quantity floorquantity must be ≥ 1 for all inventory-bearing types (ITEM_UNIT, CASE, PACK, PALLET).
  • No hard delete — deactivation is the only way to retire a tag. Historical (inactive) rows remain for audit.
  • Tenant isolationCompanyId is resolved from the JWT; request bodies cannot override it.

Examples

Commission a tag

curl -X POST https://api.dragonguard.io/api/rfid/tags \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "normalizedEpc": "3034257BF400B80000000001",
    "rawEpc": "3034257BF400B80000000001",
    "objectType": "ITEM_UNIT",
    "itemId": "a1b2c3d4-0000-0000-0000-000000000001",
    "quantity": 1,
    "status": "AVAILABLE",
    "currentLocationId": "f0e1d2c3-0000-0000-0000-000000000010"
  }'
{
  "id": "9e8f7a6b-0000-0000-0000-000000000099",
  "epc": "3034257BF400B80000000001",
  "rawEpc": "3034257BF400B80000000001",
  "objectType": "ITEM_UNIT",
  "itemId": "a1b2c3d4-0000-0000-0000-000000000001",
  "itemNo": "ITEM-001",
  "itemDescription": "Widget A",
  "quantity": 1.0,
  "status": "AVAILABLE",
  "currentLocationId": "f0e1d2c3-0000-0000-0000-000000000010",
  "locationCode": "ZONE-A",
  "currentBinId": null,
  "binCode": null,
  "lastSeenAtUtc": null,
  "isActive": true,
  "createdAtUtc": "2025-01-15T09:00:00Z",
  "createdBy": "[email protected]"
}

Resolve an EPC

curl https://api.dragonguard.io/api/rfid/tags/resolve/3034257BF400B80000000001 \
  -H "Authorization: Bearer <token>"
{
  "requestedEpc": "3034257BF400B80000000001",
  "epc": "3034257BF400B80000000001",
  "tagId": "9e8f7a6b-0000-0000-0000-000000000099",
  "assignmentId": null,
  "objectType": "ITEM_UNIT",
  "status": "AVAILABLE",
  "resolutionStatus": "RESOLVED",
  "resolutionSource": "TAG_REGISTRY",
  "itemId": "a1b2c3d4-0000-0000-0000-000000000001",
  "itemNo": "ITEM-001",
  "itemDescription": "Widget A",
  "quantity": 1.0,
  "currentLocationId": "f0e1d2c3-0000-0000-0000-000000000010",
  "locationCode": "ZONE-A",
  "currentBinId": null,
  "binCode": null,
  "isActive": true,
  "isResolved": true,
  "message": null
}

Build docs developers (and LLMs) love