Ir al contenido

Ejemplo JSON explicado

Fuente: colección Postman · Una Linea, Sin Descuentos, Una Tarifa de IVA.

Archivo: invoice-ubl21.example.json

{
"number": 990001147,
"type_document_id": 1,
"date": "2024-08-31",
"time": "04:08:12",
"resolution_number": "18760000001",
"prefix": "SETP",
"notes": "Factura de prueba GridBilling",
"sendmail": true
}
  • type_document_id: 1 → factura de venta electrónica
  • sendmail: true → intenta enviar representación al correo del cliente
"customer": {
"identification_number": 89008003,
"dv": 2,
"name": "INVERSIONES DAVAL SAS",
"phone": "3103891693",
"address": "CLL 4 NRO 33-90",
"email": "cliente@empresa.com",
"type_document_identification_id": 6,
"type_organization_id": 1,
"type_liability_id": 7,
"municipality_id": 822,
"type_regime_id": 1
}

IDs de tipo documento, organización, responsabilidad y régimen deben coincidir con las tablas de referencia de la API.

"payment_form": {
"payment_form_id": 2,
"payment_method_id": 30,
"payment_due_date": "2024-08-31",
"duration_measure": "0"
}
"legal_monetary_totals": {
"line_extension_amount": "840336.134",
"tax_exclusive_amount": "840336.134",
"tax_inclusive_amount": "1000000.00",
"payable_amount": "1000000.00"
},
"tax_totals": [
{
"tax_id": 1,
"tax_amount": "159663.865",
"percent": "19.00",
"taxable_amount": "840336.134"
}
]

tax_id: 1 suele corresponder a IVA. Base + IVA ≈ valor a pagar.

"invoice_lines": [
{
"unit_measure_id": 70,
"invoiced_quantity": "1",
"line_extension_amount": "840336.134",
"free_of_charge_indicator": false,
"description": "COMISION POR SERVICIOS",
"code": "COMISION",
"type_item_identification_id": 4,
"price_amount": "1000000.00",
"base_quantity": "1",
"tax_totals": [ { "tax_id": 1, "tax_amount": "159663.865", "taxable_amount": "840336.134", "percent": "19.00" } ]
}
]
POST /api/ubl2.1/invoice
Authorization: Bearer <token_de_acceso>
Content-Type: application/json
Accept: application/json

Body = archivo de ejemplo (o el de Postman sin recortar).