create_payable_from_transaction
Referência da tool create_payable_from_transaction do MCP Server do bitERP (Contas a pagar).
Create Payable from Transaction · Contas a pagar
| Somente leitura | Destrutiva | Idempotente | Mundo aberto |
|---|---|---|---|
| Não | Sim | Não | Não |
Descrição
A descrição abaixo é a que o servidor publica, em inglês, e é o texto que o agente lê para decidir quando usar a tool.
Creates one internal accounts payable record from an ERP transaction entry and records the allocation in one operation. Not available for transactions on a credit card account.
Parâmetros
| Parâmetro | Tipo | Obrigatório | Descrição |
|---|---|---|---|
tenant | string | Sim | Defines which tenant will have data read or changed. Use list_tenants first and prefer the returned tenant slug. Writes are permanent, so when the user has more than one tenant you must confirm the tenant before any write and never assume or reuse a previous choice without confirmation. UUID is accepted only when already known safely. |
financial_transaction_id | string (UUID) | Sim | Financial transaction ID to create payable from (typically a DEBIT transaction) |
supplier_id | string (UUID) | Sim | Supplier ID |
reference_code | string | Sim | Unique reference code |
issue_date | string | Sim | Issue date as calendar date YYYY-MM-DD |
due_date | string | Sim | Due date as calendar date YYYY-MM-DD |
amount | decimal (string ou number) | Não | Payable amount as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted. If omitted, uses absolute value of transaction amount. |
allocated_amount | decimal (string ou number) | Não | Amount to allocate as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted. If omitted, uses min(payable, remaining on tx). |
payment_method_id | string (UUID) | Não | Payment method ID |
financial_category_id | string (UUID) | Não | Financial category ID (leaf, unblocked category) |
discount_amount | decimal (string ou number) | Não | Discount amount as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted |
surcharge_amount | decimal (string ou number) | Não | Surcharge amount as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted |
description | string | Não | Description |
notes | string | Não | Notes |
Resposta
O structuredContent da resposta traz os campos abaixo (até dois níveis; o schema completo está no outputSchema publicado no tools/list).
| Campo | Tipo | Descrição |
|---|---|---|
payable | object | — |
payable.id | string (UUID) | — |
payable.tenant_id | string (UUID) | — |
payable.record_number | integer | — |
payable.supplier_id | string (UUID) ou null | — |
payable.supplier | object ou null | — |
payable.financial_account_id | string (UUID) | — |
payable.financial_account | object ou null | — |
payable.payment_method_id | string (UUID) ou null | — |
payable.payment_method | object ou null | — |
payable.financial_category_id | string (UUID) ou null | — |
payable.financial_category | object ou null | — |
payable.account_scope_mask | object | — |
payable.purchase_invoice_id | string (UUID) ou null | — |
payable.purchase_invoice | object ou null | — |
payable.parent_payable_id | string (UUID) ou null | — |
payable.parent | any ou null | — |
payable.statement_payable_id | string (UUID) ou null | — |
payable.type | string | Valores: standard, interest, fine, bank_fee, refund, chargeback, card_statement. |
payable.reference_code | string ou null | — |
payable.status | string | Valores: pending, partial, paid, overdue, cancelled. |
payable.amount | string | — |
payable.discount_amount | string | — |
payable.surcharge_amount | string | — |
payable.issue_date | string (date) | — |
payable.due_date | string (date) | — |
payable.paid_at | string (date-time) ou null | — |
payable.installment_group_id | string (UUID) ou null | — |
payable.installment_number | integer ou null | — |
payable.installment_count | integer ou null | — |
payable.description | string ou null | — |
payable.notes | string ou null | — |
payable.metadata | object | — |
payable.created_by_user_id | string (UUID) ou null | — |
payable.updated_by_user_id | string (UUID) ou null | — |
payable.deleted_by_user_id | string (UUID) ou null | — |
payable.created_at | string (date-time) | — |
payable.updated_at | string (date-time) | — |
payable.deleted_at | string (date-time) ou null | — |
allocation | object | — |
allocation.id | string (UUID) | — |
allocation.tenant_id | string (UUID) | — |
allocation.payable_id | string (UUID) | — |
allocation.financial_transaction_id | string (UUID) | — |
allocation.allocated_amount | string | — |
allocation.reverses_allocation_id | string (UUID) ou null | — |
allocation.discount_delta | string | — |
allocation.surcharge_delta | string | — |
allocation.notes | string ou null | — |
allocation.created_by_user_id | string (UUID) ou null | — |
allocation.updated_by_user_id | string (UUID) ou null | — |
allocation.deleted_by_user_id | string (UUID) ou null | — |
allocation.created_at | string (date-time) | — |
allocation.updated_at | string (date-time) | — |
allocation.deleted_at | string (date-time) ou null | — |
_tenant | object | — |
_tenant.id | string (UUID) | — |
_tenant.slug | string | — |
_tenant.company_name | string | — |
Exemplo de chamada
Requisição tools/call com os parâmetros obrigatórios. Os valores são ilustrativos: troque minha-empresa pelo tenant devolvido por list_tenants e cada <...> por um valor real.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "create_payable_from_transaction",
"arguments": {
"tenant": "minha-empresa",
"financial_transaction_id": "<uuid>",
"supplier_id": "<uuid>",
"reference_code": "<reference_code>",
"issue_date": "2026-01-15",
"due_date": "2026-01-15"
}
}
}
