Skip to main content

Tres Lineas, Descuento en Linea, Una Tarifa de IVA

Método: POST
URL: http://apidian2024.oo/api/ubl2.1/invoice

PRIMER ENVIO DE FACTURA

  • Si se instalo un dominio se debe utilizar de la siguiente manera:

http://midominio.com/api/ubl2.1/invoice

  • Requiere un token de autorizacion el cual fue devuelto al realizar el Paso 1 - Config Company, si este token se extravio, se puede consultar en la tabla de la base de datos de la API en la tabla users, en el campo API_TOKEN.

  • En URL el ultimo parametro corresponde al id del set de pruebas que la dian entrego al momento de registrar el modo de operacion software propio.

.../ubl2.1/invoice/iddelsetdepruebasdeladian

  • Este endpoint se puede utilizar de dos modos:
  1. Asincrono: .../ubl2.1/invoice/iddelsetdepruebasdeladian

  2. Sincrono: .../ubl2.1/invoice

  • El modo sincrono no afecta al set de pruebas, pero la respuesta de la DIAN incluye posibles errores de validacion y estado de la factura, valida o no valida.

  • El modo asincrono, afecta el set de pruebas y en la respuesta no se incluye el resultado de la factura, solo se entrega un ZIP_KEY el cual debe ser consultado mediante el endpoint:

.../ubl2.1/status/zip

de la seccion 03 - Consultas de estado para asi poder establecer si la factura fue valida o no y los errores de validacion.

Autenticación

  • Tipo: Bearer Token
  • Header: Authorization: Bearer <TOKEN>

Headers

KeyValue
Content-Typeapplication/json
Acceptapplication/json

Body

{
"number": 990060186,
"type_document_id": 1,
"date": "2025-01-02",
"time": "04:08:12",
"resolution_number": "18760000001",
"prefix": "SETP",
"notes": "ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA",
"disable_confirmation_text": true,
"establishment_name": "TORRE SOFTWARE",
"establishment_address": "BRR LIMONAR MZ 6 CS 3 ET 1 PISO 2",
"establishment_phone": "3226563672",
"establishment_municipality": 600,
"establishment_email": "alternate_email@alternate.com",
"sendmail": true,
"sendmailtome": true,
"seze": "2021-2017",
"head_note": "PRUEBA DE TEXTO LIBRE QUE DEBE POSICIONARSE EN EL ENCABEZADO DE PAGINA DE LA REPRESENTACION GRAFICA DE LA FACTURA ELECTRONICA VALIDACION PREVIA DIAN",
"foot_note": "PRUEBA DE TEXTO LIBRE QUE DEBE POSICIONARSE EN EL PIE DE PAGINA DE LA REPRESENTACION GRAFICA DE LA FACTURA ELECTRONICA VALIDACION PREVIA DIAN",
"customer": {
"identification_number": 900166483,
"dv": 1,
"name": "INVERSIONES DAVAL SAS",
"phone": "3103891693",
"address": "CLL 4 NRO 33-90",
"email": "gerencia@torresoftware.com",
"merchant_registration": "0000000-00",
"type_document_identification_id": 6,
"type_organization_id": 1,
"type_liability_id": 7,
"municipality_id": 822,
"type_regime_id": 1
},
"payment_form": {
"payment_form_id": 1,
"payment_method_id": 10,
"payment_due_date": "2025-01-02",
"duration_measure": "0"
},
"legal_monetary_totals": {
"line_extension_amount": "769500.00",
"tax_exclusive_amount": "950000.00",
"tax_inclusive_amount": "950000.00",
"allowance_total_amount": "0.00",
"payable_amount": "950000.00"
},
"tax_totals":
[
{
"tax_id": 1,
"tax_amount": "180500",
"percent": "19",
"taxable_amount": "950000.00"
}
],
"invoice_lines":
[
{
"unit_measure_id": 70,
"invoiced_quantity": "1",
"line_extension_amount": "769500.00",
"free_of_charge_indicator": false,
"allowance_charges": [{
"charge_indicator": false,
"allowance_charge_reason": "DESCUENTO GENERAL",
"amount": "50000.00",
"base_amount": "1000000.00"
}
],
"tax_totals": [
{
"tax_id": 1,
"tax_amount": "180500",
"taxable_amount": "950000",
"percent": "19.00"
}
],
"description": "COMISION POR SERVICIOS",
"notes": "ESTA ES UNA PRUEBA DE NOTA DE DETALLE DE LINEA.",
"code": "COMISION",
"type_item_identification_id": 4,
"price_amount": "1000000.00",
"base_quantity": "1"
}
]
}

Ejemplo cURL

curl -X POST "https://apidian2024.oo/api/ubl2.1/invoice" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-raw '{
"number": 994550120,
"type_document_id": 1,
"date": "2025-11-26",
"time": "04:08:12",
"resolution_number": "18760000001",
"prefix": "SETP",
"notes": "ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA, ESTA ES UNA NOTA DE PRUEBA",
"disable_confirmation_text": true,
"establishment_name": "TORRE SOFTWARE",
"establishment_address": "BRR LIMONAR MZ 6 CS 3 ET 1 PISO 2",
"establishment_phone": "3226563672",
"establishment_municipality": 600,
"establishment_email": "alternate_email@alternate.com",
"sendmail": true,
"sendmailtome": true,
"seze": "2021-2017",
"head_note": "PRUEBA DE TEXTO LIBRE QUE DEBE POSICIONARSE EN EL ENCABEZADO DE PAGINA DE LA REPRESENTACION GRAFICA DE LA FACTURA ELECTRONICA VALIDACION PREVIA DIAN",
"foot_note": "PRUEBA DE TEXTO LIBRE QUE DEBE POSICIONARSE EN EL PIE DE PAGINA DE LA REPRESENTACION GRAFICA DE LA FACTURA ELECTRONICA VALIDACION PREVIA DIAN",
"customer": {
"identification_number": 900166483,
"dv": 1,
"name": "INVERSIONES DAVAL SAS",
"phone": "3103891693",
"address": "CLL 4 NRO 33-90",
"email": "alexander_obando@hotmail.com",
"merchant_registration": "0000000-00",
"type_document_identification_id": 6,
"type_organization_id": 1,
"type_liability_id": 7,
"municipality_id": 822,
"type_regime_id": 1
},
"payment_form": {
"payment_form_id": 2,
"payment_method_id": 30,
"payment_due_date": "2024-08-22",
"duration_measure": "30"
},
"legal_monetary_totals": {
"line_extension_amount": "7310924.175",
"tax_exclusive_amount": "7310924.175",
"tax_inclusive_amount": "8700000.00",
"allowance_total_amount": "0.00",
"payable_amount": "8700000.00"
},
"tax_totals":
[{
"tax_id": 1,
"tax_amount": "1389075.630",
"percent": "19",
"taxable_amount": "7310924.175"
}
],
"invoice_lines": [
{
"unit_measure_id": 70,
"invoiced_quantity": "1",
"line_extension_amount": "798319.327",
"free_of_charge_indicator": false,
"allowance_charges": [{
"charge_indicator": false,
"allowance_charge_reason": "DESCUENTO GENERAL",
"amount": "50000.00",
"base_amount": "1000000.00"
}
],
"tax_totals": [{
"tax_id": 1,
"tax_amount": "151680.673",
"taxable_amount": "798319.327",
"percent": "19.00"
}
],
"description": "ARTICULO NRO 1",
"notes": "ESTA ES UNA PRUEBA DE NOTA DE DETALLE DE LINEA.",
"code": "ART1",
"type_item_identification_id": 4,
"price_amount": "1000000.00",
"base_quantity": "1"
},
{
"unit_measure_id": 70,
"invoiced_quantity": "1",
"line_extension_amount": "1554621.848",
"free_of_charge_indicator": false,
"allowance_charges": [{
"charge_indicator": false,
"allowance_charge_reason": "DESCUENTO GENERAL",
"amount": "150000.00",
"base_amount": "2000000.00"
}
],
"tax_totals": [{
"tax_id": 1,
"tax_amount": "295378.152",
"taxable_amount": "1554621.848",
"percent": "19.00"
}
],
"description": "ARTICULO NRO 2",
"notes": "ESTA ES UNA PRUEBA DE NOTA DE DETALLE DE LINEA.",
"code": "ART2",
"type_item_identification_id": 4,
"price_amount": "2000000.00",
"base_quantity": "1"
},
{
"unit_measure_id": 70,
"invoiced_quantity": "2",
"line_extension_amount": "4957983.193",
"free_of_charge_indicator": false,
"allowance_charges": [{
"charge_indicator": false,
"allowance_charge_reason": "DESCUENTO GENERAL",
"amount": "100000.00",
"base_amount": "6000000.00"
}
],
"tax_totals": [{
"tax_id": 1,
"tax_amount": "942016.807",
"taxable_amount": "4957983.193",
"percent": "19.00"
}
],
"description": "ARTICULO NRO 3",
"notes": "ESTA ES UNA PRUEBA DE NOTA DE DETALLE DE LINEA.",
"code": "ART3",
"type_item_identification_id": 4,
"price_amount": "3000000.00",
"base_quantity": "1"
}
]
}'

Probar endpoint

POST
Enviar Factura (Síncrono / Asíncrono con TestSetId)
BASE URL
Se guarda localmente en tu navegador.
BEARER TOKEN
Se guarda solo en esta sesión/pestaña.
PATH PARAMS
TestSetId (opcional)
URL FINAL
/api/ubl2.1/invoice
BODY JSON
RESPUESTA
Envía la solicitud para ver la respuesta aquí.