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.

Business Central Native allows Dragon Guard to read items, receipts, shipments, and movement journal entries directly from Microsoft Business Central through a dedicated HTTP adapter configured at the tenant level. In this integration model, Business Central is the system of record — Dragon Guard does not maintain its own item master or document store for BC-owned data. Instead, handheld workflows query live BC data on demand through the adapter.
The current rollout supports read-through only. Write-back and result posting to Business Central are not yet implemented. See Capabilities below to confirm what is available before calling execution endpoints.

Integration Mode

When a tenant is configured with BusinessCentralNative, the capabilities response shows:
{
  "integrationMode": "ERP_EXECUTION",
  "providerName": "BusinessCentralNative",
  "capabilities": {
    "mode": "ERP_EXECUTION",
    "requiresProviderAdapter": true,
    "supportsReleasedWorkLookup": true,
    "supportsExternalItemLookup": true,
    "supportsExternalBinStockLookup": true,
    "supportsExecutionLog": true,
    "supportsPostResultToErp": true,
    "supportsItemSync": false,
    "supportsOpeningStock": false,
    "supportsReceiptImport": false,
    "supportsShipmentImport": false,
    "status": {
      "supportsDragonGuardLocalStatus": true,
      "supportsErpRemoteStatus": false
    }
  }
}
Always call GET /api/v1/integration/capabilities before making execution endpoint calls. If requiresProviderAdapter is true and the adapter is not yet configured in Supreme, endpoints return 501 Not Implemented.

Configuration

Business Central adapter settings are managed per tenant by a SUPERADMIN_SUPREMO user in the Supreme administration panel. PATCH /api/supreme/companies/{id}/integration/businesscentral-native-settings
baseUrl
string
required
Absolute base URL of the Business Central OData or custom API endpoint (e.g. https://api.businesscentral.dynamics.com/v2.0/{tenantId}/{environment}/api). Must be a valid absolute URL.
apiKey
string
API key credential for outbound requests. Pass null to preserve the existing secret.
bearerToken
string
Bearer token for OAuth-based authentication. Pass null to preserve the existing secret.
timeoutSeconds
integer
HTTP timeout in seconds for outbound adapter requests. Valid range: 5120.
Credentials are never returned in plain text. Reading company settings exposes only presence booleans (hasApiKey, hasBearerToken), masked values, and authMode.

Test Connection

POST /api/supreme/companies/{id}/integration/businesscentral-native/test-connection Verifies the adapter settings without fetching any documents. Returns a BusinessCentralNativeConnectionTestResultDto:
success
boolean
Whether the connectivity check succeeded.
status
string
Human-readable status message.
isConfigured
boolean
true when baseUrl and at least one credential are present.
baseUrl
string
The configured base URL (echoed back for confirmation).
authMode
string
ApiKey, Bearer, or None based on the active credential.
timeoutSeconds
integer
The configured timeout in seconds.
httpStatusCode
integer
HTTP status code returned by Business Central. null if a transport error occurred before a response was received.
message
string
Details about the connection result or error.
responseSnippet
string
A short excerpt of the BC response body, useful for diagnosing endpoint and authentication issues.

Authentication

All execution endpoints use the same X-Api-Key tenant resolution as the rest of the integration API.
X-Api-Key
string
required
Dragon Guard tenant API key. Resolves the company and its BC adapter settings.
X-Correlation-Id
string
Optional trace identifier. Propagated through the request and echoed in the response body.

Execution Endpoints

All four read endpoints follow the same pattern: Dragon Guard resolves the tenant by API key, validates that the effective provider is BusinessCentralNative, forwards the request (including any query string parameters) to the configured BC adapter, and returns the result wrapped in a standard envelope. Each endpoint is available under both the canonical api/v1/integration/businesscentral-native/ prefix and the legacy api/integration/businesscentral-native/ alias.

GET /api/v1/integration/businesscentral-native/items

Fetches the item catalog from Business Central.
curl -X GET "https://api.dragonguard.io/api/v1/integration/businesscentral-native/items" \
  -H "X-Api-Key: YOUR_TENANT_API_KEY" \
  -H "X-Correlation-Id: trace-bc-001"

GET /api/v1/integration/businesscentral-native/receipts

Fetches receipt (purchase) documents from Business Central.
curl -X GET "https://api.dragonguard.io/api/v1/integration/businesscentral-native/receipts" \
  -H "X-Api-Key: YOUR_TENANT_API_KEY"

GET /api/v1/integration/businesscentral-native/shipments

Fetches shipment (sales/warehouse) documents from Business Central.
curl -X GET "https://api.dragonguard.io/api/v1/integration/businesscentral-native/shipments" \
  -H "X-Api-Key: YOUR_TENANT_API_KEY"

GET /api/v1/integration/businesscentral-native/movements

Fetches movement journal entries from Business Central.
curl -X GET "https://api.dragonguard.io/api/v1/integration/businesscentral-native/movements" \
  -H "X-Api-Key: YOUR_TENANT_API_KEY"

Response Envelope

All execution endpoints wrap the BC response in a common envelope.
{
  "success": true,
  "companyCode": "ACME",
  "providerName": "BusinessCentralNative",
  "correlationId": "trace-bc-001",
  "data": {
    "resource": "items",
    "sourcePath": "/api/wms/items",
    "count": 42,
    "shape": "BC_NATIVE",
    "nextLink": null,
    "items": [ ... ]
  }
}
data.resource
string
The resource type fetched: items, receipts, shipments, or movements.
data.sourcePath
string
The actual path called on the Business Central adapter endpoint.
data.count
integer
Number of records in this response.
data.shape
string
Shape descriptor of the response data, set by the adapter.
OData-style next-page link, if BC returned one.
data.items
array
Array of raw BC resource records as Dictionary<string, object> entries. The exact fields depend on the Business Central API version and custom API configuration for the tenant.

Error Responses

StatusMeaning
409 ConflictThe tenant’s effective provider is not BusinessCentralNative.
501 Not ImplementedThe BC adapter is not yet configured (baseUrl or credentials missing), or the specific resource endpoint is not yet mapped.
502 Bad GatewayBusiness Central rejected the request, timed out, or returned an invalid response. The retryable flag in the body indicates whether the condition may resolve on retry.
502 error body example
{
  "success": false,
  "companyCode": "ACME",
  "providerName": "BusinessCentralNative",
  "correlationId": "trace-bc-001",
  "resource": "receipts",
  "remoteHttpStatusCode": 503,
  "retryable": true,
  "message": "Business Central service unavailable."
}

Capabilities

The table below shows the current rollout status for BusinessCentralNative:
CapabilityStatus
Read items from BC✅ Supported
Read receipts from BC✅ Supported
Read shipments from BC✅ Supported
Read movements from BC✅ Supported
Post execution results back to BC⏳ Not yet implemented
Inventory count execution⏳ Not yet implemented
Transfer execution⏳ Not yet implemented
Catalog sync (push items to DG)❌ Disabled for ERP-owned providers
Opening stock (push stock to DG)❌ Disabled for ERP-owned providers
Calling /api/v1/integration/items, /api/v1/integration/stock/opening, or any other catalog sync endpoint from a BusinessCentralNative tenant returns 409 Conflict. Item master and stock authority belong to Business Central, not Dragon Guard.

Build docs developers (and LLMs) love