update_payable
Referência da tool update_payable do MCP Server do bitERP (Contas a pagar).
Update Payable · Contas a pagar
| Somente leitura | Destrutiva | Idempotente | Mundo aberto |
|---|---|---|---|
| Não | Sim | Sim | 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.
Updates one internal accounts payable record. Only the provided fields are changed. Field editability is decided by the record status alone, not by whether allocations exist: status pending or overdue accepts every field (an overdue payable stays fully editable even when partly settled); status paid or partial accepts only notes and financial_category_id among the fields this tool exposes (the REST API additionally allows metadata); status cancelled, missing or unrecognized rejects every field. To change anything else on a paid or partial payable, undo, reverse or unallocate its settlements until no settled amount is left - a single undo or a partial reversal may leave the record in partial and still restricted, because the status is recalculated from the allocations that remain. Credit card statements and card purchases accept only the fields allowed for their phase (open or closed statement), whatever the status; a refusal by phase returns code CARD_STATEMENT_FIELD_LOCKED.
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. |
id | string (UUID) | Sim | The UUID of the payable to update. A cancelled payable - or one whose status is missing or unrecognized - rejects every field; one whose status is paid or partial accepts notes and financial_category_id. |
supplier_id | string (UUID) | Não | New supplier ID. Rejected while the payable status is paid, partial or cancelled, or if that status is missing or unrecognized. |
financial_account_id | string (UUID) | Não | New financial account ID (must be active; credit card accounts are not accepted). Rejected while the payable status is paid, partial or cancelled, or if that status is missing or unrecognized. |
payment_method_id | string (UUID) | Não | New payment method ID. Rejected while the payable status is paid, partial or cancelled, or if that status is missing or unrecognized. |
financial_category_id | string (UUID) | Não | Financial category ID. Still accepted while the payable status is paid or partial (but not when cancelled). |
reference_code | string ou null | Não | New reference code (null to clear, must be unique per tenant). Rejected while the payable status is paid, partial or cancelled, or if that status is missing or unrecognized. |
amount | decimal (string ou number) | Não | New amount as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted, cannot be less than already allocated total. Rejected while the payable status is paid, partial or cancelled, or if that status is missing or unrecognized. |
discount_amount | decimal (string ou number) | Não | New discount amount as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted. Rejected while the payable status is paid, partial or cancelled, or if that status is missing or unrecognized. |
surcharge_amount | decimal (string ou number) | Não | New surcharge amount as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted. Rejected while the payable status is paid, partial or cancelled, or if that status is missing or unrecognized. |
issue_date | string | Não | New issue date as calendar date YYYY-MM-DD. Rejected while the payable status is paid, partial or cancelled, or if that status is missing or unrecognized. |
due_date | string | Não | New due date as calendar date YYYY-MM-DD. Rejected while the payable status is paid, partial or cancelled, or if that status is missing or unrecognized. |
description | string | Não | New description. Rejected while the payable status is paid, partial or cancelled, or if that status is missing or unrecognized. |
notes | string | Não | New notes. Still accepted while the payable status is paid or partial (but not when cancelled). |
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 |
|---|---|---|
id | string (UUID) | — |
tenant_id | string (UUID) | — |
record_number | integer | — |
supplier_id | string (UUID) ou null | — |
supplier | object ou null | — |
supplier.id | string (UUID) | — |
supplier.legal_name | string | — |
supplier.trade_name | string ou null | — |
supplier.tax_id | string ou null | — |
supplier.tax_id_type | string ou null | — |
supplier.country_code | string | — |
financial_account_id | string (UUID) | — |
financial_account | object ou null | — |
financial_account.id | string (UUID) | — |
financial_account.name | string | — |
financial_account.reference_code | string ou null | — |
financial_account.type | string | Valores: checking, savings, cash, digital_wallet, gateway, credit_card. |
payment_method_id | string (UUID) ou null | — |
payment_method | object ou null | — |
payment_method.id | string (UUID) | — |
payment_method.code | string | — |
payment_method.titles | object | — |
financial_category_id | string (UUID) ou null | — |
financial_category | object ou null | — |
financial_category.id | string (UUID) | — |
financial_category.name | string | — |
financial_category.code | string ou null | — |
account_scope_mask | object | — |
account_scope_mask.counterparty | boolean | — |
account_scope_mask.category | boolean | — |
account_scope_mask.balance | boolean | — |
purchase_invoice_id | string (UUID) ou null | — |
purchase_invoice | object ou null | — |
purchase_invoice.id | string (UUID) | — |
purchase_invoice.reference_code | string ou null | — |
parent_payable_id | string (UUID) ou null | — |
parent | any ou null | — |
statement_payable_id | string (UUID) ou null | — |
type | string | Valores: standard, interest, fine, bank_fee, refund, chargeback, card_statement. |
reference_code | string ou null | — |
status | string | Valores: pending, partial, paid, overdue, cancelled. |
amount | string | — |
discount_amount | string | — |
surcharge_amount | string | — |
issue_date | string (date) | — |
due_date | string (date) | — |
paid_at | string (date-time) ou null | — |
installment_group_id | string (UUID) ou null | — |
installment_number | integer ou null | — |
installment_count | integer ou null | — |
description | string ou null | — |
notes | string ou null | — |
metadata | object | — |
created_by_user_id | string (UUID) ou null | — |
updated_by_user_id | string (UUID) ou null | — |
deleted_by_user_id | string (UUID) ou null | — |
created_at | string (date-time) | — |
updated_at | string (date-time) | — |
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": "update_payable",
"arguments": {
"tenant": "minha-empresa",
"id": "<uuid>"
}
}
}
