Verificar CUFE de factura DIAN
co-cufe-verifyRecalcula el CUFE de una factura electrónica de venta colombiana (SHA-384 de los 15 campos definidos por la DIAN: número, fecha, hora, valores, impuestos 01/04/03, total, NIT, clave técnica, ambiente) y lo compara con un CUFE dado; o solo revisa el formato de un CUFE/CUDE. Cuándo: hay que recalcular el CUFE de una factura electrónica DIAN a partir de sus campos para comprobar que coincide. No para: calcular el resumen SHA-384 (hash-sha384). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Recomputes the CUFE of a Colombian electronic sales invoice (SHA-384 of the 15 fields defined by DIAN: number, date, time, amounts, tax codes 01/04/03, total, NITs, technical key, environment) and compares it with a given CUFE; or checks a CUFE/CUDE format only. [EN completo / full EN: inputSchema.description]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cufe | No | CUFE/CUDE to check (96 hex chars) (string; optional; up to 200 chars). | |
| fec_fac | No | Issue date YYYY-MM-DD (FecFac) (string; optional; pattern ^\d{4}-\d{2}-\d{2}$). | |
| hor_fac | No | Issue time with offset, e.g. 10:30:45-05:00 (HorFac) (string; optional; pattern ^\d{2}:\d{2}:\d{2}[-+]\d{2}:\d{2}$). | |
| nit_ofe | No | Issuer NIT without DV (NitOFE) (string; optional; pattern ^\d{1,15}$). | |
| num_adq | No | Buyer ID number (NumAdq) (string; optional; up to 30 chars). | |
| num_fac | No | Invoice number with prefix (NumFac) (string; optional; up to 40 chars). | |
| val_fac | No | Amount (number or decimal string, max 2 decimals) (one of several shapes; optional). | |
| val_tot | No | Amount (number or decimal string, max 2 decimals) (one of several shapes; optional). | |
| val_imp1 | No | Amount (number or decimal string, max 2 decimals) (one of several shapes; optional). | |
| val_imp2 | No | Amount (number or decimal string, max 2 decimals) (one of several shapes; optional). | |
| val_imp3 | No | Amount (number or decimal string, max 2 decimals) (one of several shapes; optional). | |
| clave_tecnica | No | Technical key from the numbering resolution (ClTec) (string; optional; up to 200 chars). | |
| tipo_ambiente | No | Environment: 1 production, 2 testing (optional; one of: 1, 2). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cufe | No | ||
| chain | No | ||
| reason | No | ||
| matches | No | ||
| format_valid | No |