bling.settle-payable
Convenience wrapper: settles a payable by creating an EXPENSE lançamento at Bling and refreshing the parent payable.
Overview
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-bling |
| Version | 1.0 |
Input Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
connection_uuid | uuid | Yes | — | — |
payable_uuid | uuid | No | — | — |
payable_external_ref | string | No | — | — |
amount | string | Yes | — | — |
posted_date | string | No | — | — |
competence_date | string | No | — | — |
description | string | No | — | — |
document_number | string | No | — | — |
payment_method_external_ref | string | No | — | — |
financial_category_external_ref | string | No | — | — |
bank_account_external_ref | string | No | — | — |
idempotency_key | string | No | — | — |
actor | string | No | — | — |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
connection_uuid | uuid | Yes | — | — |
payable_uuid | uuid | No | — | — |
payable_external_ref | string | No | — | — |
amount | string | Yes | — | — |
posted_date | string | No | — | — |
competence_date | string | No | — | — |
description | string | No | — | — |
document_number | string | No | — | — |
payment_method_external_ref | string | No | — | — |
financial_category_external_ref | string | No | — | — |
bank_account_external_ref | string | No | — | — |
idempotency_key | string | No | — | — |
actor | string | No | — | — |
resolved_payable_external_ref | string | No | — | — |
journal_entry_uuid | uuid | No | — | — |
journal_entry_external_ref | string | No | — | — |
refreshed_payable_status | string | No | — | — |
refresh_skipped | boolean | No | — | — |
refresh_error | string | No | — | — |
settled_at | string | No | — | — |
completed_at | 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 | — | resolve | Settle requested |
refreshing | No | No | — | complete | Re-fetching the parent payable |
resolving | No | No | — | settle | Resolving Bling-side payable id |
settling | No | No | — | refresh | Creating the lançamento at Bling |
completed | No | Yes | Yes | — | Payable settled |
failed | No | Yes | No | — | Settle failed |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
initiated | resolve | resolving | — |
resolving | settle | settling | — |
settling | refresh | refreshing | — |
refreshing | complete | completed | — |
initiated | fail | failed | — |
resolving | fail | failed | — |
settling | fail | failed | — |
refreshing | 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_SETTLE_PAYABLE_NO_REF | Provide one of payable_uuid or payable_external_ref |
BLING_SETTLE_PAYABLE_NOT_FOUND | No commerce_entity row found for payable |
BLING_SETTLE_PAYABLE_WRONG_TYPE | commerce_entity {uuid} is entity_type={entity_type!r}; settle-payable requires entity_type='payable' |
BLING_SETTLE_FAILED | bling.create-journal-entry failed during settle: |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "bling.settle-payable",
"initial_data": {
"organization_uuid": "value",
"connection_uuid": "value",
"amount": "value"
}
}