biterp

prefill_invoice_from_sales_order

Referência da tool prefill_invoice_from_sales_order do MCP Server do bitERP (Notas fiscais de saída).

Prefill Invoice from Sales Order · Notas fiscais de saída

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 a draft invoice payload prefilled from a sales order (commercial data only; taxes are not computed).

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.
sales_order_idstring (UUID)SimUUID of the sales order to prefill from.

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
operation_typestringValores: sale, return.
customer_idstring (UUID)—
product_typestring—
sales_order_idstring (UUID)—
discount_amountstring—
discount_ratestring—
itemsarray de objetos—
items[].item_descriptionstring—
items[].quantitystring—
items[].unit_pricestring—
items[].discount_amountstring—
items[].product_idstring (UUID) ou null—
items[].sales_order_item_idstring (UUID) ou null—
br_dataobject—
br_data.taxation_typestring—

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

Nesta página