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 Inventory Movements API provides read and import access to the audit trail of all stock movements recorded by Dragon Guard, including receipts, shipments, transfers, adjustments, and opening balances. For GrupoMAS tenants, movement queries and journal endpoints proxy live data from the MAS system.

GET /api/movements

Returns a paginated list of inventory movements for the authenticated company. Supports rich filtering by item, bin, location, movement type, reference, and date range. For GrupoMAS tenants, results are sourced from the MAS movements endpoint. Authentication: Authorization: Bearer <token> (required).
companyId
string (uuid)
Tenant company ID.
Free-text search across item number, description, bin code, reference number, and movement type.
itemId
string (uuid)
Filter by item ID.
binId
string (uuid)
Filter by bin ID.
itemNo
string
Filter by item number (partial match).
locationCode
string
Filter by warehouse location code.
binCode
string
Filter by bin code (partial match).
movementType
string
Exact movement type code (e.g., IN, OUT, ADJUSTMENT).
referenceNo
string
Reference document number (partial match).
dateFrom
string (ISO 8601)
Start of date range filter (inclusive).
dateTo
string (ISO 8601)
End of date range filter (inclusive).
pageNumber
integer
1-based page. Defaults to 1.
pageSize
integer
Page size. Defaults to 20, max 200.
sortDesc
boolean
Sort by creation date descending. Defaults to true.
data
array
pageNumber
integer
Current page.
pageSize
integer
Page size.
totalRecords
integer
Total movements matching filters.
totalPages
integer
Total pages.
curl -X GET "https://api.example.com/api/movements?itemNo=ITM-000001&dateFrom=2024-01-01T00:00:00Z&pageSize=50" \
  -H "Authorization: Bearer <token>"

GET /api/movements/

Returns a single inventory movement record by its ID. Authentication: Authorization: Bearer <token> (required).
id
string (uuid)
required
Movement record ID.
companyId
string (uuid)
Tenant company ID.
Error codes
StatusMeaning
404Movement not found for the given ID and company.
curl -X GET "https://api.example.com/api/movements/9c3f0000-0000-0000-0000-000000000001?companyId=3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer <token>"

GET /api/movements/item/

Returns all inventory movements for a specific item. Authentication: Authorization: Bearer <token> (required).
itemId
string (uuid)
required
Item ID whose movement history to retrieve.
companyId
string (uuid)
Tenant company ID.
data
array
Movement records for the item (same shape as InventoryMovementDto).
curl -X GET "https://api.example.com/api/movements/item/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer <token>"

GET /api/movements/journals

Returns product journals (movement journals) from the GrupoMAS ERP. For non-GrupoMAS tenants, returns an empty page rather than an error. Authentication: Authorization: Bearer <token> (required).
This endpoint returns live data only for GrupoMAS Native tenants. Calling it on a non-GrupoMAS tenant returns an empty result set.
companyId
string (uuid)
Tenant company ID.
search
string
Search term for journal lookup.
pageNumber
integer
Page number. Defaults to 1.
pageSize
integer
Page size. Defaults to 50, max 200.
data
array
Journal summaries from MAS.
pageNumber
integer
Current page.
pageSize
integer
Page size.
totalRecords
integer
Total journals found.
totalPages
integer
Total pages.
curl -X GET "https://api.example.com/api/movements/journals?search=ADJ&pageSize=20" \
  -H "Authorization: Bearer <token>"

GET /api/movements/journals/

Returns detailed lines for a specific GrupoMAS journal by journal number. Authentication: Authorization: Bearer <token> (required).
GrupoMAS Native tenants only. Returns 404 for non-GrupoMAS tenants.
journalNo
string
required
Journal number in GrupoMAS.
companyId
string (uuid)
Tenant company ID.
Error codes
StatusMeaning
404Journal not found or tenant is not configured for GrupoMAS Native.
curl -X GET "https://api.example.com/api/movements/journals/ADJ-2024-001" \
  -H "Authorization: Bearer <token>"

PUT /api/movements/journals/

Saves or posts a GrupoMAS product journal. Submits the journal entry to the MAS system. Authentication: Authorization: Bearer <token> (required).
GrupoMAS Native tenants only. Returns 400 with an error message for non-GrupoMAS tenants.
journalNo
string
required
Journal number to save.
companyId
string (uuid)
Tenant company ID.
lines
array
Journal lines to update in MAS.
curl -X PUT "https://api.example.com/api/movements/journals/ADJ-2024-001" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"lines": [{"itemNo": "ITM-000001", "quantity": -5, "uom": "EA", "locationCode": "WH-MAIN", "binCode": "A-01-001"}]}'

GET /api/movements/export-config

Exports inventory movements for the tenant as an Excel config package (.xlsx) with data validation dropdowns for items, bins, locations, and movement types. Authentication: Authorization: Bearer <token> (required).
companyId
string (uuid)
Tenant company ID.
Returns application/vnd.openxmlformats-officedocument.spreadsheetml.sheet with filename inventory_movements_config_package.xlsx.
curl -X GET "https://api.example.com/api/movements/export-config?companyId=3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer <token>" \
  -o inventory_movements_config_package.xlsx

POST /api/movements/preview-config

Previews an inventory movements config package import without persisting changes. Returns validation results including stock availability checks. Authentication: Authorization: Bearer <token> (required).
file
file
required
Multipart form upload. Must be a valid Dragon Guard INVENTORY_MOVEMENTS config package .xlsx.
companyId
string (uuid)
Tenant company ID.
isValid
boolean
Whether the package passes all validations.
creates
integer
Number of movements that would be created.
confirmationToken
string
Token required by apply-config to confirm this exact file.
errors
array
Row-level validation errors.
rows
array
Preview of first 50 rows.
curl -X POST "https://api.example.com/api/movements/preview-config?companyId=3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer <token>" \
  -F "file=@inventory_movements_config_package.xlsx"

POST /api/movements/apply-config

Imports inventory movements from a Dragon Guard config package Excel file. Validates stock availability before creating movements for items that do not allow negative inventory. Authentication: Authorization: Bearer <token> (required).
file
file
required
Multipart form upload. Must be a valid Dragon Guard INVENTORY_MOVEMENTS config package .xlsx.
confirmationToken
string
required
Confirmation token obtained from POST /api/movements/preview-config.
companyId
string (uuid)
Tenant company ID.
created
integer
Number of movements created.
updated
integer
Always 0 (movements are append-only).
errors
array
Any errors encountered.
curl -X POST "https://api.example.com/api/movements/apply-config?companyId=3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer <token>" \
  -F "file=@inventory_movements_config_package.xlsx" \
  -F "confirmationToken=<token-from-preview>"

GET /api/recounts

Returns all inventory recount (physical count) documents for the authenticated company. Authentication: Authorization: Bearer <token> (required).
companyId
string (uuid)
Tenant company ID.
data
array
List of recount document summaries with status, date, and item counts.
curl -X GET "https://api.example.com/api/recounts?companyId=3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer <token>"

POST /api/recounts

Creates a new inventory recount (physical count) document. Authentication: Authorization: Bearer <token> (required).
id
string (uuid)
New recount document ID.
status
string
Initial status on creation.
curl -X POST "https://api.example.com/api/recounts" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/recounts/

Returns a single recount document by ID. Authentication: Authorization: Bearer <token> (required).
id
string (uuid)
required
Recount document ID.
Error codes
StatusMeaning
404Recount document not found.
curl -X GET "https://api.example.com/api/recounts/9d3f0000-0000-0000-0000-000000000002" \
  -H "Authorization: Bearer <token>"

PUT /api/recounts/

Updates a recount document (e.g., updates counted quantities on lines). Authentication: Authorization: Bearer <token> (required).
id
string (uuid)
required
Recount document ID.
curl -X PUT "https://api.example.com/api/recounts/9d3f0000-0000-0000-0000-000000000002" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/recounts//release

Releases a recount document for physical counting. Authentication: Authorization: Bearer <token> (required).
id
string (uuid)
required
Recount document ID.
curl -X POST "https://api.example.com/api/recounts/9d3f0000-0000-0000-0000-000000000002/release" \
  -H "Authorization: Bearer <token>"

POST /api/recounts//reopen

Reopens a released recount document for further editing. Authentication: Authorization: Bearer <token> (required).
id
string (uuid)
required
Recount document ID.
curl -X POST "https://api.example.com/api/recounts/9d3f0000-0000-0000-0000-000000000002/reopen" \
  -H "Authorization: Bearer <token>"

Build docs developers (and LLMs) love