Order
Order. Created with POST /orders (body: `OrderCreate`), which drives the very same pricing + cart pipeline as the dashboard's manager checkout. Once placed, an order is IMMUTABLE: PUT accepts a small whitelist ({void, internal_notes}) on `/orders/{id}`. No DELETE. `items` is a FLAT vector of rows, one per (producto, opcion). Financial fields (`subtotal`, `discount`, `surcharge`, `tax`, `total`) are flat at the top level, all ABSOLUTE. Invariant: total = subtotal − discount + surcharge + tax `discount` rolls up ALL reductions (order-level % discount + amount- promo). `surcharge` rolls up ALL additions (payment-method surcharge + shipping). `tax` is the IVA amount the merchant adds on top when the negocio is configured to display prices NET (tax-exclusive); zero when the negocio's stored prices already include tax. TAX CONVENTION (read carefully): - If the negocio displays prices NET (i.e. `:negocio/sumar-iva` is true internally), line `:item/precio` storage is pre-tax. The API resolves `tax = (subtotal − discount + surcharge) × iva%` and adds it to `total`. Consumers see the FINAL amount due in `total`. - If the negocio displays prices GROSS (default), line storage already includes tax. `tax` is 0 and `total` carries the gross number. Either way the customer-pays number is `total`. Consumers integrating for invoicing (AFIP / SAT / DIAN) still need to apply their own per-country fiscal breakdown — `:cliente/condicion-iva` (responsable- inscripto / monotributo / consumidor-final / exento) is metadata for that downstream flow and does NOT alter `total`.
Ejemplo
Campo
| Campo | Tipo | Flags | Notas |
|---|---|---|---|
id | string | sólo lectura | |
created_at | string | sólo lectura | ISO-8601 UTC. |
customer_id | string | sólo lectura | |
status | string | sólo lectura | |
erp_id | string | sólo lectura | |
observaciones | string | sólo lectura | Customer-facing notes. |
internal_notes | string | Internal notes. Settable via PUT. | |
voided | boolean | Settable via PUT only (the "void" key). | |
subtotal | number | sólo lectura | Σ of frozen line :item/precio. |
discount | number | sólo lectura | Absolute amount deducted from subtotal (order-level % discount + amount-promo combined). |
surcharge | number | sólo lectura | Absolute amount added on top of (subtotal − discount). Bundles payment-method surcharge + shipping; internal percent-vs-amount knobs are pre-resolved. |
tax | number | sólo lectura | IVA added on top when the negocio displays prices pre-tax; 0 when prices already include tax. Either way `total` already incorporates it. |
total | number | sólo lectura | Final amount due. Always = max(0, subtotal − discount + surcharge) + tax. |
items | OrderItemRead[] | sólo lectura | |
shipping_address | Address | sólo lectura | Currently never populated. |
