Skip to content
Proud to collaborate with Microsoft for Startups

bling.cancel-nfse ​

Cancel an authorized NFS-e at Bling and reflect the cancellation on the commerce_entity row. Requires a justification.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-bling
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes——
connection_uuiduuidYes——
nfse_external_refstringYes—Bling-side NFS-e id (numeric, stringified)
motivostringYes—Free-text cancellation justification — required by municipality
actorstringNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes——
connection_uuiduuidYes——
nfse_external_refstringYes—Bling-side NFS-e id (numeric, stringified)
motivostringYes—Free-text cancellation justification — required by municipality
actorstringNo——
cancelled_atstringNo——
commerce_entity_uuiduuidNo——
completed_atstringNo——
failure_reasonstringNo——
failed_atstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepjsonNo——
failed_layerjsonNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
initiatedYesNo—cancelCancel requested
completedNoYesYes—NFS-e cancelled + recorded
failedNoYesNo—Cancel failed

State Diagram ​

Transitions ​

FromActionToDescription
initiatedcancelcompleted—
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_NFSE_MISSING_MOTIVOmotivo (cancellation reason) is required by Bling/municipality
BLING_NFSE_CANCEL_FAILEDBling refused NFS-e cancellation:
BLING_NFSE_PERSIST_FAILEDcommerce_entity update failed after cancel:

API Usage ​

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

{
  "workflow_type": "bling.cancel-nfse",
  "initial_data": {
    "organization_uuid": "value",
    "connection_uuid": "value",
    "nfse_external_ref": "value",
    "motivo": "value"
  }
}