Actions34
- Cliente Actions
- Catálogo Actions
- Pedido Actions
- Conversa Actions
- Contexto Actions
- Telemetria Actions
- Canal WhatsApp Actions
- Paciente Actions
- Procedimento Actions
- Agenda Actions
- Agendamento Actions
- Lembrete Odonto Actions
Pedido → Criar
AI-generatedSummary
Create a new Pedido (order) by specifying customer phone, optional customer name, items to order, delivery type, and optional additional details; the operation resolves or creates the customer and submits the order idempotently to the Núcleo Wondai API.
Inputs
- Telefone (required) — Customer phone number in E.164 format; resolves existing customer or creates a new one.
- Nome do Cliente — Optional customer name used if the customer is new or has no name; does not overwrite existing name.
- Itens (JSON) (required) — JSON array of order items; each item must specify either produto_id or alias and a positive quantidade; may include variation and configuration options for configurable products.
- Tipo de Entrega — Delivery type, either 'retirada' (pickup) or 'entrega' (delivery); defaults to 'retirada'.
- Observações — Optional text notes about the order.
- Agendado Para — Optional ISO 8601 datetime string to schedule the order; empty for immediate.
- Endereço de Entrega (JSON) — Optional JSON object snapshot of delivery address with required 'logradouro' and 'cidade' if provided.
- Forma de Pagamento — Optional payment method: PIX, Cartão, Dinheiro, or empty (not informed). When 'dinheiro' is selected, 'Troco Para' should be set if needed.
- Troco Para — Numeric value for change required only when payment is 'dinheiro'; must be greater or equal to total order value. Zero or empty means no change needed.
- Taxa de Entrega — Optional delivery fee amount; zero or empty means no fee.
- Desconto — Optional discount amount in the local currency; zero or empty means no discount.
- Cobranças Comerciais (JSON) — Optional JSON array of commercial charges that contribute to the total without becoming products; for paid add-ons, only the official reference with rule key and revision ID must be sent.
- Loja (unit_id) — Optional legacy store unit ID; usually left empty as store is determined by token. If provided, must match token association or is rejected.
- Idempotency Key — Optional idempotency key for request deduplication; generated automatically if left empty.
Output shape
a single JSON response object representing the created order or error details
The operation is idempotent using the idempotency key; if an error response occurs, error details and HTTP status code are returned. All inputs are validated, and the items array must be well-formed with product identifiers and positive quantities.