Skip to content
Proud to collaborate with Microsoft for Startups

bling.upsert-contact ​

Create or update a Bling contact (contato). Routes to POST /contatos or PUT /contatos/{id} based on whether contact_external_ref is supplied. Persists the result into commerce_entity.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-bling
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes——
connection_uuiduuidYes——
contact_external_refstringNo—Bling-side contact id. Set to UPDATE; omit to CREATE.
namestringYes——
trade_namestringNo——
document_numberstringNo—CPF/CNPJ (Brazilian tax id)
document_kindstringNo—'cpf' or 'cnpj' — drives Bling field selection
typestringNo—'customer'
emailstringNo——
phonestringNo——
address_streetstringNo——
address_numberstringNo——
address_neighborhoodstringNo——
address_citystringNo——
address_statestringNo——
address_postal_codestringNo——
address_countrystringNo——
actorstringNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes——
connection_uuiduuidYes——
contact_external_refstringNo—Bling-side contact id. Set to UPDATE; omit to CREATE.
namestringYes——
trade_namestringNo——
document_numberstringNo—CPF/CNPJ (Brazilian tax id)
document_kindstringNo—'cpf' or 'cnpj' — drives Bling field selection
typestringNo—'customer'
emailstringNo——
phonestringNo——
address_streetstringNo——
address_numberstringNo——
address_neighborhoodstringNo——
address_citystringNo——
address_statestringNo——
address_postal_codestringNo——
address_countrystringNo——
actorstringNo——
operationstringNo—'create' or 'update' — chosen at runtime
provider_resource_refstringNo—Bling contact id (post-create or echoed for update)
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—upsertUpsert requested
completedNoYesYes—Contact upserted + persisted
failedNoYesNo—Upsert failed

State Diagram ​

Transitions ​

FromActionToDescription
initiatedupsertcompleted—
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_CONTACT_MISSING_NAMEname is required to create or update a Bling contact
BLING_CONTACT_UPSERT_FAILEDBling refused contact {operation}:
BLING_CONTACT_PERSIST_FAILEDcommerce_entity persist failed for contact:

API Usage ​

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

{
  "workflow_type": "bling.upsert-contact",
  "initial_data": {
    "organization_uuid": "value",
    "connection_uuid": "value",
    "name": "value"
  }
}