biterp

update_purchase_invoice

Referência da tool update_purchase_invoice do MCP Server do bitERP (Notas fiscais de entrada).

Update Purchase Invoice · Notas fiscais de entrada

Somente leituraDestrutivaIdempotenteMundo aberto
NãoSimNãoNã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 a purchase invoice. Only provided fields change. Items/taxes/payables arrays replace the full set when sent. On finalized invoices, items, taxes, discounts and payables are rejected; header fields can still change.

Parâmetros

ParâmetroTipoObrigatórioDescrição
reference_codestring ou nullNãoOrigin system reference code. Null when created directly in bitERP.
invoice_numberstringNãoSupplier invoice number.
invoice_seriesstringNãoInvoice series.
product_typestringNãoProduct type: goods, service, or mixed. Must fit the document type already stored on the invoice (document type is fixed after create): nfse and cte are always service; the other types accept any value. Valores: goods, service, mixed.
issue_datestring (date)NãoIssue date (YYYY-MM-DD).
received_datestring (date) ou nullNãoReceived date (YYYY-MM-DD).
due_datestring (date) ou nullNãoDue date (YYYY-MM-DD).
descriptionstring ou nullNãoDescription.
notesstring ou nullNãoInternal notes.
discount_amountdecimal (string ou number)NãoGlobal discount amount as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted
discount_ratedecimal (string ou number)NãoGlobal discount rate as decimal string on the 0-100 percentage scale (e.g. "10" = 10%, "0.5" = half a percent); a JSON number on the same scale is also accepted
itemsarray de objetosNãoLine items. Sending the list replaces the full set (missing rows are soft-deleted). Rejected on finalized purchase invoices.
items[].product_idstring (UUID)NãoProduct UUID. Use list_products to find products.
items[].item_descriptionstringSimLine item description.
items[].quantitydecimal (string ou number)SimQuantity as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted, must be > 0
items[].unit_pricedecimal (string ou number)SimUnit price as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted, non-negative
items[].discount_amountdecimal (string ou number)NãoLine discount amount as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted
items[].idstring (UUID)NãoExisting purchase invoice item UUID when updating a line.
items[].positionintegerNãoOrdering hint only when updating items (array order wins).
taxesarray de objetosNãoFull replacement of purchase invoice taxes when present.
taxes[].item_indexintegerNãoZero-based index into items[] for line-level tax. Omit for invoice-level tax.
taxes[].tax_codestringSimTax code (e.g. ICMS, PIS).
taxes[].tax_namestringNãoDisplay name of the tax.
taxes[].base_amountdecimal (string ou number)SimTax base amount as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted
taxes[].ratedecimal (string ou number)SimTax rate as decimal string on the 0-100 percentage scale (e.g. "10" = 10%, "0.5" = half a percent); a JSON number on the same scale is also accepted
taxes[].amountdecimal (string ou number)SimTax amount as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted
taxes[].is_withheldbooleanNãoWhen true, tax is withheld from net payable.
taxes[].is_includedbooleanNãoWhen true, tax is already included in item subtotal.
taxes[].jurisdictionstringNãoTax jurisdiction label.
taxes[].positionintegerSimSort position among tax lines.
payablesarray de objetosNãoFull replacement of pending payables snapshot when present in draft.
payables[].amountdecimal (string ou number)SimPayable installment amount as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted, must be > 0
payables[].due_datestring (date)SimDue date (YYYY-MM-DD).
payables[].financial_account_idstring (UUID)SimFinancial account UUID for this payable. A credit card account turns the invoice into a card purchase, which requires a single payable: installments on a card are not supported yet.
payables[].financial_category_idstring (UUID)NãoOptional financial category UUID.
payables[].payment_method_idstring (UUID)NãoOptional payment method UUID.
payables[].descriptionstringNãoInstallment description.
tenantstringSimDefines 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.
idstring (UUID)SimUUID of the purchase invoice to update.

Resposta

O structuredContent da resposta traz os campos abaixo (até dois níveis; o schema completo está no outputSchema publicado no tools/list).

CampoTipoDescrição
idstring (UUID)—
supplier_idstring (UUID)—
supplierobject ou null—
supplier.idstring (UUID)—
supplier.legal_namestring—
supplier.trade_namestring ou null—
supplier.tax_idstring ou null—
supplier.tax_id_typestring ou null—
supplier.country_codestring—
reference_codestring ou null—
invoice_numberstring—
invoice_seriesstring ou null—
statusstringValores: draft, finalized.
situationstringValores: draft, manual, imported, validated, rejected, booked, finalized.
operation_typestring—
product_typestringValores: goods, service, mixed.
document_typestringValores: nfe, nfce, cfe, nfse, cte, receipt, other.
issue_datestring (date)—
due_datestring (date) ou null—
received_datestring (date) ou null—
descriptionstring ou null—
notesstring ou null—
discount_amountstring—
discount_ratestring—
subtotalstring—
items_discountstring—
total_discountstring—
total_taxstring—
withheld_totalstring—
net_payable_totalstring—
covered_amountstring—
uncovered_amountstring—
totalstring—
pending_payablesarray de objetos ou null—
pending_payables[].amountstring—
pending_payables[].due_datestring (date)—
pending_payables[].financial_account_idstring (UUID)—
pending_payables[].financial_category_idstring (UUID) ou null—
pending_payables[].payment_method_idstring (UUID) ou null—
pending_payables[].descriptionstring ou null—
itemsarray de objetos—
items[].idstring (UUID)—
items[].purchase_invoice_idstring (UUID)—
items[].product_idstring (UUID) ou null—
items[].item_descriptionstring—
items[].quantitystring—
items[].unit_pricestring—
items[].discount_amountstring—
items[].subtotalstring—
items[].totalstring—
items[].positioninteger—
items[].br_dataobject ou null—
items[].deleted_atstring (date-time) ou null—
taxesarray de objetos—
taxes[].idstring (UUID)—
taxes[].purchase_invoice_idstring (UUID)—
taxes[].purchase_invoice_item_idstring (UUID) ou null—
taxes[].tax_codestring—
taxes[].tax_namestring—
taxes[].base_amountstring—
taxes[].ratestring—
taxes[].amountstring—
taxes[].jurisdictionstring ou null—
taxes[].is_withheldboolean—
taxes[].is_includedboolean—
taxes[].positioninteger—
taxes[].imported_missing_fieldsarray de string—
taxes[].deleted_atstring (date-time) ou null—
br_dataobject ou null—
br_data.purchase_invoice_idstring (UUID)—
br_data.nfe_access_keystring ou null—
br_data.nfse_access_keystring ou null—
br_data.capture_statusstring ou null—
us_dataobject ou null—
us_data.purchase_invoice_idstring (UUID)—
us_data.po_numberstring ou null—
us_data.net_termsinteger ou null—
us_data.form_1099_typestring ou null—
us_data.form_1099_reportableboolean—
us_data.use_tax_self_assessedboolean—
nfe_importobject ou null—
nfe_import.access_keystring—
nfe_import.installmentsarray de objetos—
nfe_import.dfe_inbound_nfe_idstring (UUID) ou null—
nfse_importobject ou null—
nfse_import.access_keystring—
nfse_import.dfe_inbound_nfse_idstring (UUID) ou null—
nfse_import.originstringValores: created, linked.
nfse_import.net_amountstring ou null—
nfse_import.conditional_discountstring ou null—
nfse_import.warningsarray de string—
cte_importobject ou null—
cte_import.access_keystring—
cte_import.cte_typestringValores: normal, complement, substitution.
cte_import.referenced_access_keystring ou null—
cte_import.installmentsarray de objetos—
cte_import.dfe_inbound_cte_idstring (UUID) ou null—
deleted_by_user_idstring (UUID) ou null—
created_atstring (date-time)—
updated_atstring (date-time)—
deleted_atstring (date-time) ou null—
_tenantobject—
_tenant.idstring (UUID)—
_tenant.slugstring—
_tenant.company_namestring—

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_purchase_invoice",
        "arguments": {
            "tenant": "minha-empresa",
            "id": "<uuid>"
        }
    }
}

Nesta página