Factura Electrónica (FE)

POST /api/v1/service/invoice

Genera una Factura Electrónica de Venta según el Anexo Técnico DIAN v1.9.

Request

POST /api/v1/service/invoice

Identificación

CampoTipoRequeridoDescripción
prefixstringPrefijo resolución (ej. "SETP")
numberintegerNúmero consecutivo
issue_datestringFecha ISO "YYYY-MM-DD"
issue_timestringHora "HH:MM:SS-05:00"
invoice_type_codestringNo"01"=Factura venta (default), "02"=Exportación
customization_idstringNo"10" (default) — Tabla 13.1.5.1
profile_execution_idstringNo"2"=Habilitación, "1"=Producción (default)
notesstring[]NoArray de textos libres que se emiten como <Note> en el XML

Seller (Vendedor / Emisor)

CampoTipoRequeridoDescripción
seller.nitstringNIT del emisor sin DV
seller.dvstringDígito de verificación
seller.namestringRazón social o nombre completo
seller.document_typestringNo"31"=NIT (default), "13"=CC
seller.tax_level_codestringNoResponsabilidades fiscales (default "R-99-PN")
seller.tax_scheme_idstringNo"ZZ" (default)
seller.tax_scheme_namestringNo"No aplica" (default)
seller.registration_namestringNoNombre comercial si difiere del legal
seller.organization_typestringNo"1"=Persona jurídica (default), "2"=Persona natural
seller.first_namestringNoPrimer nombre (persona natural, doc_type=13)
seller.middle_namestringNoSegundo nombre (persona natural)
seller.family_namestringNoPrimer apellido (persona natural)
seller.fiscal_regimestringNoRégimen fiscal: "48"=Simplificado, "49"=Común, "50"=Gran contribuyente
seller.liability_codestringNoCódigo de responsabilidad individual (ej. "O-13", "R-99-PN")
seller.address.department_codestringCódigo DIVIPOLA departamento
seller.address.city_codestringCódigo DIVIPOLA municipio
seller.address.address_linestringDirección
seller.address.country_codestringNo"CO" (default)
seller.address.postal_zonestringNoCódigo postal (default "000000")

Buyer (Adquirente)

CampoTipoRequeridoDescripción
buyer.nitstringNIT/CC/CE del comprador
buyer.dvstringDígito de verificación
buyer.namestringRazón social o nombre
buyer.document_typestringNo"31"=NIT (default), "13"=CC, "22"=CE, "41"=Pasaporte
buyer.emailstringNoEmail para notificación
buyer.tax_level_codestringNoResponsabilidades fiscales
buyer.tax_scheme_idstringNo"ZZ" (default)
buyer.tax_scheme_namestringNo"No aplica" (default)
buyer.registration_namestringNoNombre comercial
buyer.organization_typestringNo"1"=Persona jurídica (default), "2"=Persona natural
buyer.first_namestringNoPrimer nombre (persona natural)
buyer.middle_namestringNoSegundo nombre (persona natural)
buyer.family_namestringNoPrimer apellido (persona natural)
buyer.fiscal_regimestringNoRégimen fiscal
buyer.liability_codestringNoCódigo de responsabilidad individual
buyer.address.department_codestringCódigo DIVIPOLA departamento
buyer.address.city_codestringCódigo DIVIPOLA municipio
buyer.address.address_linestringDirección
buyer.address.country_codestringNo"CO" (default)
buyer.address.postal_zonestringNoCódigo postal (default "000000")

Lines (Líneas)

CampoTipoRequeridoDescripción
lines[].idstringNúmero de línea (correlativo)
lines[].descriptionstringDescripción del producto/servicio
lines[].quantitynumberCantidad (> 0)
lines[].unit_codestringNoCódigo UNECE (default "94"=unidad)
lines[].unit_pricenumberPrecio unitario (> 0)
lines[].line_extension_amountnumberSubtotal del ítem (quantity × unit_price)
lines[].sellers_item_idstringNoCódigo interno del producto
lines[].additional_item_idstringNoCódigo adicional (EAN, referencia)
lines[].tax_total.tax_amountnumberTotal impuestos de esta línea
lines[].tax_total.tax_subtotals[].tax_amountnumberValor del impuesto
lines[].tax_total.tax_subtotals[].taxable_amountnumberBase gravable
lines[].tax_total.tax_subtotals[].tax_percentnumberPorcentaje (ej. 19.00)
lines[].tax_total.tax_subtotals[].tax_scheme_idstringNo"01"=IVA (default), "04"=INC, "03"=ICA
lines[].tax_total.tax_subtotals[].tax_scheme_namestringNo"IVA", "INC", "ICA"

TaxTotals (Totales de Impuestos)

CampoTipoRequeridoDescripción
tax_totals[].tax_amountnumberTotal por tipo de impuesto
tax_totals[].tax_subtotals[].tax_amountnumberValor del impuesto
tax_totals[].tax_subtotals[].taxable_amountnumberBase gravable
tax_totals[].tax_subtotals[].tax_percentnumberPorcentaje
tax_totals[].tax_subtotals[].tax_scheme_idstringCódigo DIAN
tax_totals[].tax_subtotals[].tax_scheme_namestringNombre del impuesto

MonetaryTotal (Totales Monetarios)

CampoTipoRequeridoDescripción
monetary_total.line_extension_amountnumberSubtotal bruto sin impuestos
monetary_total.tax_exclusive_amountnumberBase imponible neta
monetary_total.tax_inclusive_amountnumberTotal con impuestos
monetary_total.prepaid_amountnumberNoAnticipo (default 0.00)
monetary_total.payable_amountnumberTotal a pagar

PaymentMeans (Medio de Pago)

CampoTipoRequeridoDescripción
payment_means.payment_means_codestringNo"10"=Efectivo (default), "1", "2", "20", "48", "49"
payment_means.payment_due_datestringNoFecha vencimiento (solo crédito) ISO

Control (Resolución)

CampoTipoRequeridoDescripción
control.invoice_authorizationstringNúmero de resolución DIAN
control.start_datestringFecha inicio vigencia ISO
control.end_datestringFecha fin vigencia ISO
control.prefixstringPrefijo de la resolución
control.from_numberintegerPrimer número del rango
control.to_numberintegerÚltimo número del rango

Software

CampoTipoRequeridoDescripción
software_idstringUUID del software DIAN registrado
software_pinstringPIN del software DIAN

Environment

CampoTipoRequeridoDescripción
environmentstringNo"2"=Habilitación, "1"=Producción

Ejemplo

curl -X POST https://emision.smartapp.com.co/api/v1/service/invoice \
  -H "Authorization: Bearer TU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prefix": "SETP",
    "number": 100,
    "issue_date": "2026-05-01",
    "issue_time": "10:30:00-05:00",
    "notes": ["Pago a 30 días"],
    "seller": {
      "nit": "901917345",
      "dv": "0",
      "name": "Smart Mensajería SAS",
      "address": {
        "department_code": "11",
        "city_code": "11001",
        "address_line": "Calle 123 #45-67",
        "postal_zone": "110111"
      }
    },
    "buyer": {
      "nit": "900123456",
      "dv": "1",
      "name": "Cliente SAS",
      "address": {
        "department_code": "11",
        "city_code": "11001",
        "address_line": "Cra 45 #67-89"
      }
    },
    "lines": [
      {
        "id": "1",
        "description": "Servicio de mensajería",
        "quantity": 1,
        "unit_price": 100000,
        "line_extension_amount": 100000,
        "tax_total": {
          "tax_amount": 19000,
          "tax_subtotals": [
            {"tax_amount": 19000, "taxable_amount": 100000, "tax_percent": 19,
             "tax_scheme_id": "01", "tax_scheme_name": "IVA"}
          ]
        }
      }
    ],
    "tax_totals": [
      {
        "tax_amount": 19000,
        "tax_subtotals": [
          {"tax_amount": 19000, "taxable_amount": 100000, "tax_percent": 19,
           "tax_scheme_id": "01", "tax_scheme_name": "IVA"}
        ]
      }
    ],
    "monetary_total": {
      "line_extension_amount": 100000,
      "tax_exclusive_amount": 100000,
      "tax_inclusive_amount": 119000,
      "payable_amount": 119000
    },
    "payment_means": {"payment_means_code": "10"},
    "control": {
      "invoice_authorization": "18760000001",
      "start_date": "2019-01-19",
      "end_date": "2030-01-19",
      "prefix": "SETP",
      "from_number": 1,
      "to_number": 1000000
    },
    "software_id": "ccf08616-3061-4c25-9d68-e76f23235a1b",
    "software_pin": "13934"
  }'

Python

import requests
 
resp = requests.post(
    "https://emision.smartapp.com.co/api/v1/service/invoice",
    headers={"Authorization": "Bearer sk_..."},
    json={
        "prefix": "SETP",
        "number": 100,
        "issue_date": "2026-05-01",
        "issue_time": "10:30:00-05:00",
        "seller": {
            "nit": "901917345",
            "dv": "0",
            "name": "Smart Mensajería SAS",
            "address": {"department_code": "11", "city_code": "11001", "address_line": "Calle 123 #45-67"},
        },
        "buyer": {
            "nit": "900123456",
            "dv": "1",
            "name": "Cliente SAS",
            "address": {"department_code": "11", "city_code": "11001", "address_line": "Cra 45 #67-89"},
        },
        "lines": [{
            "id": "1", "description": "Servicio de mensajería",
            "quantity": 1, "unit_price": 100000, "line_extension_amount": 100000,
            "tax_total": {"tax_amount": 19000, "tax_subtotals": [
                {"tax_amount": 19000, "taxable_amount": 100000, "tax_percent": 19,
                 "tax_scheme_id": "01", "tax_scheme_name": "IVA"}]},
        }],
        "tax_totals": [{"tax_amount": 19000, "tax_subtotals": [
            {"tax_amount": 19000, "taxable_amount": 100000, "tax_percent": 19,
             "tax_scheme_id": "01", "tax_scheme_name": "IVA"}]}],
        "monetary_total": {
            "line_extension_amount": 100000, "tax_exclusive_amount": 100000,
            "tax_inclusive_amount": 119000, "payable_amount": 119000},
        "payment_means": {"payment_means_code": "10"},
        "control": {"invoice_authorization": "18760000001",
                     "start_date": "2019-01-19", "end_date": "2030-01-19",
                     "prefix": "SETP", "from_number": 1, "to_number": 1000000},
        "software_id": "ccf08616-3061-4c25-9d68-e76f23235a1b",
        "software_pin": "13934",
    }
)
print(resp.json())

Node.js

const resp = await fetch("https://emision.smartapp.com.co/api/v1/service/invoice", {
  method: "POST",
  headers: { "Authorization": "Bearer sk_...", "Content-Type": "application/json" },
  body: JSON.stringify({
    prefix: "SETP",
    number: 100,
    issue_date: "2026-05-01",
    issue_time: "10:30:00-05:00",
    seller: {
      nit: "901917345", dv: "0", name: "Smart Mensajería SAS",
      address: { department_code: "11", city_code: "11001", address_line: "Calle 123 #45-67" },
    },
    buyer: {
      nit: "900123456", dv: "1", name: "Cliente SAS",
      address: { department_code: "11", city_code: "11001", address_line: "Cra 45 #67-89" },
    },
    lines: [{
      id: "1", description: "Servicio de mensajería",
      quantity: 1, unit_price: 100000, line_extension_amount: 100000,
      tax_total: { tax_amount: 19000, tax_subtotals: [
        { tax_amount: 19000, taxable_amount: 100000, tax_percent: 19,
          tax_scheme_id: "01", tax_scheme_name: "IVA" }] },
    }],
    tax_totals: [{ tax_amount: 19000, tax_subtotals: [
      { tax_amount: 19000, taxable_amount: 100000, tax_percent: 19,
        tax_scheme_id: "01", tax_scheme_name: "IVA" }] }],
    monetary_total: { line_extension_amount: 100000, tax_exclusive_amount: 100000,
                      tax_inclusive_amount: 119000, payable_amount: 119000 },
    payment_means: { payment_means_code: "10" },
    control: { invoice_authorization: "18760000001",
               start_date: "2019-01-19", end_date: "2030-01-19",
               prefix: "SETP", from_number: 1, to_number: 1000000 },
    software_id: "ccf08616-3061-4c25-9d68-e76f23235a1b",
    software_pin: "13934",
  })
});
console.log(await resp.json());