Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/farojas85/fast-rest-api/llms.txt

Use this file to discover all available pages before exploring further.

Delivery orders (pedidos a domicilio) require a dedicated invoicing flow because the delivery fee is taxed differently from the prepared food items on the same order. While restaurant food typically carries INC at 8 %, the delivery fee is generally subject to IVA at 19 % — and must appear as a distinct, separately taxed line on the electronic invoice. This endpoint handles orders from any delivery channel: Rappi, Didi, your own web platform, or an in-house dispatcher. The acquirer model mirrors the local order endpoint and supports both anonymous consumers and identified customers.
This endpoint is planned but not yet implemented. It follows the same Hexagonal Architecture pattern as the local order endpoint (/api/v1/pedidos/consumo-local/) and will reuse the IDianSoapPort interface defined in src/application/ports/dian_port.py. This page documents the planned interface based on docs/features/pedido_domicilio.md and the InvoiceCreateRequest schema in src/infrastructure/controllers/schemas/invoice_schema.py.

Planned Endpoint

PropertyValue
MethodPOST
Path/api/v1/pedidos/domicilio/ (planned)
Success status201 Created (planned)

Business Rules

The following rules are derived from the project feature spec (Historia de Usuario 2: Facturación de Pedidos a Domicilio):
1

Delivery fee is a separate taxable line item

The delivery_fee must be treated as an independent invoice line with its own tax rate. It is not bundled into the food items’ subtotal. Typically it is subject to IVA 19 %, not INC 8 %.
2

Tax rates are configurable per item

The InvoiceItemDTO schema exposes both inc_tax_rate and iva_tax_rate as optional per-item fields. The POS or delivery platform integration is responsible for sending the correct rate for each line, including the delivery fee line.
3

Acquirer model is identical to local orders

The customer_id field follows the same anonymous/identified pattern: "222222222222" for Consumidor Final, or the customer’s RUT/NIT for identified buyers. Delivery platforms may supply a customer identifier during checkout.
4

Voluntary tip is excluded from the taxable base

As with dine-in orders, voluntary_tip appears on the invoice for transparency but is not subject to INC or IVA, and does not increase the taxable base.

Planned Request Body

The following fields are based on InvoiceCreateRequest from src/infrastructure/controllers/schemas/invoice_schema.py and the delivery feature specification.
items
array
required
List of order items. Each item carries independent tax configuration, allowing food lines and the delivery fee line to be taxed at different rates within the same invoice.
voluntary_tip
float
default:"0.0"
Voluntary tip amount. Reported on the invoice but not taxable — excluded from both INC and IVA bases.
customer_id
string
default:"222222222222"
Customer RUT, NIT, or Cédula number. Defaults to the DIAN-approved anonymous consumer code "222222222222". Delivery platforms may supply the end customer’s identifier at checkout.
delivery_fee
float
default:"0.0"
Delivery fee amount. This value is added as a distinct invoice line subject to iva_tax_rate (typically 19 %). A value of 0.0 indicates no delivery charge (e.g., free delivery promotions).
delivery_channel
string
Identifies the platform or channel through which the order was placed. Used for reporting, reconciliation with third-party platform invoices, and operational analytics. Accepted values: "RAPPI", "DIDI", "WEB", "LOCAL".

Tax Differences vs. Local Orders

The key distinction between a delivery order and a dine-in order is the tax treatment of the delivery fee line:
Line itemApplicable taxTypical rate
Food & beveragesINC8 %
Alcoholic beverages (certain categories)IVA19 %
Voluntary tipNone
All item-level tax configuration is handled through ImpuestoRequest.nombre and ImpuestoRequest.tasa in PedidoLocalCreateRequest.
Example items array showing mixed tax treatment:
[
  {
    "name": "Hamburguesa Clásica",
    "quantity": 1,
    "price": 18000.00,
    "inc_tax_rate": 0.08,
    "iva_tax_rate": null
  },
  {
    "name": "Servicio de Domicilio",
    "quantity": 1,
    "price": 5000.00,
    "inc_tax_rate": null,
    "iva_tax_rate": 0.19
  }
]
The delivery_channel value (e.g., "RAPPI", "DIDI") is persisted in the audit log alongside the invoice payload. This makes it straightforward to reconcile your DIAN-issued invoices against the platform’s own settlement reports at month-end — filter audit log entries by delivery_channel to isolate each platform’s revenue and tax contribution.

Build docs developers (and LLMs) love