create_sales_order
Referência da tool create_sales_order do MCP Server do bitERP (Pedidos de venda).
Create Sales Order · Pedidos de venda
| Somente leitura | Destrutiva | Idempotente | Mundo aberto |
|---|---|---|---|
| Não | Não | Não | 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.
Creates one internal sales order record with line items.
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. |
customer_id | string (UUID) | Sim | The UUID of the customer. Use list_customers to find available customers. |
operation_type | string | Não | Document operation type: sale or return. Defaults to sale. Valores: sale, return. |
product_type | string | Sim | Document product type: product, service, or both. Valores: goods, service, mixed. |
reference_code | string | Não | Optional order reference code (must be unique per tenant) |
quote_id | string (UUID) | Não | UUID of the originating quote, if this order was created from a quote |
order_date | string (date) | Sim | Order date (YYYY-MM-DD). |
delivery_date | string (date) | Não | Estimated delivery date (YYYY-MM-DD). |
salesperson_name | string | Não | Name of the salesperson responsible for this order |
description | string | Não | General description or notes for the order |
notes | string | Não | Additional internal notes |
discount_amount | decimal (string ou number) | Não | Global discount amount applied to the order total as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted |
discount_rate | decimal (string ou number) | Não | Global discount rate applied to the order total 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 |
items | array de objetos | Sim | Array of line items (at least 1 required, max 200) |
items[].product_id | string (UUID) | Sim | The UUID of the product. Use list_products to find available products. |
items[].item_description | string | Sim | Description of the line item |
items[].quantity | decimal (string ou number) | Sim | Quantity 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_price | decimal (string ou number) | Sim | Unit price as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted, must be non-negative |
items[].discount_amount | decimal (string ou number) | Não | Discount amount per item as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted, must be non-negative |
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 | — |
customer_id | string (UUID) | — |
quote_id | string (UUID) ou null | — |
subscription_id | string (UUID) ou null | — |
quote | object ou null | — |
quote.id | string (UUID) | — |
quote.reference_code | string ou null | — |
reference_code | string ou null | — |
operation_type | string | — |
product_type | string | Valores: goods, service, mixed. |
status | string | Valores: draft, confirmed, cancelled. |
order_date | string (date) | — |
delivery_date | string (date) ou null | — |
salesperson_name | string ou null | — |
description | string ou null | — |
notes | string ou null | — |
subtotal | string | — |
items_discount | string | — |
discount_amount | string | — |
discount_rate | string | — |
total_discount | string | — |
total | string | — |
metadata | object | — |
pending_receivables | array de objetos ou null | — |
br_data | object ou null | — |
br_data.taxation_type | string ou null | — |
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 | — |
customer | object ou null | — |
customer.id | string (UUID) | — |
customer.legal_name | string | — |
customer.trade_name | string ou null | — |
customer.tax_id | string ou null | — |
customer.tax_id_type | string ou null | — |
customer.country_code | string | — |
invoice | object ou null | — |
invoice.id | string (UUID) | — |
invoice.status | string | — |
invoice.reference_code | string ou null | — |
has_active_invoice | boolean | — |
is_imported | boolean | — |
financial_status | string ou null | Valores: open, partial, overdue, paid. |
_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": "create_sales_order",
"arguments": {
"tenant": "minha-empresa",
"customer_id": "<uuid>",
"product_type": "goods",
"order_date": "2026-01-15",
"items": [
{
"product_id": "<uuid>",
"item_description": "<item_description>",
"quantity": "100.00",
"unit_price": "100.00"
}
]
}
}
}
