biterp

get_sales_order

Referência da tool get_sales_order do MCP Server do bitERP (Pedidos de venda).

Get Sales Order · Pedidos de venda

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 sales order record by UUID or record number with customer and line-item details. Provide exactly one of id or record_number.

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)NãoThe UUID of the sales order to retrieve
record_numberintegerNãoThe tenant-scoped sales order record number 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)—
tenant_idstring (UUID)—
record_numberinteger—
customer_idstring (UUID)—
quote_idstring (UUID) ou null—
subscription_idstring (UUID) ou null—
quoteobject ou null—
quote.idstring (UUID)—
quote.reference_codestring ou null—
reference_codestring ou null—
operation_typestring—
product_typestringValores: goods, service, mixed.
statusstringValores: draft, confirmed, cancelled.
order_datestring (date)—
delivery_datestring (date) ou null—
salesperson_namestring ou null—
descriptionstring ou null—
notesstring ou null—
subtotalstring—
items_discountstring—
discount_amountstring—
discount_ratestring—
total_discountstring—
totalstring—
metadataobject—
pending_receivablesarray de objetos ou null—
br_dataobject ou null—
br_data.taxation_typestring ou null—
created_by_user_idstring (UUID) ou null—
updated_by_user_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—
customerobject ou null—
customer.idstring (UUID)—
customer.legal_namestring—
customer.trade_namestring ou null—
customer.tax_idstring ou null—
customer.tax_id_typestring ou null—
customer.country_codestring—
invoiceobject ou null—
invoice.idstring (UUID)—
invoice.statusstring—
invoice.reference_codestring ou null—
has_active_invoiceboolean—
is_importedboolean—
financial_statusstring ou nullValores: open, partial, overdue, paid.
itemsarray de objetos—
items[].idstring (UUID)—
items[].tenant_idstring (UUID)—
items[].sales_order_idstring (UUID)—
items[].product_idstring (UUID)—
items[].item_descriptionstring—
items[].quantitystring—
items[].unit_pricestring—
items[].discount_amountstring—
items[].subtotalstring—
items[].totalstring—
items[].positioninteger—
items[].created_by_user_idstring (UUID) ou null—
items[].updated_by_user_idstring (UUID) ou null—
items[].deleted_by_user_idstring (UUID) ou null—
items[].created_atstring (date-time)—
items[].updated_atstring (date-time)—
items[].deleted_atstring (date-time) ou null—
items[].productobject ou null—
receivablesarray de objetos—
receivables[].idstring (UUID)—
receivables[].reference_codestring ou null—
receivables[].statusstringValores: pending, partial, paid, overdue, cancelled.
receivables[].amountstring—
receivables[].due_datestring (date)—
receivables[].paid_atstring (date-time) ou null—
receivables[].payment_method_idstring (UUID) ou null—
receivables[].financial_account_idstring (UUID)—
receivables[].installment_numberinteger ou null—
receivables[].installment_countinteger ou null—
receivables[].descriptionstring ou null—
has_active_receivablesboolean—

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.

Além dos parâmetros obrigatórios, a tool exige exatamente um destes: id, record_number. Sem nenhum, ou com mais de um, ela responde ValidationError. O exemplo usa record_number.

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
        "name": "get_sales_order",
        "arguments": {
            "tenant": "minha-empresa",
            "record_number": 42
        }
    }
}

Nesta página