Error Codes

HTTP CodeTypeMessageDescription
400Bad RequestInvalid DataThe request body has missing or incorrectly formatted fields
401UnauthorizedAPI Key requiredThe X-Api-Key header was not provided
401UnauthorizedInvalid API KeyThe API Key does not exist, was revoked or is inactive
403ForbiddenQuota exceededThe subscription document limit was reached
404Not FoundResource not foundThe requested document, customer or company does not exist
409ConflictDuplicate referenceA document with the same referencia_externa already exists for this company
429Too Many RequestsRate limit exceededThe maximum number of requests per minute was exceeded
500Internal Server ErrorInternal errorUnexpected server error

Specific Error Codes (DIAN)

Internal CodeHTTPDescription
VALIDATION_ERROR400Provided data is invalid (missing fields, incorrect format).
DIAN_VALIDATION_FAILED502DIAN rejected the document. The details.dian_errors field contains the specific error list.
DIAN_TRANSMISSION_ERROR502Could not connect to DIAN. Retryable = true.
DIAN_TIMEOUT502DIAN did not respond within 30 seconds. Retryable = true.
DIAN_SIGNATURE_ERROR502The digital signature was rejected by DIAN.
CERT_NOT_FOUND400The .p12 digital certificate file was not found on the server.
CERT_EXPIRED400The digital certificate has expired. Renew it with your certificate authority.
CERT_INVALID_PASSWORD400The digital certificate password is incorrect.
QUOTA_EXCEEDED403Subscription document limit reached. Upgrade your plan.
DUPLICATE_RECORD409A document with the same referencia_externa or unique value already exists.
CONFLICT409Conflicting operation (concurrent duplicate or payload idempotency).
DB_CONNECTION_TIMEOUT503Could not connect to the database. Retryable = true.

Error Response Format

JSON
{
  "success": false,
  "error": {
    "code": "DIAN_VALIDATION_FAILED",
    "message": "La DIAN rechazó el documento por errores de validación.",
    "details": {
      "dian_errors": ["Regla FAJ42: NIT del emisor no coincide"],
      "document_id": 7,
      "suggestion": "Verifique que el NIT de la empresa coincida con el configurado en la DIAN."
    },
    "retryable": false
  }
}

Always verify the 'success' field before processing the response

5xx errors are temporary. Implement a retry with exponential backoff

4xx errors indicate problems with the request. Check the sent data

Rate Limiting

Each API Key has a configured request limit (default: 100 req/min).

Headers

HTTP
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1714000000
HeaderDescription
X-RateLimit-LimitMaximum number of requests per window
X-RateLimit-RemainingRemaining requests in current window
X-RateLimit-ResetUNIX timestamp when the window resets

Best Practices

  • Implement a queue system for mass submissions
  • Use caching to avoid repetitive queries
  • Contact support if you need a higher limit