bling.fetch-regime
Read the connected Bling tenant's tax regime (regimeTributario) by calling bling.fetch-company under the hood. Persists into commerce_entity with entity_type='tax_regime'.
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 | — | — |
actor | string | No | — | — |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
connection_uuid | uuid | Yes | — | — |
actor | string | No | — | — |
tax_regime | string | No | — | — |
state_registration | string | No | — | — |
company_external_ref | string | No | — | — |
commerce_entity_uuid | uuid | No | — | — |
fetched_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 | — | fetch | Fetch regime request received |
completed | No | Yes | Yes | — | Regime fetched + persisted |
failed | No | Yes | No | — | Fetch failed |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
initiated | fetch | completed | — |
initiated | fail | failed | — |
Business Errors
| Code | Message Template |
|---|---|
BLING_FETCH_REGIME_COMPANY_FAILED | underlying bling.fetch-company failed: |
BLING_FETCH_REGIME_MISSING | company info had no tax_regime field (raw={raw_keys}) |
BLING_FETCH_REGIME_PERSIST_FAILED | commerce_entity persist failed: |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "bling.fetch-regime",
"initial_data": {
"organization_uuid": "value",
"connection_uuid": "value"
}
}