Una Linea, Una Tarifa de IVA, Un cargo (propinas)
Método: POST
URL: https://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:
-
Asincrono: .../ubl2.1/invoice/iddelsetdepruebasdeladian
-
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
| Key | Value |
|---|---|
Content-Type | application/json |
Accept | application/json |
Body
{
"number": 994550116,
"type_document_id": 1,
"date": "2025-11-26",
"time": "20:20:24",
"resolution_number": "18760000001",
"prefix": "SETP",
"customer": {
"identification_number": 89008003,
"name": "ALEXANDER OBANDO LONDONO",
"phone": "3103891693",
"address": "BRR EL CARDAL MZ 4 CS 7 ET 1",
"email": "alexander_obando@hotmail.com",
"merchant_registration": "0000-00",
"type_document_identification_id": 3,
"type_organization_id": 2,
"municipality_id": 149,
"type_regime_id": 2
},
"payment_form": {
"payment_form_id": 1,
"payment_method_id": 10,
"payment_due_date": "2025-09-04",
"duration_measure": "0"
},
"allowance_charges": [
{
"type_discount_id": 2,//id para agregar propinas en las facturas
"charge_indicator": true,
"allowance_charge_reason": "propina",
"amount": "7000.00",
"base_amount": "300000.00"
}
],
"legal_monetary_totals": {
"line_extension_amount": "252100.84",
"tax_exclusive_amount": "252100.84",
"tax_inclusive_amount": "300000.00",
"allowance_total_amount": "0.00",
"charge_total_amount": "7000.00",
"payable_amount": "307000.00"
},
"tax_totals": [
{
"tax_id": 1,
"tax_amount": "47899.16",
"percent": "19",
"taxable_amount": "252100.84"
}
],
"invoice_lines": [
{
"unit_measure_id": 70,
"invoiced_quantity": "1",
"line_extension_amount": "252100.84",
"free_of_charge_indicator": false,
"tax_totals": [
{
"tax_id": 1,
"tax_amount": "47899.16",
"taxable_amount": "252100.84",
"percent": "19.00"
}
],
"description": "COMISION POR SERVICIOS",
"code": "COMISION",
"type_item_identification_id": 4,
"price_amount": "300000.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": 994550116,
"type_document_id": 1,
"date": "2025-11-26",
"time": "20:20:24",
"resolution_number": "18760000001",
"prefix": "SETP",
"customer": {
"identification_number": 89008003,
"name": "ALEXANDER OBANDO LONDONO",
"phone": "3103891693",
"address": "BRR EL CARDAL MZ 4 CS 7 ET 1",
"email": "alexander_obando@hotmail.com",
"merchant_registration": "0000-00",
"type_document_identification_id": 3,
"type_organization_id": 2,
"municipality_id": 149,
"type_regime_id": 2
},
"payment_form": {
"payment_form_id": 1,
"payment_method_id": 10,
"payment_due_date": "2025-09-04",
"duration_measure": "0"
},
"allowance_charges": [
{
"type_discount_id": 2,//id para agregar propinas en las facturas
"charge_indicator": true,
"allowance_charge_reason": "propina",
"amount": "7000.00",
"base_amount": "300000.00"
}
],
"legal_monetary_totals": {
"line_extension_amount": "252100.84",
"tax_exclusive_amount": "252100.84",
"tax_inclusive_amount": "300000.00",
"allowance_total_amount": "0.00",
"charge_total_amount": "7000.00",
"payable_amount": "307000.00"
},
"tax_totals": [
{
"tax_id": 1,
"tax_amount": "47899.16",
"percent": "19",
"taxable_amount": "252100.84"
}
],
"invoice_lines": [
{
"unit_measure_id": 70,
"invoiced_quantity": "1",
"line_extension_amount": "252100.84",
"free_of_charge_indicator": false,
"tax_totals": [
{
"tax_id": 1,
"tax_amount": "47899.16",
"taxable_amount": "252100.84",
"percent": "19.00"
}
],
"description": "COMISION POR SERVICIOS",
"code": "COMISION",
"type_item_identification_id": 4,
"price_amount": "300000.00",
"base_quantity": "1"
}
]
}'