Notas Débito
Emite notas débito electrónicas para realizar ajustes de valor a facturas existentes.
POST
/v1/debit-notesCrea una nota débito asociada a una factura existente.
| Campo | Tipo | Req. | Descripción |
|---|---|---|---|
companyId | string | ✅ | UUID de la empresa emisora |
invoiceId | string | ✅ | UUID de la factura original |
reason | string | ✅ | Motivo del ajuste |
items | array | ✅ | Líneas a debitar (ajustes de valor) |
curl -X POST https://api.mercalo.co/v1/debit-notes \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"companyId": "uuid-empresa",
"invoiceId": "inv_abc123",
"reason": "Ajuste de precio por acuerdo comercial",
"items": [{
"description": "Ajuste servicio de desarrollo",
"quantity": 1,
"unitPrice": 200000,
"taxRate": 19
}]
}'Response (200 OK)
{
"id": "dn_def456",
"cude": "d4e5f6...",
"status": "ACCEPTED",
"invoiceId": "inv_abc123",
"total": 238000,
"pdfUrl": "https://api.mercalo.co/v1/debit-notes/dn_def456/pdf",
"createdAt": "2026-03-12T14:00:00Z"
}GET
/v1/debit-notes/:idConsulta el detalle de una nota débito.
curl https://api.mercalo.co/v1/debit-notes/dn_def456 \
-H "Authorization: Bearer sk_live_xxx"GET
/v1/debit-notesLista notas débito con filtros.
curl "https://api.mercalo.co/v1/debit-notes?companyId=xxx" \
-H "Authorization: Bearer sk_live_xxx"Errores comunes
| Código | Descripción | Solución |
|---|---|---|
400 | Factura no encontrada | Verifica el invoiceId |
422 | Monto excede el original | El ajuste no puede superar el valor de la factura |