> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fire.rest/llms.txt
> Use this file to discover all available pages before exploring further.

# Inyectar orden

> Inyecta una orden en Fire. Fire gestiona el ciclo de vida de la orden y envía actualizaciones de estado de vuelta vía webhooks.

<ParamField header="Authorization" type="string" required>
  Token Bearer obtenido desde [POST /login](/es/api-reference/login). Formato: `Bearer <accessToken>`.
</ParamField>

<ParamField header="x-api-key" type="string" required>
  Tu API key de Fire.
</ParamField>

<ParamField header="x-client-channel" type="string" required>
  Debe ser `integration`. Identifica la petición como proveniente de una integración externa.
</ParamField>

<ParamField header="account" type="string" required>
  Identificador de la cuenta a la que pertenece la petición.
</ParamField>

<ParamField body="orderId" type="string" required>
  Identificador único de la orden en tu sistema.
</ParamField>

<ParamField body="source" type="string" required>
  Origen de la orden. Ejemplos: `App`, `Kiosco`.
</ParamField>

<ParamField body="platform" type="string">
  Plataforma del cliente. Ejemplos: `Android`, `iOS`, `Web`.
</ParamField>

<ParamField body="channel" type="object" required>
  Detalles del canal de venta. Usa valores `uid` de los webhooks de publicación (por ejemplo [`channel.updated`](/es/webhook-reference/channel-updated)) o de la configuración de canales en el panel ([Integraciones de agregadores](/es/configuration/backoffice-integrations)).

  <Expandable title="channel">
    <ParamField body="uid" type="string" required>UID del canal en Fire.</ParamField>

    <ParamField body="code" type="string" required>
      Código del tipo de canal. Uno de: `POS`, `Kiosk`, `App`, `Web`, `CallCenter`, `Aggregator`.
    </ParamField>

    <ParamField body="metadata" type="object">Metadata adicional del canal.</ParamField>
  </Expandable>
</ParamField>

<ParamField body="service" type="object" required>
  Detalles del servicio de fulfillment. Usa valores `uid` del array `services` en esos payloads de canal o las mismas fuentes que `channel`.

  <Expandable title="service">
    <ParamField body="uid" type="string" required>UID del servicio en Fire.</ParamField>

    <ParamField body="code" type="string" required>
      Código del tipo de fulfillment. Uno de: `DELIVERY`, `TAKEAWAY`, `PICKUP`, `DINE_IN`.
    </ParamField>

    <ParamField body="metadata" type="object">Metadata adicional del servicio.</ParamField>
  </Expandable>
</ParamField>

<ParamField body="device" type="object">
  Detalles del dispositivo. `null` para canales sin dispositivo físico.

  <Expandable title="device">
    <ParamField body="uid" type="string">UID del dispositivo.</ParamField>
    <ParamField body="name" type="string">Nombre para mostrar del dispositivo (p. ej. `KIOSK`).</ParamField>
    <ParamField body="platform" type="string">Plataforma del dispositivo (p. ej. `android`, `ios`).</ParamField>
    <ParamField body="metadata" type="object">Metadata adicional del dispositivo.</ParamField>

    <ParamField body="externalId" type="string">
      Punto de emisión fiscal del dispositivo. Solo se usa al
      [solicitar el documento fiscal](/es/api-reference/fiscal-documents); acá se acepta e ignora.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="fiscal" type="object">
  Resultado de [Solicitar documento fiscal](/es/api-reference/fiscal-documents), copiado tal
  cual. Opcional: si no fiscalizaste antes de inyectar, omitilo — Fire resuelve la
  fiscalización por su cuenta.

  Fire toma de acá los datos del comprobante para la orden e ignora el resto. El estado del
  documento ante el ente lo maneja Fire: `documentStatus` se ignora si viene.
</ParamField>

<ParamField body="operator" type="object">
  Operador o cajero que procesó la orden. `null` para canales de autoservicio.

  <Expandable title="operator">
    <ParamField body="uid" type="string">UID del operador.</ParamField>
    <ParamField body="name" type="string">Nombre para mostrar del operador.</ParamField>

    <ParamField body="session" type="object">
      Detalles de la sesión activa.

      <Expandable title="session">
        <ParamField body="uid" type="string">UID de la sesión.</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="metadata" type="object">Metadata adicional del operador.</ParamField>
  </Expandable>
</ParamField>

<ParamField body="selectedShippingMethod" type="string" required>
  Método de envío seleccionado por el cliente. Valores: `delivery`, `pickup`.
</ParamField>

<ParamField body="accumulatePoints" type="boolean">
  Indica si el cliente acumula puntos de fidelidad en esta orden.
</ParamField>

<ParamField body="redeemPoints" type="boolean">
  Indica si el cliente canjea puntos de fidelidad en esta orden.
</ParamField>

<ParamField body="discount" type="boolean">
  Indica si se aplican descuentos en esta orden.
</ParamField>

<ParamField body="orderComment" type="string">
  Comentario general del cliente para toda la orden.
</ParamField>

<ParamField body="client" type="object" required>
  Información del cliente.

  <Expandable title="client">
    <ParamField body="uid" type="string">
      Identificador único del cliente desde el proveedor de autenticación.
    </ParamField>

    <ParamField body="name" type="string" required>
      Nombre.
    </ParamField>

    <ParamField body="lastName" type="string">
      Apellido.
    </ParamField>

    <ParamField body="phone" type="string">
      Número de teléfono.
    </ParamField>

    <ParamField body="email" type="string">
      Correo electrónico.
    </ParamField>

    <ParamField body="govIdType" type="string">
      Tipo de documento. Ejemplo: `DNI`, `CI`.
    </ParamField>

    <ParamField body="govIdNumber" type="string">
      Número de documento.
    </ParamField>

    <ParamField body="externalId" type="string">
      ID del cliente en un sistema externo.
    </ParamField>

    <ParamField body="id" type="string">
      ID del cliente en Fire.
    </ParamField>

    <ParamField body="billingInformation" type="object">
      Datos de facturación.

      <Expandable title="billingInformation">
        <ParamField body="businessName" type="string">Razón social o nombre de la persona para la factura.</ParamField>
        <ParamField body="govIdType" type="string">Tipo de documento para facturación.</ParamField>
        <ParamField body="govIdNumber" type="string">Número de documento para facturación.</ParamField>
        <ParamField body="phone" type="string">Teléfono de facturación.</ParamField>
        <ParamField body="email" type="string">Email de facturación.</ParamField>
        <ParamField body="address" type="string">Dirección de facturación.</ParamField>
        <ParamField body="externalId" type="string">ID de facturación en un sistema externo.</ParamField>
        <ParamField body="id" type="string">ID de facturación en Fire.</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="additional_info" type="object">
      Datos adicionales del cliente (p. ej. fecha de nacimiento, género).
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="store" type="object" required>
  Tienda donde se realiza la orden.

  <Expandable title="store">
    <ParamField body="id" type="integer" required>ID de la tienda.</ParamField>
    <ParamField body="name" type="string">Nombre para mostrar de la tienda.</ParamField>
    <ParamField body="code" type="string">Código de la tienda.</ParamField>
    <ParamField body="vendorId" type="integer">Identificador de la marca.</ParamField>
    <ParamField body="vendorName" type="string">Nombre de la marca.</ParamField>
    <ParamField body="latitude" type="string">Latitud de la tienda.</ParamField>
    <ParamField body="longitude" type="string">Longitud de la tienda.</ParamField>
  </Expandable>
</ParamField>

<ParamField body="order" type="object" required>
  Contenido de la orden.

  <Expandable title="order">
    <ParamField body="products" type="object[]" required>
      Productos pedidos.

      <Expandable title="products[n]">
        <ParamField body="productId" type="string" required>Identificador del producto.</ParamField>
        <ParamField body="product" type="string">Nombre para mostrar del producto.</ParamField>

        <ParamField body="type" type="string" required>
          Tipo de ítem. Valores aceptados: `COMBO` (producto con grupos de modificadores no vacíos), `PRODUCT` (producto simple vendible), `MODIFIER` (opción de modificador puro — usar en `selectedModifiers[]`), `PACKAGING` (ítem de empaque). Sin valor por defecto — omitirlo hace el payload inválido.
        </ParamField>

        <ParamField body="quantity" type="integer" required>Cantidad pedida.</ParamField>
        <ParamField body="comment" type="string">Opcional. Comentario del cliente para esta línea de producto.</ParamField>
        <ParamField body="rewardId" type="string">Recompensa o cupón aplicado a este producto.</ParamField>

        <ParamField body="price" type="object">
          Desglose de precio de esta línea. Los modificadores usan la misma forma en `modifierGroups[n].selectedModifiers[n].price`.

          <Expandable title="price">
            <ParamField body="unitPrice" type="object">
              Importes por **una unidad** (antes de multiplicar por `quantity`).

              <Expandable title="unitPrice">
                <ParamField body="currencyCode" type="string" required>Código de moneda ISO 4217 (p. ej. `BRL`, `USD`).</ParamField>
                <ParamField body="totalBeforeSale" type="string">Opcional. Precio antes de precios promocionales.</ParamField>
                <ParamField body="subtotalWithoutTaxes" type="string">Subtotal sin impuestos. En JSON puede venir como número o como cadena.</ParamField>
                <ParamField body="discountPercentage" type="string">Porcentaje de descuento aplicado.</ParamField>
                <ParamField body="discountsValue" type="string">Importe del descuento.</ParamField>
                <ParamField body="subtotalIncludeDiscounts" type="string">Subtotal tras descuentos, antes de impuestos.</ParamField>
                <ParamField body="taxesPercentage" type="string">Porcentaje global de impuesto del tramo.</ParamField>
                <ParamField body="taxValue" type="string">Importe de impuesto del tramo.</ParamField>
                <ParamField body="total" type="string">Total final del tramo.</ParamField>
                <ParamField body="suggestedPrice" type="string">Precio de lista sugerido.</ParamField>

                <ParamField body="taxes" type="object[]">
                  Desglose por impuesto (p. ej. `IVA`, o ICMS, PIS, COFINS en Brasil). Las entradas pueden omitir `metadata` si no aplica.

                  <Expandable title="taxes[n]">
                    <ParamField body="name" type="string" required>Código o etiqueta del impuesto (p. ej. `IVA`, `icms`, `pis`, `cofins`).</ParamField>
                    <ParamField body="rate" type="string">Alícuota de esta línea (a menudo cadena decimal como `0.00`).</ParamField>
                    <ParamField body="amount" type="string">Importe del impuesto en esta línea.</ParamField>
                    <ParamField body="metadata" type="object">Opcional. Campos fiscales por región (p. ej. `cst` para ICMS).</ParamField>
                  </Expandable>
                </ParamField>
              </Expandable>
            </ParamField>

            <ParamField body="totalPrice" type="object">
              Mismas claves que `unitPrice`. Representa la **línea completa** (habitualmente valores unitarios escalados por `quantity`). Incluye la misma forma de `taxes[]` cuando la API devuelve detalle fiscal por línea.
            </ParamField>
          </Expandable>
        </ParamField>

        <ParamField body="modifierGroups" type="object[]">
          Grupos de modificadores seleccionados.

          <Expandable title="modifierGroups[n]">
            <ParamField body="id" type="string">ID del grupo de modificadores.</ParamField>
            <ParamField body="description" type="string">Descripción del grupo de modificadores.</ParamField>

            <ParamField body="selectedModifiers" type="object[]">
              Opciones de modificador elegidas.

              <Expandable title="selectedModifiers[n]">
                <ParamField body="answerId" type="string">ID de la respuesta/opción.</ParamField>
                <ParamField body="productId" type="string">Producto usado como esta opción de modificador.</ParamField>
                <ParamField body="product" type="string">Nombre de la opción de modificador.</ParamField>

                <ParamField body="type" type="string" required>
                  Tipo de ítem. Valores aceptados: `COMBO` (producto con grupos de modificadores no vacíos), `PRODUCT` (producto vendible usado como opción de modificador), `MODIFIER` (opción de modificador puro), `PACKAGING` (ítem de empaque). Sin valor por defecto — omitirlo hace el payload inválido.
                </ParamField>

                <ParamField body="quantity" type="integer">Cantidad agregada.</ParamField>
                <ParamField body="removedQuantity" type="integer">Cantidad removida (para quitar ingredientes).</ParamField>
                <ParamField body="rewardId" type="string">Recompensa aplicada a este modificador.</ParamField>
                <ParamField body="price" type="object">Precio del modificador. Misma estructura que el precio del producto.</ParamField>
                <ParamField body="modifierGroups" type="object[]">Grupos de modificadores anidados (hasta 3 niveles).</ParamField>
                <ParamField body="additional_info" type="object">Datos del campo `additionalInfo` del menú. Incluye el valor tal como se recibe en el payload del webhook de menú.</ParamField>
              </Expandable>
            </ParamField>
          </Expandable>
        </ParamField>

        <ParamField body="additional_info" type="object">Datos del campo `additionalInfo` del menú. Incluye el valor tal como se recibe en el payload del webhook de menú.</ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="shippingMethod" type="object" required>
  Detalles del envío según `selectedShippingMethod`.

  <Expandable title="shippingMethod">
    <ParamField body="delivery" type="object">
      Detalles de delivery. Presente cuando `selectedShippingMethod` es `delivery`.

      <Expandable title="delivery">
        <ParamField body="deliveryDate" type="string">Fecha/hora estimada de entrega.</ParamField>
        <ParamField body="latitude" type="string">Latitud de la dirección de entrega.</ParamField>
        <ParamField body="longitude" type="string">Longitud de la dirección de entrega.</ParamField>
        <ParamField body="country" type="string">País.</ParamField>
        <ParamField body="city" type="string">Ciudad.</ParamField>
        <ParamField body="mainStreet" type="string">Calle principal.</ParamField>
        <ParamField body="number" type="string">Número de la calle.</ParamField>
        <ParamField body="secondaryStreet" type="string">Calle secundaria o transversal.</ParamField>
        <ParamField body="reference" type="string">Referencia o punto de referencia para la entrega.</ParamField>
        <ParamField body="propertyId" type="integer">ID del tipo de inmueble.</ParamField>
        <ParamField body="observationsAddress" type="string">Instrucciones de entrega.</ParamField>
        <ParamField body="numberContactAddress" type="string">Número de contacto en la dirección de entrega.</ParamField>
        <ParamField body="zipCode" type="string">Código postal.</ParamField>
        <ParamField body="nickName" type="string">Alias de la dirección (p. ej. "casa", "oficina").</ParamField>
        <ParamField body="externalId" type="string">ID de la dirección en un sistema externo.</ParamField>
        <ParamField body="id" type="string">ID de la dirección en Fire.</ParamField>
        <ParamField body="driverArrivalDateInStore" type="string">Timestamp ISO 8601 de la llegada del conductor a la tienda.</ParamField>

        <ParamField body="additional_info" type="object">
          Datos adicionales de la entrega.

          <Expandable title="additionalInfo">
            <ParamField body="deliveryConfirmationCode" type="string">Opcional. Código de confirmación para verificar la entrega en la puerta.</ParamField>
          </Expandable>
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="pickup" type="object">
      Detalles de pickup. Presente cuando `selectedShippingMethod` es `pickup`.

      <Expandable title="pickup">
        <ParamField body="pickupDate" type="string">Fecha/hora programada del pickup.</ParamField>
        <ParamField body="prepDate" type="string">Fecha/hora de inicio de preparación.</ParamField>
        <ParamField body="prepTimeUnit" type="string">Unidad del tiempo de preparación. Ejemplo: `minute`.</ParamField>
        <ParamField body="prepTime" type="integer">Valor del tiempo de preparación.</ParamField>
        <ParamField body="propertyId" type="integer">ID del tipo de inmueble.</ParamField>
        <ParamField body="carryOutOptions" type="string">Etiqueta de la opción de retiro.</ParamField>

        <ParamField body="contactMethods" type="object[]">
          Métodos de contacto para la notificación de pickup.

          <Expandable title="contactMethods[n]">
            <ParamField body="type" type="string">Tipo de contacto: `pager`, `sms`, `whatsapp`.</ParamField>
            <ParamField body="identifier" type="string">Identificador (para pager).</ParamField>
            <ParamField body="countryCode" type="string">Código de país del teléfono.</ParamField>
            <ParamField body="phoneNumber" type="string">Número de teléfono.</ParamField>
          </Expandable>
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="payments" type="object" required>
  Desglose de pagos.

  <Expandable title="payments">
    <ParamField body="totals" type="object[]">
      Totales de la orden con desglose de impuestos y descuentos. Cada entrada es un objeto price con `currencyCode`, `subtotalWithoutTaxes`, `discountPercentage`, `discountsValue`, `subtotalIncludeDiscounts`, `taxesPercentage`, `taxValue`, `total` y opcionalmente `rewardId`.
    </ParamField>

    <ParamField body="shippingCost" type="object[]">
      Líneas de costo de envío. Cada entrada usa la **misma forma de tramo de precio** que `totals[]`—envía el costo ya calculado (base, impuesto y `total`). Fire almacena los valores tal cual. Consulta [Envío y descuentos](#envío-y-descuentos).

      <Expandable title="shippingCost[n]">
        <ParamField body="currencyCode" type="string">Código de moneda ISO 4217.</ParamField>
        <ParamField body="subtotalWithoutTaxes" type="string">Monto antes de impuestos.</ParamField>
        <ParamField body="discountPercentage" type="string">Porcentaje de descuento aplicado a esta línea.</ParamField>
        <ParamField body="discountsValue" type="string">Importe del descuento.</ParamField>
        <ParamField body="subtotalIncludeDiscounts" type="string">Subtotal tras descuentos, antes de impuestos.</ParamField>
        <ParamField body="taxesPercentage" type="string">Porcentaje de impuesto aplicado.</ParamField>
        <ParamField body="taxValue" type="string">Importe del impuesto.</ParamField>
        <ParamField body="total" type="string">Total de la línea con impuestos.</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="extraCharges" type="object[]">
      Cargos adicionales como propinas o costos de empaque.

      <Expandable title="extraCharges[n]">
        <ParamField body="type" type="string" required>
          Tipo de ítem. Valores aceptados: `COMBO` (producto con grupos de modificadores no vacíos), `PRODUCT` (producto simple vendible), `MODIFIER` (opción de modificador puro), `PACKAGING` (ítem de empaque). Habitualmente `PACKAGING` para ítems en este array. Sin valor por defecto — omitirlo hace el payload inválido.
        </ParamField>

        <ParamField body="quantity" type="integer">Cantidad.</ParamField>
        <ParamField body="productId" type="string">ID de producto asociado, si aplica.</ParamField>
        <ParamField body="description" type="string">Descripción del cargo (p. ej. `tip`, `packing cost`).</ParamField>
        <ParamField body="currencyCode" type="string">Código de moneda.</ParamField>
        <ParamField body="subtotalWithoutTaxes" type="string">Monto antes de impuestos.</ParamField>
        <ParamField body="taxValue" type="string">Monto del impuesto.</ParamField>
        <ParamField body="total" type="string">Total con impuestos incluidos.</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="discounts" type="object[]">
      Filas de descuento a nivel de orden para promos o cupones que **absorbe el local** (el costo corre por cuenta del restaurante). Cada entrada usa los **mismos campos de tramo** que `totals[]` y `shippingCost[]`. `discountsValue` es el importe descontado. **Deja este array vacío para descuentos del agregador** — esos se modelan como una entrada en `paymentMethods[]`. Consulta [Descuentos del agregador](#descuentos-del-agregador).

      <Expandable title="discounts[n]">
        <ParamField body="currencyCode" type="string">Código de moneda ISO 4217.</ParamField>
        <ParamField body="subtotalWithoutTaxes" type="string">Base imponible antes del descuento.</ParamField>
        <ParamField body="discountPercentage" type="string">Porcentaje de descuento en esta línea.</ParamField>
        <ParamField body="discountsValue" type="string">Importe descontado.</ParamField>
        <ParamField body="subtotalIncludeDiscounts" type="string">Subtotal tras el descuento, antes de impuestos.</ParamField>
        <ParamField body="taxesPercentage" type="string">Porcentaje de impuesto aplicado tras el descuento.</ParamField>
        <ParamField body="taxValue" type="string">Importe del impuesto.</ParamField>
        <ParamField body="total" type="string">Total de la línea con impuestos.</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="taxes" type="object[]">
      Resumen de impuestos.

      <Expandable title="taxes[n]">
        <ParamField body="name" type="string">Nombre del impuesto (p. ej. `IVA 15%`).</ParamField>
        <ParamField body="currencyCode" type="string">Código de moneda.</ParamField>
        <ParamField body="subtotalWithoutTaxes" type="string">Base imponible.</ParamField>
        <ParamField body="percentage" type="string">Porcentaje de impuesto.</ParamField>
        <ParamField body="total" type="string">Monto total del impuesto.</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="paymentMethods" type="object[]">
      Métodos de pago utilizados.

      <Expandable title="paymentMethods[n]">
        <ParamField body="processor" type="string">Nombre del procesador de pagos (p. ej. `Kushki`, `Efectivo`).</ParamField>
        <ParamField body="currencyCode" type="string">Código de moneda.</ParamField>
        <ParamField body="paymentMethodCode" type="string">Código del método de pago. Usa `AGGREGATOR_DISCOUNT` cuando el agregador cubre un descuento promocional y reembolsa al local — siempre va acompañado de `transactionType: "BENEFIT"`. Consulta [Descuentos del agregador](#descuentos-del-agregador).</ParamField>
        <ParamField body="transactionType" type="string">Tipo de transacción. Valores habituales: `ONLINE`, `CREDIT`, `CASH`. Usa `BENEFIT` cuando `paymentMethodCode` es `AGGREGATOR_DISCOUNT`.</ParamField>
        <ParamField body="transactionId" type="string">Identificador de la transacción.</ParamField>
        <ParamField body="transactionStatus" type="string">Estado de la transacción (p. ej. `APPROVED`).</ParamField>
        <ParamField body="exactPayment" type="boolean">Indica si se entregó el monto exacto.</ParamField>
        <ParamField body="totalBill" type="string">Monto cobrado con este método.</ParamField>
        <ParamField body="id_auth" type="string | null">Número de autorización NFCE (código SiTef 952 / IdAuth). Opcional.</ParamField>
        <ParamField body="receipt_customer" type="string | null">Vía del cliente: texto del comprobante impreso para el portador (código SiTef 121 / ReceiptCustomer). Opcional.</ParamField>
        <ParamField body="receipt_merchant" type="string | null">Vía del comercio: texto del comprobante impreso para el establecimiento (código SiTef 122 / ReceiptMerchant). Opcional.</ParamField>

        <ParamField body="acquirer" type="object | null">
          Datos del banco adquirente. Envía `null` para métodos de pago sin credenciadora.

          <Expandable title="acquirer">
            <ParamField body="code" type="string">Código de la credenciadora.</ParamField>
            <ParamField body="name" type="string">Nombre de la credenciadora.</ParamField>
            <ParamField body="cnpj" type="string">CNPJ de la credenciadora para NFCE (código SiTef 950 / CNPJAuth). Opcional.</ParamField>
          </Expandable>
        </ParamField>

        <ParamField body="card" type="object | null">
          Datos de la tarjeta. Envía `null` para métodos sin tarjeta (p. ej. `AGGREGATOR_DISCOUNT`).

          <Expandable title="card">
            <ParamField body="brand" type="string">Marca de la tarjeta (p. ej. `VISA`, `MASTERCARD`, `AMEX`).</ParamField>
            <ParamField body="bin" type="string">Primeros 6 dígitos del número de tarjeta (BIN).</ParamField>
            <ParamField body="mask" type="string">Número de tarjeta enmascarado.</ParamField>
            <ParamField body="lastFourDigits" type="string">Últimos 4 dígitos del número de tarjeta.</ParamField>
            <ParamField body="holder" type="string">Nombre del titular.</ParamField>
            <ParamField body="cardCountry" type="string">País de emisión de la tarjeta.</ParamField>
            <ParamField body="externalCardBrandId" type="string">Identificador de marca de tarjeta específico del procesador.</ParamField>
            <ParamField body="media" type="string">Tipo de lectura de la tarjeta (código SiTef 2090 / Media). Valores aceptados: `CHIP`, `MAGNETIC`, `NFC`, `MANUAL`. Opcional.</ParamField>
          </Expandable>
        </ParamField>

        <ParamField body="transactionDate" type="object">Fecha de la transacción con info de zona horaria.</ParamField>
        <ParamField body="metadata" type="object">Metadata específica del procesador.</ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="marketing" type="object">
  Información de fidelidad y cupones.

  <Expandable title="marketing">
    <ParamField body="loyalty" type="object">
      Desglose de acumulación y canje de puntos de fidelidad.

      <Expandable title="loyalty">
        <ParamField body="accumulation" type="object">Puntos ganados: `storeCost`, `marketingCost`, `totalPoints`.</ParamField>
        <ParamField body="redemption" type="object">Puntos canjeados: `storeCost`, `marketingCost`, `totalPoints`.</ParamField>
        <ParamField body="accountBalancePoints" type="string">Saldo de puntos actual del cliente.</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="coupons" type="object[]">
      Cupones y recompensas aplicadas.

      <Expandable title="coupons[n]">
        <ParamField body="rewardId" type="string">Identificador de la recompensa.</ParamField>
        <ParamField body="name" type="string">Nombre para mostrar de la recompensa.</ParamField>
        <ParamField body="additional_info" type="object">Datos adicionales de la recompensa.</ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="additional_info" type="object">
  Metadata extra a nivel de orden (p. ej. dirección IP del kiosko).
</ParamField>

## Montos y tramos de precio

<Warning>
  Fire **no** escala ni recalcula precios. Envía los montos en la **unidad final de la moneda** (por ejemplo `"8.99"` para USD 8.99, no centavos). Tu POS o agregador debe enviar valores ya calculados.
</Warning>

Las líneas de producto, `payments.totals[]`, `payments.shippingCost[]` y `payments.discounts[]` usan las mismas claves de **tramo de precio**: `currencyCode`, `subtotalWithoutTaxes`, `discountPercentage`, `discountsValue`, `subtotalIncludeDiscounts`, `taxesPercentage`, `taxValue`, `total`.

| Campo del tramo            | Significado habitual                           |
| -------------------------- | ---------------------------------------------- |
| `subtotalWithoutTaxes`     | Base imponible antes del descuento de la línea |
| `discountsValue`           | Importe del descuento en esta línea            |
| `subtotalIncludeDiscounts` | Base tras el descuento, antes de impuestos     |
| `taxValue`                 | Impuesto sobre la base con descuento           |
| `total`                    | Total de la línea tal como se almacena         |

## Envío y descuentos

### Descuentos por producto

Aplica descuentos en `order.products[n].price.unitPrice` y `totalPrice` (mismos valores cuando `quantity` es 1). Ejemplo: **10% de descuento** sobre base **15.00** con **IVA 12%** → `discountsValue` **1.50**, `subtotalIncludeDiscounts` **13.50**, `taxValue` **1.62**, `total` de línea **15.12**.

### `payments.shippingCost[]`

Costos de envío como una o más filas con tramo de precio. En los ejemplos, el impuesto del envío se calcula sobre la base de envío igual que en los productos.

### `payments.discounts[]`

Descuentos a nivel de orden (promos, cupones) como filas de tramo de precio. Úsalo cuando el descuento **no** esté ya reflejado en el `discountsValue` de cada producto y el costo lo **asume el local**. Puedes combinar descuentos de producto y `payments.discounts[]`; concilia con `paymentMethods[].totalBill`.

### `payments.totals[]`

Resumen de la parte de **productos** de la orden. Al conciliar: **productos (totals) + envío − descuentos de orden ≈ monto pagado**.

<Note>
  Fire no rechaza la petición si `paymentMethods[].totalBill` difiere levemente de la suma de tramos; aun así envía valores coherentes desde tu sistema origen.
</Note>

## Descuentos de combo

Cuando un producto combo tiene **precio contenedor 0** (es decir, `type: "COMBO"` con `subtotalWithoutTaxes: 0`), el descuento del combo **no debe colocarse** en la línea del contenedor. Asignar `discountsValue` a una base cero produce totales negativos, que Fire rechaza.

En su lugar, **distribuye el monto total del descuento entre los `selectedModifiers`** que componen el combo.

### Reglas

| Regla                            | Detalle                                                                                                                                  |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| Contenedor COMBO (`price === 0`) | Todos los campos de precio deben ser `0` — sin `discountsValue`, sin valores negativos                                                   |
| Ubicación del descuento          | Repartir `discountsValue` entre los modificadores proporcionalmente a su precio base                                                     |
| Restricción no negativa          | Tras aplicar el descuento, cada modificador debe tener `subtotalIncludeDiscounts >= 0` y `total >= 0`                                    |
| Cuadre de totales                | `SUM(modifier.totalPrice.discountsValue)` debe igualar el descuento total del combo, y las sumas deben coincidir con `payments.totals[]` |

### Algoritmo de reparto

```
D = descuento total del combo
B = SUM(modifier.price.totalPrice.subtotalWithoutTaxes)

discount_i = ROUND(D × (base_i / B), 2)
net_i      = base_i − discount_i        // debe ser >= 0
```

Ajustar el redondeo en el último modificador para que `SUM(discount_i) === D` exacto. Si el reparto proporcional dejaría algún modificador con `net_i < 0`, capar el descuento de ese ítem a su base (`discount_i = base_i`, neto = 0) y redistribuir el remanente entre los demás.

### Ejemplo — descuento BRL 17,94 sobre un combo (base BRL 89,68)

<Warning>
  A continuación se muestra el patrón **incorrecto** (descuento en el contenedor) y el patrón **correcto** (descuento repartido entre modificadores).
</Warning>

```json Incorrecto — descuento en COMBO con base cero (totales negativos) theme={null}
{
  "type": "COMBO",
  "price": {
    "unitPrice": {
      "subtotalWithoutTaxes": "0",
      "discountsValue": "17.94",
      "subtotalIncludeDiscounts": "-17.94",
      "total": "-17.94"
    }
  }
}
```

```json Correcto — contenedor COMBO en cero, descuento en modificadores theme={null}
{
  "type": "COMBO",
  "price": {
    "unitPrice":  { "subtotalWithoutTaxes": "0", "discountsValue": "0", "subtotalIncludeDiscounts": "0", "total": "0" },
    "totalPrice": { "subtotalWithoutTaxes": "0", "discountsValue": "0", "subtotalIncludeDiscounts": "0", "total": "0" }
  },
  "modifierGroups": [
    {
      "selectedModifiers": [
        {
          "product": "12 Coxinhas da Asa",
          "type": "MODIFIER",
          "price": {
            "unitPrice":  { "subtotalWithoutTaxes": "22.30", "discountsValue": "4.46", "subtotalIncludeDiscounts": "17.84", "total": "17.84" },
            "totalPrice": { "subtotalWithoutTaxes": "22.30", "discountsValue": "4.46", "subtotalIncludeDiscounts": "17.84", "total": "17.84" }
          }
        },
        {
          "product": "Batata Média",
          "type": "MODIFIER",
          "price": {
            "unitPrice":  { "subtotalWithoutTaxes": "4.59", "discountsValue": "0.92", "subtotalIncludeDiscounts": "3.67", "total": "3.67" },
            "totalPrice": { "subtotalWithoutTaxes": "4.59", "discountsValue": "0.92", "subtotalIncludeDiscounts": "3.67", "total": "3.67" }
          }
        }
      ]
    }
  ]
}
```

Desglose completo para este ejemplo (los 7 modificadores):

| Modificador          |      Base | `discountsValue` |      Neto |
| -------------------- | --------: | ---------------: | --------: |
| 12 Coxinhas da Asa   |     22,30 |             4,46 |     17,84 |
| Batata Média         |      4,59 |             0,92 |      3,67 |
| Onion Rings          |      7,50 |             1,50 |      6,00 |
| Batata Grande        |      6,50 |             1,30 |      5,20 |
| Molho Secreto 120g   |      4,09 |             0,82 |      3,27 |
| Água sem Gás (×2)    |     29,80 |             5,96 |     23,84 |
| Água com gás         |     14,90 |             2,98 |     11,92 |
| **Contenedor COMBO** |     **0** |            **0** |     **0** |
| **Total**            | **89,68** |        **17,94** | **71,74** |

`payments.totals[0].subtotalWithoutTaxes` = **89,68**, `subtotalIncludeDiscounts` = **71,74** ✓

## Descuentos del agregador

Cuando la plataforma del agregador (iFood, Rappi, UberEats, etc.) aplica un descuento promocional al cliente, el **agregador reembolsa al local** ese monto — el local siempre recibe el precio completo. Por eso el descuento no resta de los ingresos del local y **no debe aparecer en `payments.discounts[]`**.

Modélalo como una entrada adicional en `payments.paymentMethods[]`:

| Quién paga       | Qué                                                        | Cómo modelarlo                                                          |
| ---------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------- |
| Cliente          | Productos + envío + cargos extra − descuento del agregador | `paymentMethods[n]` con el código de pago real (`CREDIT`, `CASH`, etc.) |
| Agregador        | Monto del descuento (reembolso al local)                   | `paymentMethods[n]` con `paymentMethodCode: "AGGREGATOR_DISCOUNT"`      |
| **Local recibe** | **Productos + envío + cargos extra completos**             | —                                                                       |

### Campos requeridos en la entrada `AGGREGATOR_DISCOUNT`

| Campo               | Valor                                                                |
| ------------------- | -------------------------------------------------------------------- |
| `paymentMethodCode` | `"AGGREGATOR_DISCOUNT"` — el mismo código para todos los agregadores |
| `processor`         | Nombre del agregador: `"IFOOD"`, `"RAPPI"`, `"UBEREATS"`, …          |
| `transactionType`   | `"BENEFIT"`                                                          |
| `transactionStatus` | `"APPROVED"`                                                         |
| `card`              | `null`                                                               |
| `totalBill`         | Monto del descuento                                                  |

### Regla de balance

La suma de **todos** los `paymentMethods[].totalBill` — incluida la entrada `AGGREGATOR_DISCOUNT` — debe ser igual al total bruto de la orden:

```
SUM(paymentMethods[].totalBill)
  = SUM(order.products[].price.totalPrice.total)
  + SUM(payments.extraCharges[].total)
  + SUM(payments.shippingCost[].total)
```

`payments.discounts[]` queda **vacío**.

<RequestExample>
  ```json Entrega simple (sin descuentos) theme={null}
  {
    "orderId": "AGG-SIMPLE-001",
    "source": "App",
    "platform": "Android",
    "channel": { "uid": "CH-IFOOD-001", "code": "Aggregator", "metadata": {} },
    "service": { "uid": "3", "code": "DELIVERY", "metadata": {} },
    "selectedShippingMethod": "delivery",
    "client": { "name": "Jane", "lastName": "Doe", "phone": "+1555000111" },
    "store": { "id": 10, "name": "Gran Santa Fe", "code": "T001", "vendorId": 8 },
    "order": {
      "products": [
        {
          "productId": "991117",
          "product": "Classic Burger",
          "type": "PRODUCT",
          "quantity": 1,
          "price": {
            "unitPrice": {
              "currencyCode": "USD",
              "subtotalWithoutTaxes": "7.7826",
              "discountPercentage": "0.0000",
              "discountsValue": "0.0000",
              "subtotalIncludeDiscounts": "7.7826",
              "taxesPercentage": "15.0000",
              "taxValue": "1.1739",
              "total": "8.9900"
            },
            "totalPrice": {
              "currencyCode": "USD",
              "subtotalWithoutTaxes": "7.7826",
              "discountPercentage": "0.0000",
              "discountsValue": "0.0000",
              "subtotalIncludeDiscounts": "7.7826",
              "taxesPercentage": "15.0000",
              "taxValue": "1.1739",
              "total": "8.9900"
            }
          },
          "additional_info": { "externalCode": "burger-classic-ext-001" }
        }
      ]
    },
    "shippingMethod": {
      "delivery": {
        "city": "Guayaquil",
        "mainStreet": "Av. Principal 123",
        "zipCode": "090101",
        "additional_info": {
          "deliveryConfirmationCode": "4821"
        }
      }
    },
    "payments": {
      "totals": [
        {
          "currencyCode": "USD",
          "subtotalWithoutTaxes": "7.7826",
          "discountPercentage": "0.0000",
          "discountsValue": "0.0000",
          "subtotalIncludeDiscounts": "7.7826",
          "taxesPercentage": "15.0000",
          "taxValue": "1.1739",
          "total": "8.9900"
        }
      ],
      "shippingCost": [
        {
          "currencyCode": "USD",
          "subtotalWithoutTaxes": "1.5000",
          "discountPercentage": "0.0000",
          "discountsValue": "0.0000",
          "subtotalIncludeDiscounts": "1.5000",
          "taxesPercentage": "15.0000",
          "taxValue": "0.2250",
          "total": "1.7250"
        }
      ],
      "discounts": [],
      "paymentMethods": [
        {
          "processor": "Kushki",
          "currencyCode": "USD",
          "transactionStatus": "APPROVED",
          "totalBill": "10.7150"
        }
      ]
    }
  }
  ```

  ```json Descuento en línea y envío theme={null}
  {
    "orderId": "AGG-DISC-LINE-001",
    "source": "Kiosco",
    "platform": "Android",
    "channel": { "uid": "CH-KIOSK-001", "code": "Kiosk", "metadata": {} },
    "service": { "uid": "3", "code": "DELIVERY", "metadata": {} },
    "selectedShippingMethod": "delivery",
    "client": { "name": "Maria", "phone": "+5511999999999" },
    "store": { "id": 20, "name": "Centro", "code": "T020", "vendorId": 16 },
    "order": {
      "products": [
        {
          "productId": "SKU-COMBO-001",
          "product": "Combo Especial",
          "type": "COMBO",
          "quantity": 1,
          "comment": "Sin cebolla",
          "price": {
            "unitPrice": {
              "currencyCode": "BRL",
              "subtotalWithoutTaxes": "15.00",
              "discountPercentage": "10.0000",
              "discountsValue": "1.50",
              "subtotalIncludeDiscounts": "13.50",
              "taxesPercentage": "12.0000",
              "taxValue": "1.62",
              "total": "15.12"
            },
            "totalPrice": {
              "currencyCode": "BRL",
              "subtotalWithoutTaxes": "15.00",
              "discountPercentage": "10.0000",
              "discountsValue": "1.50",
              "subtotalIncludeDiscounts": "13.50",
              "taxesPercentage": "12.0000",
              "taxValue": "1.62",
              "total": "15.12"
            }
          },
          "modifierGroups": [
            {
              "id": "MG-SAUCE-001",
              "description": "Salsa",
              "selectedModifiers": [
                {
                  "answerId": "ANS-BBQ-001",
                  "productId": "MOD-BBQ-001",
                  "product": "Salsa BBQ",
                  "type": "MODIFIER",
                  "quantity": 1,
                  "additional_info": { "externalCode": "sauce-bbq-ext-001" }
                }
              ]
            }
          ],
          "additional_info": { "externalCode": "combo-especial-ext-001" }
        }
      ]
    },
    "shippingMethod": {
      "delivery": {
        "city": "São Paulo",
        "mainStreet": "Rua Exemplo 100",
        "zipCode": "01310-100"
      }
    },
    "payments": {
      "totals": [
        {
          "currencyCode": "BRL",
          "subtotalWithoutTaxes": "15.00",
          "discountPercentage": "10.0000",
          "discountsValue": "1.50",
          "subtotalIncludeDiscounts": "13.50",
          "taxesPercentage": "12.0000",
          "taxValue": "1.62",
          "total": "15.12"
        }
      ],
      "shippingCost": [
        {
          "currencyCode": "BRL",
          "subtotalWithoutTaxes": "3.50",
          "discountPercentage": "0.0000",
          "discountsValue": "0.0000",
          "subtotalIncludeDiscounts": "3.50",
          "taxesPercentage": "12.0000",
          "taxValue": "0.42",
          "total": "3.92"
        }
      ],
      "discounts": [],
      "paymentMethods": [
        {
          "processor": "CREDIT_CARD",
          "currencyCode": "BRL",
          "transactionStatus": "APPROVED",
          "totalBill": "19.04"
        }
      ]
    }
  }
  ```

  ```json Varios productos, envío y descuento de orden theme={null}
  {
    "orderId": "AGG-PROMO-001",
    "source": "Aggregator",
    "channel": { "uid": "CH-AGG-001", "code": "Aggregator", "metadata": {} },
    "service": { "uid": "3", "code": "DELIVERY", "metadata": {} },
    "selectedShippingMethod": "delivery",
    "client": { "name": "João", "lastName": "Silva", "phone": "+5511987654321" },
    "store": { "id": 30, "name": "Lab Brasil", "code": "K000", "vendorId": 8 },
    "order": {
      "products": [
        {
          "productId": "BURG-001",
          "product": "Hamburguesa Clásica",
          "type": "PRODUCT",
          "quantity": 2,
          "price": {
            "unitPrice": {
              "currencyCode": "BRL",
              "subtotalWithoutTaxes": "11.52",
              "discountPercentage": "0.0000",
              "discountsValue": "0.0000",
              "subtotalIncludeDiscounts": "11.52",
              "taxesPercentage": "12.0000",
              "taxValue": "1.38",
              "total": "12.90"
            },
            "totalPrice": {
              "currencyCode": "BRL",
              "subtotalWithoutTaxes": "23.04",
              "discountPercentage": "0.0000",
              "discountsValue": "0.0000",
              "subtotalIncludeDiscounts": "23.04",
              "taxesPercentage": "12.0000",
              "taxValue": "2.76",
              "total": "25.80"
            }
          },
          "additional_info": { "externalCode": "hamburguesa-clasica-ext-001" }
        },
        {
          "productId": "BEV-001",
          "product": "Refresco 500ml",
          "type": "PRODUCT",
          "quantity": 1,
          "price": {
            "unitPrice": {
              "currencyCode": "BRL",
              "subtotalWithoutTaxes": "4.46",
              "discountPercentage": "0.0000",
              "discountsValue": "0.0000",
              "subtotalIncludeDiscounts": "4.46",
              "taxesPercentage": "12.0000",
              "taxValue": "0.54",
              "total": "5.00"
            },
            "totalPrice": {
              "currencyCode": "BRL",
              "subtotalWithoutTaxes": "4.46",
              "discountPercentage": "0.0000",
              "discountsValue": "0.0000",
              "subtotalIncludeDiscounts": "4.46",
              "taxesPercentage": "12.0000",
              "taxValue": "0.54",
              "total": "5.00"
            }
          },
          "additional_info": { "externalCode": "refresco-500ml-ext-001" }
        }
      ]
    },
    "shippingMethod": {
      "delivery": { "city": "São Paulo", "mainStreet": "Av. Paulista 1000" }
    },
    "payments": {
      "totals": [
        {
          "currencyCode": "BRL",
          "subtotalWithoutTaxes": "27.50",
          "discountPercentage": "0.0000",
          "discountsValue": "0.0000",
          "subtotalIncludeDiscounts": "27.50",
          "taxesPercentage": "12.0000",
          "taxValue": "3.30",
          "total": "30.80"
        }
      ],
      "shippingCost": [
        {
          "currencyCode": "BRL",
          "subtotalWithoutTaxes": "3.50",
          "discountPercentage": "0.0000",
          "discountsValue": "0.0000",
          "subtotalIncludeDiscounts": "3.50",
          "taxesPercentage": "0.0000",
          "taxValue": "0.0000",
          "total": "3.50"
        }
      ],
      "discounts": [
        {
          "currencyCode": "BRL",
          "subtotalWithoutTaxes": "34.30",
          "discountPercentage": "0.0000",
          "discountsValue": "2.00",
          "subtotalIncludeDiscounts": "32.30",
          "taxesPercentage": "0.0000",
          "taxValue": "0.0000",
          "total": "2.00"
        }
      ],
      "paymentMethods": [
        {
          "processor": "99",
          "currencyCode": "BRL",
          "transactionStatus": "APPROVED",
          "totalBill": "32.30"
        }
      ]
    }
  }
  ```

  ```json Descuento del agregador (iFood reembolsa BRL 1.00) theme={null}
  {
    "orderId": "AGG-DISC-IFOOD-001",
    "source": "Aggregator",
    "channel": { "uid": "CH-IFOOD-001", "code": "Aggregator", "metadata": {} },
    "service": { "uid": "3", "code": "DELIVERY", "metadata": {} },
    "selectedShippingMethod": "delivery",
    "client": { "name": "João", "lastName": "Silva", "phone": "+5511987654321" },
    "store": { "id": 30, "name": "Lab Brasil", "code": "K000", "vendorId": 8 },
    "order": {
      "products": [
        {
          "productId": "PROD-TESTE-001",
          "product": "PEDIDO DE TESTE Suc",
          "type": "PRODUCT",
          "quantity": 2,
          "price": {
            "unitPrice": {
              "currencyCode": "BRL",
              "subtotalWithoutTaxes": "14.90",
              "discountPercentage": "0.0000",
              "discountsValue": "0.0000",
              "subtotalIncludeDiscounts": "14.90",
              "taxesPercentage": "0.0000",
              "taxValue": "0.0000",
              "total": "14.90"
            },
            "totalPrice": {
              "currencyCode": "BRL",
              "subtotalWithoutTaxes": "29.80",
              "discountPercentage": "0.0000",
              "discountsValue": "0.0000",
              "subtotalIncludeDiscounts": "29.80",
              "taxesPercentage": "0.0000",
              "taxValue": "0.0000",
              "total": "29.80"
            }
          },
          "additional_info": { "externalCode": "pedido-teste-ext-001" }
        }
      ]
    },
    "shippingMethod": {
      "delivery": { "city": "São Paulo", "mainStreet": "Av. Paulista 1000", "zipCode": "01310-100" }
    },
    "payments": {
      "totals": [
        {
          "currencyCode": "BRL",
          "subtotalWithoutTaxes": "29.80",
          "discountPercentage": "0.0000",
          "discountsValue": "0.0000",
          "subtotalIncludeDiscounts": "29.80",
          "taxesPercentage": "0.0000",
          "taxValue": "0.0000",
          "total": "29.80"
        }
      ],
      "shippingCost": [
        {
          "currencyCode": "BRL",
          "subtotalWithoutTaxes": "8.90",
          "discountPercentage": "0.0000",
          "discountsValue": "0.0000",
          "subtotalIncludeDiscounts": "8.90",
          "taxesPercentage": "0.0000",
          "taxValue": "0.0000",
          "total": "8.90"
        }
      ],
      "extraCharges": [
        {
          "type": "PACKAGING",
          "quantity": 1,
          "description": "Taxa de serviço",
          "currencyCode": "BRL",
          "subtotalWithoutTaxes": "0.99",
          "taxValue": "0.0000",
          "total": "0.99"
        }
      ],
      "discounts": [],
      "paymentMethods": [
        {
          "processor": "IFOOD",
          "currencyCode": "BRL",
          "paymentMethodCode": "CREDIT",
          "transactionType": "ONLINE",
          "transactionStatus": "APPROVED",
          "exactPayment": true,
          "totalBill": "38.69",
          "id_auth": "123456",
          "receipt_customer": "COMPROBANTE CLIENTE\nAMEX ****1234\nAPROBADO",
          "receipt_merchant": "COMPROBANTE COMERCIO\nAMEX ****1234\nAPROBADO",
          "card": {
            "brand": "AMEX",
            "bin": "378282",
            "mask": "3782 82****1234",
            "lastFourDigits": "1234",
            "holder": "JOAO SILVA",
            "cardCountry": "BR",
            "externalCardBrandId": "",
            "media": "CHIP"
          },
          "acquirer": {
            "code": "01",
            "name": "CIELO",
            "cnpj": "01.027.058/0001-91"
          }
        },
        {
          "processor": "IFOOD",
          "currencyCode": "BRL",
          "paymentMethodCode": "AGGREGATOR_DISCOUNT",
          "transactionType": "BENEFIT",
          "transactionId": "0ec06303-28f8-4d1f-aa3d-8b88aadb9814",
          "transactionStatus": "APPROVED",
          "exactPayment": true,
          "totalBill": "1.00",
          "card": null,
          "acquirer": { "code": "", "name": "" }
        }
      ]
    }
  }
  ```
</RequestExample>

## Conciliación de los ejemplos

| Ejemplo                    | Productos (`totals[].total`) | Envío (`shippingCost[].total`) | Descuento de orden (`discounts[].discountsValue`) |                                 Pagado (`totalBill`) |
| -------------------------- | ---------------------------: | -----------------------------: | ------------------------------------------------: | ---------------------------------------------------: |
| Entrega simple             |                         8.99 |                           1.73 |                                                 — |                                            **10.72** |
| Descuento en línea + envío |                        15.12 |                           3.92 |                                                 — |                                            **19.04** |
| Varios productos + promo   |                        30.80 |                           3.50 |                                              2.00 |                                            **32.30** |
| Descuento del agregador    |                        29.80 |                           8.90 |                                                 — | **39.69** (CREDIT 38.69 + AGGREGATOR\_DISCOUNT 1.00) |

Notas de cálculo:

* **Entrega simple:** 8.99 + 1.73 = **10.72**.
* **Descuento en línea:** 10% sobre 15.00 → IVA sobre 13.50 → producto **15.12**; envío 3.50 + IVA 12% = **3.92**; **15.12 + 3.92 = 19.04**.
* **Varios productos + promo:** hamburguesas **25.80** + bebida **5.00** = **30.80**; + envío **3.50** = 34.30; − promo **2.00** = **32.30** pagado.
* **Descuento del agregador:** productos **29.80** + embalaje **0.99** + envío **8.90** = **39.69** bruto; el cliente paga **38.69** (CREDIT) + el agregador reembolsa **1.00** (AGGREGATOR\_DISCOUNT) = **39.69** ✓. `payments.discounts` queda vacío.

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "uid": "92eb4720-dbee-4786-ad76-b0b01aa47f36",
      "order_code": "99-2c6970fd-a164-48bd-9f45-d5098a679a8f",
      "account_uid": "100",
      "vendor_uid": "100.6.1350",
      "store_uid": "100.6.1350.1",
      "catalog_uid": "200a6bf1-55dd-4c9b-af2b-07a62cb0d6f2",
      "channel": {
        "uid": "200a6bf1-55dd-4c9b-af2b-07a62cb0d6f2",
        "code": "KEETA",
        "metadata": {
          "partner": "99"
        }
      },
      "service": {
        "uid": "91c2c168-5a4b-4944-977e-75a1ea7a77e7",
        "code": "DELIVERY",
        "metadata": {}
      },
      "device": {
        "uid": "99-aggregator-device",
        "name": "99 Aggregator",
        "metadata": {
          "ip": "0.0.0.0"
        }
      },
      "operator": {
        "uid": "99-operator",
        "name": "99",
        "session": {
          "uid": "sess-99-aggregator"
        }
      },
      "store": {
        "uid": "100.6.1350.1",
        "code": "K000",
        "name": "Laboratorio Brasil",
        "latitude": "-23.5632",
        "longitude": "-46.6543",
        "vendor_uid": "100.6.1350",
        "vendor_name": "Sandbox Brasil"
      },
      "anonymous_customer_uid": "99-client-e24b0c40-43ff-4d0e-b384-b1f3e1173193",
      "customer_uid": null,
      "customer": {
        "uid": "99-client-e24b0c40-43ff-4d0e-b384-b1f3e1173193",
        "name": "João",
        "email": "joao.silva@email.com",
        "phone": "11987654321",
        "last_name": "Silva",
        "gov_id_type": "CPF",
        "gov_id_number": "123.456.789-09"
      },
      "billing_uid": null,
      "billing": null,
      "fulfillment": {
        "method": "DELIVERY",
        "details": {
          "uid": "99-client-e24b0c40-43ff-4d0e-b384-b1f3e1173193",
          "city": "São Paulo",
          "country": "Brasil",
          "latitude": "-23.5632",
          "zip_code": "01310-100",
          "longitude": "-46.6543",
          "reference": "Apto 42",
          "main_street": "Av. Paulista 1000",
          "delivery_date": "2026-05-11T14:38:16.360Z"
        },
        "catalog_uid": "200a6bf1-55dd-4c9b-af2b-07a62cb0d6f2"
      },
      "status": "COMPLETED",
      "payment_status": "SUCCEEDED",
      "payment_methods": [
        {
          "uid": "6781726c-4dbb-4cb9-a8e6-a76a7283b102",
          "total": "347800",
          "method": "99",
          "details": {
            "mid": null,
            "tid": null,
            "card": {
              "bin": "",
              "mask": "",
              "brand": "",
              "holder": "",
              "card_country": "",
              "last_four_digits": "",
              "external_card_brand_id": "CASH"
            },
            "voucher": null,
            "acquirer": {
              "code": "",
              "name": ""
            },
            "metadata": {},
            "processor": "99",
            "total_bill": "347800",
            "currency_code": "BRL",
            "exact_payment": false,
            "transaction_id": "99-txn-5d7faa7d-f1aa-4af2-9f57-614cf5346eb4",
            "reference_number": null,
            "transaction_date": {
              "date": "2026-05-11T14:38:17.482Z",
              "time_zone_name": "UTC",
              "time_zone_type": "0"
            },
            "transaction_type": "cash",
            "authorization_code": "",
            "transaction_status": "APPROVED",
            "customer_cash_amount": "0"
          },
          "metadata": {},
          "currency_code": "BRL"
        }
      ],
      "metadata": {
        "pos": {
          "discount": false,
          "order_id": "99-2c6970fd-a164-48bd-9f45-d5098a679a8f",
          "account_id": "100",
          "created_at": "2026-05-11T14:38:16.360Z",
          "order_comment": ""
        },
        "additional_info": {}
      },
      "created_at": "2026-05-11 14:38:18.767989",
      "updated_at": "2026-05-11 14:38:18.767989",
      "deleted_at": null,
      "order_lines": [
        {
          "uid": "2fe6b60a-50e0-40f3-8040-91a26f1888b5",
          "hash": "001224591808cb3551c9d0c248b739ef07dd8dd3f958d3eb1251ca5f022bad48",
          "price": {
            "unit_price": [
              {
                "taxes": [
                  {
                    "name": "IVA",
                    "percentage": "0"
                  }
                ],
                "metadata": {},
                "discounts": [],
                "net_price": "17.39",
                "gross_price": "17.39",
                "taxes_value": "0",
                "currency_code": "BRL",
                "discount_value": "0",
                "subtotal_before_taxes": "17.39"
              }
            ],
            "total_price": [
              {
                "taxes": [
                  {
                    "name": "IVA",
                    "percentage": "0"
                  }
                ],
                "metadata": {},
                "discounts": [],
                "net_price": "34.78",
                "gross_price": "34.78",
                "taxes_value": "0",
                "currency_code": "BRL",
                "discount_value": "0",
                "subtotal_before_taxes": "34.78"
              }
            ]
          },
          "item_id": "001224591808cb3551c9d0c248b739ef07dd8dd3f958d3eb1251ca5f022bad48",
          "quantity": "2",
          "item_type": "PRODUCT",
          "store_uid": "100.6.1350.1",
          "updated_at": "2026-05-11T14:38:17.481Z",
          "vendor_uid": "100.6.1350",
          "fulfillment": {
            "method": "DELIVERY",
            "catalog_uid": "200a6bf1-55dd-4c9b-af2b-07a62cb0d6f2"
          },
          "line_totals": [
            {
              "taxes": [
                {
                  "name": "IVA",
                  "percentage": "0"
                }
              ],
              "total": "34.78",
              "subtotal": "34.78",
              "discounts": [],
              "taxes_value": "0",
              "currency_code": "BRL",
              "discount_value": "0",
              "subtotal_before_taxes": "34.78"
            }
          ],
          "modifier_groups": [],
          "item_description": "X-Burguer",
          "selected_currency": "BRL"
        }
      ],
      "totals": [
        {
          "taxes": [
            {
              "name": "IVA",
              "percentage": "0"
            }
          ],
          "total": "34.78",
          "subtotal": "34.78",
          "discounts": [],
          "taxes_value": "0",
          "currency_code": "BRL",
          "discount_value": "0",
          "subtotal_before_taxes": "34.78"
        }
      ]
    },
    "isArray": false,
    "status": 200,
    "method": "POST",
    "pathname": "/stage/api/v4/aggregator/orders",
    "duration": 4900,
    "traceId": "1-6a01e9d9-7c9577787de4d07a2c14686b;Parent"
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": "validation_error",
      "message": "channelId is required"
    }
  }
  ```

  ```json 409 theme={null}
  {
    "error": {
      "code": "duplicate_order",
      "message": "An order with orderId '0000012194-081101' already exists"
    }
  }
  ```
</ResponseExample>
