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 integrates with external ERP systems through a provider-based model. Rather than a single generic connector, each tenant is resolved to a named provider that determines which integration flows are supported. Two native providers ship today — GrupoMASNative and BusinessCentralNative — alongside a generic push/import model for ERPs that prefer to send data to Dragon Guard via REST.

Route Prefixes

All integration endpoints are served under two equivalent route prefixes:
PrefixRole
api/v1/integration/Canonical (recommended)
api/integration/Legacy alias — fully supported and identical in behavior
Both prefixes are active simultaneously on every endpoint documented in this section. Examples throughout the documentation use the canonical api/v1/ prefix.

Authentication

All integration endpoints under /api/v1/integration/ use API key authentication, not JWT.
X-Api-Key
string
required
Tenant-specific API key. Generated by a SUPERADMIN_SUPREMO user in the Supreme administration panel and scoped to a single company.
X-Correlation-Id
string
Optional trace identifier. If omitted, Dragon Guard generates one from the ASP.NET trace identifier. The resolved value is echoed in every response body as correlationId.
Content-Type
string
Required for POST requests. Use application/json.
Integration endpoints reject requests that do not carry a valid X-Api-Key. A missing key returns error code API_KEY_MISSING; an unrecognized key returns API_KEY_INVALID. If the tenant’s API access switch is off, the response code is API_ACCESS_DISABLED.

Contract Versioning

Integration endpoints support an optional versioning header.
X-Contract-Version
string
Contract version expected by the caller. Omit to use version 1 (current default). If a value other than "1" is sent, Dragon Guard returns 400 Bad Request. Every response echoes X-Contract-Version: 1.

Provider Names

Dragon Guard resolves every tenant to exactly one provider name at request time.
Provider nameNotes
StandaloneLocal-only warehouse operations, no ERP connection
GenericApiPush/import model — ERP sends catalog, receipts, and shipments to Dragon Guard
GrupoMASNativeContract-first bidirectional adapter to Grupo Mas ERP
BusinessCentralNativeRead-through adapter to Microsoft Business Central
Provider resolution uses the IntegrationMode stored on the company record plus the ExternalSystem field as a tiebreaker when the mode is still stored as the legacy IntegratedApi value.

Capabilities Endpoint

Use this endpoint at startup or on reconnect to discover what the tenant’s provider supports before making operational calls.

GET /api/v1/integration/capabilities

Returns the provider name, integration mode, API access flag, and a full capabilities object.
curl -X GET https://api.dragonguard.io/api/v1/integration/capabilities \
  -H "X-Api-Key: YOUR_TENANT_API_KEY" \
  -H "X-Correlation-Id: my-trace-001"
Example response
{
  "companyCode": "ACME",
  "integrationMode": "ERP_EXECUTION",
  "providerName": "GrupoMASNative",
  "apiAccessEnabled": true,
  "capabilities": {
    "provider": "GrupoMASNative",
    "mode": "ERP_EXECUTION",
    "isIntegrated": true,
    "isErpOwned": true,
    "requiresProviderAdapter": true,
    "allowsLocalMasterDataEditing": false,
    "supportsItemSync": false,
    "supportsOpeningStock": false,
    "supportsReceiptImport": false,
    "supportsShipmentImport": false,
    "usesErpAsStockAuthority": true,
    "supportsReleasedWorkLookup": true,
    "supportsReleasedWorkPolling": true,
    "supportsManualReleasedWorkRefresh": true,
    "supportsExternalItemLookup": true,
    "supportsExternalBinStockLookup": true,
    "supportsExecutionLog": true,
    "supportsPostResultToErp": true,
    "supportsInventoryCountExecution": true,
    "supportsTransferExecution": true,
    "status": {
      "supportsDragonGuardLocalStatus": true,
      "supportsErpRemoteStatus": false
    },
    "supportsCallbacks": true
  }
}

Company Endpoint

GET /api/v1/integration/company

Returns full company metadata including companyId, companyCode, companyName, integrationMode, providerName, apiAccessEnabled, externalSystemCode, deviceLimit, and the same capabilities object as above.
curl -X GET https://api.dragonguard.io/api/v1/integration/company \
  -H "X-Api-Key: YOUR_TENANT_API_KEY"

Integration Modes at a Glance

ERP_EXECUTION — GrupoMASNative

Dragon Guard polls Grupo Mas ERP for released work (receipts, shipments, counts, transfers), executes the physical operation on handheld, and posts results back to the ERP. Catalog sync and document import are disabled for this provider.

ERP_EXECUTION — BusinessCentralNative

Dragon Guard reads items, receipts, shipments, and movements directly from Business Central through a dedicated adapter. Write-back to BC is not yet implemented in the current rollout.

ERP_SYNC — GenericApi

The ERP pushes catalog items, opening stock, receipts, and shipments to Dragon Guard via the /api/v1/integration/ REST endpoints. Dragon Guard stores and executes the documents locally.

LOCAL — Standalone

No ERP connection. Dragon Guard operates fully local-first with its own item master, stock ledger, and document management.

Provider Capabilities Reference

The capabilities object in the GET responses reflects the policy matrix below. Use these flags to conditionally enable or disable features in your integration client.
requiresProviderAdapter
boolean
true for native providers (GrupoMASNative, BusinessCentralNative). Dragon Guard uses an internal HTTP adapter to communicate with the ERP; the tenant must have baseUrl and credentials configured in Supreme.
supportsReleasedWorkLookup
boolean
true when Dragon Guard can query the ERP for released documents ready for physical execution.
supportsPostResultToErp
boolean
true when Dragon Guard sends execution results back to the ERP after the handheld completes the operation.
supportsDragonGuardLocalStatus
boolean
true when Dragon Guard maintains its own operational status and audit trail for executed documents.
supportsErpRemoteStatus
boolean
true when Dragon Guard can query the ERP for the remote document status. Currently false for GrupoMASNative pending live status query implementation.
supportsItemSync
boolean
true for GenericApi. false for native ERP-owned providers — calling catalog sync endpoints returns 409 Conflict for those tenants.
supportsOpeningStock
boolean
true for GenericApi. false for ERP-owned providers.

Error Response Shape

All integration endpoints return a consistent error envelope:
{
  "success": false,
  "companyCode": "ACME",
  "message": "Payload invalido.",
  "correlationId": "trace-id-001",
  "errors": [
    {
      "field": "lines[0].itemNo",
      "code": "ITEM_NOT_FOUND",
      "message": "Item no existe o no esta activo."
    }
  ]
}
success
boolean
false on any error.
companyCode
string
The resolved company code. Empty string when the tenant could not be resolved.
correlationId
string
Trace identifier. Use this value when contacting support.
errors[].code
string
Machine-readable error code. Common values: API_KEY_MISSING, API_KEY_INVALID, TENANT_INACTIVE, API_ACCESS_DISABLED, INTEGRATION_MODE_DISABLED, ITEM_NOT_FOUND, LOCATION_NOT_FOUND, DUPLICATE_EXTERNAL_DOCUMENT, VALIDATION_ERROR.

Build docs developers (and LLMs) love