biterp

get_purchase_invoice

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

Get Purchase Invoice · Notas fiscais de entrada

Somente leituraDestrutivaIdempotenteMundo aberto
SimNãoSimNã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.

Returns one purchase invoice by ID with line items, taxes, supplier, pending payables, and country extension data. A Brazilian invoice may come from a captured NF-e (nfe_import) or NFS-e (nfse_import, with the declared net amount and import warnings).

Parâmetros

ParâmetroTipoObrigatórioDescrição
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 retrieve.

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—

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

Nesta página