Skip to content
Proud to collaborate with Microsoft for Startups

bling.fetch-dre ​

Fetch the DRE (Demonstração do Resultado do Exercício / P&L) report for a date range and persist into commerce_entity.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-bling
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes——
connection_uuiduuidYes——
period_startstringYes—ISO date — inclusive start
period_endstringYes—ISO date — inclusive end
actorstringNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes——
connection_uuiduuidYes——
period_startstringYes—ISO date — inclusive start
period_endstringYes—ISO date — inclusive end
actorstringNo——
provider_resource_refstringNo—Synthetic period key (start_end)
commerce_entity_uuiduuidNo——
reportjsonNo—Full DRE contract dump
fetched_atstringNo——
failure_reasonstringNo——
failed_atstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepjsonNo——
failed_layerjsonNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
initiatedYesNo—fetchFetch DRE request received
completedNoYesYes—DRE fetched + persisted
failedNoYesNo—Fetch failed

State Diagram ​

Transitions ​

FromActionToDescription
initiatedfetchcompleted—
initiatedfailfailed—

Business Errors ​

CodeMessage Template
BLING_CONNECTION_NOT_FOUNDBling connection {connection_uuid} not found in organization
BLING_CONNECTION_WRONG_PROVIDERConnection {connection_uuid} is not a Bling connection
BLING_DRE_MISSING_PERIOD{field} is required (ISO date YYYY-MM-DD)
BLING_DRE_FETCH_FAILEDBling refused DRE for {period_start}..{period_end}:
BLING_DRE_PERSIST_FAILEDcommerce_entity persist failed:

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "bling.fetch-dre",
  "initial_data": {
    "organization_uuid": "value",
    "connection_uuid": "value",
    "period_start": "value",
    "period_end": "value"
  }
}