API

API mub | Workflow - Trigger workflow BP

This article is itended to document the API mub | Trigger Event BP. Route: POST => http://api.mub.cloud/api/v2/workflow API Field Field Type Description, example. action String Values: BP|... Always fixed value = "BP"…

Moises ScarpinPublicado 08 de fev. de 202411 min de leitura

This article is itended to document the API mub | Trigger Event BP.

Route: POST => http://api.mub.cloud/api/v2/workflow


































API Field

Field Type

Description, example.

action

String

Values: BP|... Always fixed value = "BP". Example: "BP"

process_generals_id

String

Example: "66f4d9db-e876-4f11-9291-ee44321828d3"

Log on MUB platform and get value from path: Setting/Processes/View/

languages_generals_id

String

Example "en-US"

Log on MUB platform and get value from path: Setting/Others/Auxiliary Tables Maintenance/Languages/

Note: When infomed at this level, this language will be defined as prefered for subobjects where specific languge has not been defined.

code

String

Example: "Code01"

Note: When code is not filled, system will generate a automatic incremental code.

countries_continents_regions_generals_id

String

Example: "US"

Log on MUB platform and get value from path: Setting/Others/Auxiliary Tables Maintenance/Countries/

type

enum Values: ORGANIZATION|PERSON Example: "ORGANIZATION"
partner_functions_ids String[] Example: ["CUSTOMER", "VENDOR"] Log on MUB platform and get value from path: Setting/Business Partner/Auxiliary Tables Maintenance/Partner functions/
company_name String Example: "Apple Inc."
company_trade_name String Example: "Apple"
company_foundation_date Date Example: "1978-01-31" Format: "AAAA-MM-DD"
bp_aux_person_titles_id String Example: "MR" Log on MUB platform and get value from path: Setting/Business Partner/Auxiliary Tables Maintenance/Personal Title/
person_first_name String  Example: "Pedro"
person_last_name String  Example: "Bassani"
person_birth_date Date Example: "1971-12-10" Format: "AAAA-MM-DD"
status enum Values: A|I|C Example: "A"
bp_documents bpDocuments_Object[]  
bp_documents.bp_aux_document_types_id String Example: "CNPJ" Log on MUB platform and get value from path: Setting/Business Partner/Auxiliary Tables Maintenance/Document Type/
bp_documents.identification String Example: "942404110"
bp_documents.valid_from Date Example: "2020-01-01" Format: "AAAA-MM-DD"
bp_documents.valid_to Date Example: "2030-01-01" Format: "AAAA-MM-DD"
bp_documents.issuer String Example: "IRS"
bp_documents.status enum Values: A|I|C Example: "A"
bp_documents.consulted_at TimeStamp Example: "2021-09-16 12:30:00" Format: "AAAA-MM-DD HH:MM:SS"
bp_documents.comments Comments[] Go to 'Comments.comment'
bp_addresses bpAddresses_Object[]  
bp_addresses.bp_aux_addresses_types_id String Example: "MAIN" Log on MUB platform and get value from path: Setting/Business Partner/Auxiliary Tables Maintenance/Address Type/
bp_addresses.address_line_1 String Example: "One Apple Park Way"
bp_addresses.address_line_2 String Example: "Apple Building"
bp_addresses.number String Example: "143"
bp_addresses.complement String Example: "All Build"
bp_addresses.postal_code String Example: "95014"
bp_addresses.district String Example: "One Apple Park Way District"
bp_addresses.city String Example: "Cupertino"
bp_addresses.region String Example: "AL"
bp_addresses.countries_continents_regions_generals_id String

Example: "US"

Log on MUB platform and get value from path: Setting/Others/Auxiliary Tables Maintenance/Countries/

bp_addresses.valid_from String Example: "2020-01-01" Format: "AAAA-MM-DD"
bp_addresses.valid_to String Example: "2030-01-01" Format: "AAAA-MM-DD"
bp_addresses.status enum Values: A|I|C Example: "A"
bp_addresses.comments Comments[] Go to 'Comments.comment'
bp_contacts bpContactsObject[]  
bp_contacts.bp_aux_contacts_types_id String Example: "MAIN"
bp_contacts.bp_aux_person_titles_id String Example: "MR"
bp_contacts.contact_first_name String Example: "Eduardo"
bp_contacts.contact_last_name String Example: "Sirangelo"
bp_contacts.contact_manages_register Boolean Example: true
bp_contacts.comments Comments[] Go to 'Comments.comment'
bp_contacts.bp_contacts_emails bp_contacts.bpContactsEmailsObject[]  
bp_contacts.bp_contacts_emails.email String Example: "eduardo.sirangelo@gmail.com"
bp_contacts.bp_contacts_emails.is_main Boolean Values: true|false Example: true
bp_contacts.bp_contacts_emails.comments Comments[] Go to 'Comments.comment'
bp_contacts.bp_contacts_telephones bp_contacts.bpContactsTelephonesObject[]  
bp_contacts.bp_contacts_telephones.telephone String Example: "+55 54 98133-5826"
bp_contacts.bp_contacts_telephones.is_main enum Values: A|I|C Example: "A"
bp_contacts.bp_contacts_telephones.comments Comments[] Go to 'Comments.comment'
     
bp_shareholders bpShareholdersObject[]  
bp_shareholders.shareholder_bp_generals_id String Example: "4431"
bp_shareholders.full_name String Example: "Steve Jobs"
bp_shareholders.shares_percentage Number Example: 55
bp_executives bpExecutivesObject[]  
bp_executives.executive_bp_generals_id String May be filled when executive already exists as Partner ID on MUB platform. Example: "4431"
bp_executives.full_name String Has to be filled when executive do not exists as Partner ID on MUB platform. Example: "Steve Jobs"
bp_executives.bp_aux_executive_positions_id String Example: "ADVISOR" Log on MUB platform and get value from path: Setting/Business Partner/Auxiliary Tables Maintenance/Executive Positions/
bp_executives.observations String Example: "Member of Concil"
bp_social_medias bpSocialMediasObject[]  
bp_social_medias.bp_aux_social_medias_types_id String Example: "FACEBOOK" Log on MUB platform and get value from path: Setting/Business Partner/Auxiliary Tables Maintenance/Social Media Type/
bp_social_medias.url String Example: "https://facebook.com/apple"
bp_relations bpRelationsObject[]  
bp_relations.direction enum Values: HAS|IS Example: "IS"
bp_relations.bp_aux_relations_types_id String Example: "COMMERCIAL_PARTNER" Log on MUB platform and get value from path: Setting/Business Partner/Auxiliary Tables Maintenance/BP Relation Type/
bp_relations.related_bp_generals_id String Has to be filled with related Partner ID that already registered on MUB platform. Example: "4452"
bp_relations.valid_from Date Example: "2020-01-16" Format: "AAAA-MM-DD"
bp_relations.valid_to Date Example: "2030-05-22" Format: "AAAA-MM-DD"
bp_taxes bpTaxesObject[]  
bp_taxes.bp_aux_br_tipo_tributacoes_id String Example: "LUCRO_PRESUMIDO" Log on MUB platform and get value from path: Setting/Business Partner/Auxiliary Tables Maintenance/Taxation Type Brazil/
bp_taxes.bp_aux_br_natureza_juridicas_id String Example: "204-6"
bp_taxes.br_cnae_principal_code String Example: "5222-2/00"
bp_taxes.br_cnae_secundario_codes String[] Example: ["6822600", "7312-2/00", "5223-1/00"]
bp_bank_accounts
bpBankAccountsObject[]  
bp_bank_accounts.bp_aux_bank_accounts_categories_id  String Example: "MAIN" Log on MUB platform and get value from path: Setting/Business Partner/Auxiliary Tables Maintenance/Banking Accounts Category/
bp_bank_accounts.bp_aux_bank_codes_id  String Example: "001" Log on MUB platform and get value from path: Setting/Business Partner/Auxiliary Tables Maintenance/Banking Code/
bp_bank_accounts.address String Example: "Av. Paulista"
bp_bank_accounts.city String Example: "São Paulo"
bp_bank_accounts.branch_code String Example: "1445"
bp_bank_accounts.branch_digit String Example: "8"
bp_bank_accounts.account_number String Example: "111544"
bp_bank_accounts.account_digit String Example: "7"
bp_bank_accounts.aba_code String Example: "ABA-879"
bp_bank_accounts.iban_code String Example: "IBAN-564"
bp_bank_accounts.swift_bic_code String Example: "BIC0-546"
bp_bank_accounts.account_type enum Values: CURRENT|SAVINGS|SALARY Example: "CURRENT"
bp_bank_accounts.pix String Example: "942404110"
bp_bank_accounts.status enum Values: A|I|C Example: "A"
bp_bank_accounts.comments Comments[] Go to 'Comments.comment'
bp_market_categories bpMarketCategoriesObject[]  
bp_market_categories.type String Values: UNSPSC|TIPI Example of standard category type: "UNSPSC". Also additional (specific) hierarchical categories type (tree) can be created and used as we can see on example below: Example: "HYDRAULIC" Log on MUB platform and get value from path: Category Tree/
bp_market_categories.code String Example of standard UNSPSC Code: "43231508" If an additional (specific) hierarchical categories tree was defined, you can get the code/node from: Log on MUB platform and get value from path: Category Tree/ Example of Code from a specific hierarchical categories tree: "HYDRAULIC_PUMP"
bp_market_annual_gross_billing bpMarketAnnualGrossBillingObject[]  
bp_market_annual_gross_billing.annual_gross_billing_year Number Example: 2020
bp_market_annual_gross_billing.annual_gross_billing_month Number Example: 12
bp_market_annual_gross_billing.annual_gross_billing_currencies_generals_id String Example: "USD"
bp_market_annual_gross_billing.annual_gross_billing_value Currency Example: 12345678.32
bp_market_operation_locations
String[] Example: ["USA", "BRAZIL", "EUROPE"]
bp_market_delivery_locations
String[] Example: ["USA", "BRAZIL", "EUROPE"]
bp_market_main_vendors
String[] Example: ["INTEL", "AMD", "APPLE Industries"]
bp_market_main_competitors
String[] Example: ["Microsoft"]
bp_market_size enum Values: MEI|ME|EPP|EMP|EGP "MEI": "Individual Microentrepreneur (MEI)" "ME": "Micro enterprise (ME)" "EPP": "Small Business (EPP)" "EMP": "Medium Size Company" "EGP": "Big Company" Example: "MEI"
bp_market_employees_quantity  enum Values: LESS_10|10_50|51_100|101_500|501_1K|1K_10K|MORE_10K "LESS_10": "Less than 10" "10_50": "10 - 50" "51_100": "51 - 100" "101_500": "101 - 500" "501_1K": "501 - 1,000" "1K_10K": "1,001 - 10,000" "MORE_10K": "More than 10,001" Example: "1K_10K"
bp_market_main_customers bpMarketMainCustomersObject[]  
bp_market_main_customers.name String Example: "USA"
bp_market_main_customers.percentage Float
Example: 88.54 
bp_marketing_website
String
bp_marketing_description.descriptions
Descriptions[] Go to 'Descriptions.description'
user_external_agents String[] Example: "gilmar.ehrig@gmail.com"
Descriptions.desciption String Example: "Important description" Note: When field "languages_generals_id" was infomed at general level, this field might be filled with correspondent language description
Descriptions.languages DescriptionsLanguagesObject[]  
Descriptions.languages_generals_id String Example "en-US" Log on MUB platform and get value from path: Setting/Others/Auxiliary Tables Maintenance/Languages/ Note: When infomed at this level, this language will defined as specific for current subobjects and will overwriting general language when defined.
Descriptions.languages.Description String  

Example: "Important description"
Note: When infomed at this level, this language will defined as specific for current subobjects and will overwriting general language when defined.

Comments.commentString 

Example: "Important comment"
Note: When field "languages_generals_id" was infomed at general level, this field might be filled with correspondent language description.

Comments.languagesComentsLanguagesObject[] 
Comments.languages_generals_idStringExample "en-US"
Log on MUB platform and get value from path: Setting/Others/Auxiliary Tables Maintenance/Languages/
Note: When infomed at this level, this language will defined as specific for current subobjects and will overwriting general language when defined.
Comments.languages.CommentStringExample: "Important comment"
Note: When infomed at this level, this language will defined as specific for current subobjects and will overwriting general language when defined.
bp_additional_fieldsbpAdditionalFieldsObject[]

For each additional field, will be required the API key and correspondent field value:


To get API key for each additional field, log on MUB platform and get value from path: Setting/Others/Additional Fields/View/. Example: "36bc9946-df2a-fc29-2097-682fc29257dd".


Only object type "Business Partner" will be accepted.


For each additional field type available on system, see on request example below, on object "bp_additional_fields" the template struture that has to be used.


workflow_additional_fields WorkflowAdditionalFieldsObject[]For each additional field, will be required the API key and correspondent field value:

To get API key for each additional field, log on MUB platform and get value from path: Setting/Forms/Additional Fields/View/. Example: "36bc9946-df2a-fc29-2097-682fc29257dd".


Only object type "Workflow" will be accepted.


For each additional field type available on system, see on request example below, on object "workflow_additional_fields" the template struture that has to be used.



See below full object of request and expected response.


Request example:

{
    "action""BP",
    "process_generals_id""2cfb4f69-5706-406c-9b25-a091b6ff9712",
    "languages_generals_id""en-US",
    "code""APPLE_INC",
    "countries_continents_regions_generals_id""us",
    "type""ORGANIZATION",
    "partner_functions_ids":
    [
        "TRANSPORTER",
        "CUSTOMER",
        "VENDOR"
    ],
    "general_data":
    {
        "company_name""Apple Inc. 2",
        "company_trade_name""Apple 2",
        "company_foundation_date""1978-01-31",
        "bp_aux_person_titles_id"null,
        "person_first_name"null,
        "person_last_name"null,
        "person_birth_date""1971-12-10"
    },
    "status""A",
    "bp_documents":
    [
        {
            "bp_aux_document_types_id""CNPJ",
            "identification""942404110",
            "valid_from""2020-01-01",
            "valid_to""2030-01-01",
            "issuer""IRS",
            "status""A",
            "consulted_at""2021-10-14",
            "comments":
            [
                {
                    "comment""Main document",
                    "languages":
                    [
                        {
                            "languages_generals_id""pt-br",
                            "comment""Documento principal"
                        },
                        {
                            "languages_generals_id""en-US",
                            "comment""Main document"
                        }
                    ]
                }
            ]
        }
    ],
    "bp_addresses":
    [
        {
            "bp_aux_addresses_types_id""MAIN",
            "address_line_1""One Apple Park Way",
            "address_line_2""Apple Building",
            "number""1",
            "complement""All Build",
            "postal_code""95014",
            "district""One Apple Park Way District",
            "city""Cupertino",
            "region""California",
            "countries_continents_regions_generals_id""us",
            "valid_from""2020-01-01",
            "valid_to""2030-01-01",
            "status""A",
            "comments":
            [
                {
                    "languages":
                    [
                        {
                            "languages_generals_id""pt-br",
                            "comment""Endereço principal"
                        },
                        {
                            "languages_generals_id""en-US",
                            "comment""Main address"
                        }
                    ]
                }
            ]
        }
    ],
    "bp_contacts":
    [
        {
            "bp_aux_contacts_types_id""PRIMARY",
            "bp_aux_person_titles_id""MR",
            "contact_first_name""Eduardo",
            "contact_last_name""Sirangelo",
            "contact_manages_register"true,
            "comments":
            [
                {
                    "comment""Contact comment"
                }
            ],
            "bp_contacts_emails":
            [
                {
                    "email""eduardo.sirangelo@gmail.com",
                    "is_main"true,
                    "comments":
                    [
                        {
                            "comment""E-mail comment"
                        },
                        {
                            "comment""Important comment"
                        }
                    ]
                },
                {
                    "email""joao@gmail.com",
                    "is_main"false,
                    "comments":
                    [
                        {
                            "comment""E-mail comment"
                        }
                    ]
                }
            ],
            "bp_contacts_telephones":
            [
                {
                    "telephone""+55 54 98133-5826",
                    "is_main"true,
                    "comments":
                    [
                        {
                            "comment""Telephone comment"
                        },
                        {
                            "comment""Important comment"
                        }
                    ]
                }
            ]
        }
    ],
    "bp_shareholders":
    [
        {
            "shareholder_bp_generals_id""CODE01",
            "full_name""",
            "shares_percentage"5
        },
        {
            "shareholder_bp_generals_id"null,
            "full_name""Steve Jobs",
            "shares_percentage"55
        },
        {
            "shareholder_bp_generals_id"null,
            "full_name""Tim Cock",
            "shares_percentage"45
        }
    ],
    "bp_executives":
    [
        {
            "executive_bp_generals_id"null,
            "full_name""Steve Jobs",
            "bp_aux_executive_positions_id"null,
            "observations""Member of Concil"
        },
        {
            "executive_bp_generals_id""CODE01",
            "full_name"null,
            "bp_aux_executive_positions_id""ADVIDOR",
            "observations"null
        }
    ],
    "bp_social_medias":
    [
        {
            "bp_aux_social_medias_types_id""FACEBOOK",
            "url""https://facebook.com/apple"
        },
        {
            "bp_aux_social_medias_types_id""INSTAGRAM",
            "url""https://instagram.com/apple"
        },
        {
            "bp_aux_social_medias_types_id""YOUTUBE",
            "url""https://www.youtube.com/apple"
        }
    ],
    "bp_relations":
    [
        {
            "direction""IS",
            "bp_aux_relations_types_id""COMMERCIAL_PARTNER",
            "related_bp_generals_id""CODE01",
            "valid_from""2020-01-16",
            "valid_to""2030-01-22"
        },
        {
            "direction""HAS",
            "bp_aux_relations_types_id""SALES_REPRESENTATIVE",
            "related_bp_generals_id""CODE01",
            "valid_from""2020-01-16",
            "valid_to""2030-01-22"
        }
    ],
    "bp_aux_br_tipo_tributacoes_id""LUCRO_PRESSUMIDO",
    "bp_aux_br_natureza_juridicas_id""204-6",
    "bp_taxes":
    {
        "br_cnae_principal_code""5222-2/00",
        "br_cnae_secundario_codes":
        [
            "6822-6/00",
            "7312-2/00 ",
            " 5223-1/00 "
        ]
    },
    "bp_bank_accounts":
    [
        {
            "bp_aux_bank_accounts_categories_id""MAIN",
            "bp_aux_bank_codes_id""001",
            "countries_continents_regions_generals_id""br",
            "address""Av. Paulista",
            "city""São Paulo",
            "branch_code""1445",
            "branch_digit""8",
            "account_number""111544",
            "account_digit""7",
            "aba_code""ABA-879",
            "iban_code""IBAN-564",
            "swift_bic_code""BIC0-546",
            "account_type""CURRENT",
            "pix""942404110",
            "status""A",
            "comments":
            [
                {
                    "languages":
                    [
                        {
                            "languages_generals_id""pt-br",
                            "comment""Conta no Brasil"
                        },
                        {
                            "languages_generals_id""en-US",
                            "comment""Brazilian bank account"
                        }
                    ]
                }
            ]
        },
        {
            "bp_aux_bank_accounts_categories_id""MAIN",
            "bp_aux_bank_codes_id"null,
            "countries_continents_regions_generals_id""us",
            "address""3ª Street, 74",
            "city""Cupertino",
            "branch_code""7411",
            "branch_digit"null,
            "account_number""111544",
            "account_digit"null,
            "aba_code""ABA-546",
            "iban_code""IBAN-213",
            "swift_bic_code""BIC0-147",
            "account_type"null,
            "pix"null,
            "status""A",
            "comments":
            [
                {
                    "comment""USA Bank Account"
                }
            ]
        }
    ],
    "bp_market_categories":
    [
        {
            "category""UNSPSC",
            "code""43231508"
        },
        {
            "category""TIPI",
            "code""03046210"
        },
        {
            "category""HIDRAULIC",
            "code""HYDRAULIC_PUMP"
        }
    ],
    "bp_market_annual_gross_billing":
    [
        {
            "annual_gross_billing_year"2020,
            "annual_gross_billing_month""12",
            "annual_gross_billing_currencies_generals_id""USD",
            "annual_gross_billing_value"12345678.32
        }
    ],
    "bp_market_operation_locations":
    [
        " USA",
        "BRAZIL",
        "EUROPE "
    ],
    "bp_market_delivery_locations":
    [
        " USA",
        "BRAZIL",
        "EUROPE "
    ],
    "bp_market_main_vendors":
    [
        "INTEL",
        "AMD",
        "APPLE Industries"
    ],
    "bp_market_main_competitors":
    [
        "Microsoft"
    ],
    "bp_market_size""EGP",
    "bp_market_employees_quantity""MORE_10K",
    "bp_market_main_customers":
    [
        {
            "name""USA",
            "percentage"88.54
        },
        {
            "name""Brazil",
            "percentage"9
        },
        {
            "name""Europe",
            "percentage"3
        }
    ],
    "bp_marketing_website""https://www.empresa.com",
    "bp_marketing_description":
    {
        "description""Um texto longo em br",
        "languages": [
            {
                "languages_generals_id""pt-br",
                "description""Um texto longo em br"
            },
            {
                "languages_generals_id""en-US",
                "description""Long text in Brazilian Portuguese"
            }
        ]
    },
    "user_external_agents":
    [
        {
            "email""gilmar.do.bogas.dourado@gmail.com"
        }
    ],
    "tags":
    [
        "company",
        "BP",
        "Software company"
    ],
    "bp_additional_fields":
    [
        {
            "36bc9946-df2a-fc29-2097-682fc29257dd": { * Type: Text
                "description""ID-123456"
            }
        },
        {
            "56e83b9f-0650-5458-af82-e704c0cf0f40": {  * Type: Long Text
                "description""Um texto longo em br",
                "languages": [
                    {
                        "languages_generals_id""br",
                        "description""Important description"
                    },
                    {
                        "languages_generals_id""en-US",
                        "description""Long text in Brazilian Portuguese"
                    }
                ]
            }
        },
        {
            "89a1f649-cdd9-4a83-9e8a-2ebf96259101": { * Type: Numeric
                "description"123.456
            }
        },
        {
            "b549143f-c89c-45bf-a74f-78de540302b9": { * Type: Monetary
                "description"123.45
            }
        },
        {
            "fb24b7b1-f75b-4b48-9cf3-892d9d07a368": { * Type: Date
                "description""01/12/2021"
            }
        },
        {
            "ba570f92-a584-43c4-9792-77048881c217": { * Type: List with 1 selection
                "description""VL01"
            }
        },
        {
            "8eb8caa3-f2f1-415d-b84c-c3262d162931": {  * Type: List with multiple selections
                "description": ["VLM01","VLM02"]
            }
        },
        {
            "a10a02b0-4db2-4a6f-bc0f-4c379967f18e": { * Type: Hour
                "description""12:00"
            }
        },
        {
            "133ad8c9-aa40-45f9-bcdc-537f85ceabf3": { * Type: E-mail
                "description""contact@mub.one"
            }
        }
    ],
    "workflow_additional_fields": [
       {
            "93c0925d-6737-b993-3abf-5698347c7493": { * Type: Text
                "description""Texto exemplo"
            }
        }
* For all other field type, add below using same data structure tamplate used for "bp_additional_fields" above.
]
}
Response example:
{
    "success"true,
    "message""Workflow successfully started!",
    "data": {
        "id"496
    }
}