bling.create-journal-entry
Direct creation of a Bling lançamento. Caller supplies the Bling-side linked_receivable_external_ref or linked_payable_external_ref + amount; this workflow POSTs to /contas/{kind}/{id}/lancamentos and persists the result into commerce_entity.
Overview
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-bling |
| Version | 1.0 |
Input Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
connection_uuid | uuid | Yes | — | — |
linked_receivable_external_ref | string | No | — | — |
linked_payable_external_ref | string | No | — | — |
amount | string | Yes | — | Decimal serialized as string (avoid float drift) |
posted_date | string | No | — | ISO date — defaults to today |
competence_date | string | No | — | — |
description | string | No | — | — |
document_number | string | No | — | — |
counterparty_external_ref | string | No | — | — |
bank_account_external_ref | string | No | — | — |
payment_method_external_ref | string | No | — | — |
financial_category_external_ref | string | No | — | — |
actor | string | No | — | — |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
connection_uuid | uuid | Yes | — | — |
linked_receivable_external_ref | string | No | — | — |
linked_payable_external_ref | string | No | — | — |
amount | string | Yes | — | Decimal serialized as string (avoid float drift) |
posted_date | string | No | — | ISO date — defaults to today |
competence_date | string | No | — | — |
description | string | No | — | — |
document_number | string | No | — | — |
counterparty_external_ref | string | No | — | — |
bank_account_external_ref | string | No | — | — |
payment_method_external_ref | string | No | — | — |
financial_category_external_ref | string | No | — | — |
actor | string | No | — | — |
provider_resource_ref | string | No | — | Bling lançamento id returned by POST |
commerce_entity_uuid | uuid | No | — | — |
created_at_iso | string | No | — | — |
failure_reason | string | No | — | — |
failed_at | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | json | No | — | — |
failed_layer | json | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
initiated | Yes | No | — | create | Create requested |
completed | No | Yes | Yes | — | Journal entry created + persisted |
failed | No | Yes | No | — | Create failed |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
initiated | create | completed | — |
initiated | fail | failed | — |
Business Errors
| Code | Message Template |
|---|---|
BLING_CONNECTION_NOT_FOUND | Bling connection {connection_uuid} not found in organization |
BLING_CONNECTION_WRONG_PROVIDER | Connection {connection_uuid} is not a Bling connection |
BLING_JOURNAL_ENTRY_NO_BILL_LINK | linked_receivable_external_ref OR linked_payable_external_ref is required — Bling scopes lançamentos to a parent bill in v1. |
BLING_JOURNAL_ENTRY_CREATE_FAILED | Bling refused journal entry creation: |
BLING_JOURNAL_ENTRY_PERSIST_FAILED | data.commerce.entity.persist failed after Bling create: |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "bling.create-journal-entry",
"initial_data": {
"organization_uuid": "value",
"connection_uuid": "value",
"amount": "value"
}
}