Error Reference

All error responses follow this shape:

{
  "errorCode": "VALIDATION_ERROR",
  "message": "Request payload is invalid",
  "details": [
    { "field": "metadata.sellerTaxId", "reason": "sellerTaxId must be 13 digits" }
  ]
}

The details array is present only for VALIDATION_ERROR.

Error Codes

errorCodeHTTPDescription
UNAUTHORIZED401Missing or invalid API key
FORBIDDEN403API key does not have access to this resource
VALIDATION_ERROR422Request body or query parameters are invalid
NOT_FOUND404Resource not found
INVALID_BASE64422pdfBase64 is not valid base64
PDF_TOO_LARGE422PDF exceeds size limit
DUPLICATE_DOCUMENT409Document number already exists for this source
DUPLICATE_PAYMENT409sourcePaymentId already exists
DUPLICATE_RECEIPT409Receipt already exists
IDEMPOTENCY_CONFLICT409Idempotency key reused with different request body
TEMPLATE_NOT_FOUND422No active PDF template for this document type
PDF_GENERATION_FAILED422Server failed to generate PDF from template
INET_SUBMIT_FAILED502Submission to INET e-Tax service failed
PAYMENT_PROVIDER_NOT_CONFIGURED422No payment provider configured for this source
PAYMENT_PROVIDER_NOT_ALLOWED422Specified provider not allowed for this source
UNSUPPORTED_PAYMENT_PROVIDER422Provider not supported
WEBHOOK_SIGNATURE_INVALID401Webhook HMAC signature is invalid
RECEIPT_NOT_SHORT422Convert-to-full called on a non-SHORT receipt
RECEIPT_ALREADY_CONVERTED422Receipt has already been converted
RECEIPT_BUYER_TAX_INFO_REQUIRED422Buyer tax ID required for full receipt
INTERNAL_ERROR500Unexpected server error — contact support

Handling Errors

# Check errorCode, not just HTTP status
response=$(curl -s -w "\n%{http_code}" ...)
http_code=$(echo "$response" | tail -1)
body=$(echo "$response" | head -1)
error_code=$(echo "$body" | jq -r '.errorCode')

if [ "$error_code" = "IDEMPOTENCY_CONFLICT" ]; then
  # Generate a new idempotency key and retry
  echo "Conflict — retry with a new idempotency key"
fi