Status Codes

Error Response Body

The error response is returned whenever a request to the bizAPIs API cannot be completed successfully.
It provides information about what went wrong, where the error originated, and a human-readable explanation. This structure is designed to be machine-readable for automated handling and human-readable for troubleshooting.


🔔 Migration Guide: New Enhanced Error Response Structure

What's Changing

We're introducing a new structured error response format across all bizAPIs endpoints to improve debugging, monitoring, and support experiences.

Before (Old Format)

{
  "message": "Document not found"
}

After (New Format)

{
  "requestId": "9e12f4b8-7d4f-4a9f-b832-5c614e86d5aa",
  "errorCode": 4099,
  "errorName": "DOCUMENT_NOT_FOUND",
  "fullStatusCode": "4099.0008.0002",
  "timestamp": "2025-08-13T16:37:53.037939200Z",
  "message": "Document not found"
}

Why This Matters

Faster Support - Share the requestId with our team to instantly locate your request in our logs
Better Debugging - The fullStatusCode tells you exactly what failed, in which service, and from where
Programmatic Handling - Use errorCode or errorName for consistent error handling across your application
Audit Trail - timestamp helps you correlate errors with your own logs


Breaking Changes

⚠️ Action Required:

  1. Response Structure Changed - Error responses now return a structured JSON object with new fields
  2. Error Message Difference - Some messages may have changed in order to standardized across all services

When contacting support, always include:

  • The requestId from the error response
  • The fullStatusCode if available
  • Timestamp of when the error occurred
  • What you were trying to accomplish

Fields

FieldTypeExampleDescription
requestIdString"9e12f4b8-7d4f-4a9f-b832-5c614e86d5aa"A unique identifier for this specific API request. Useful for tracing and debugging in logs.
errorCodeshort4099A numeric code that uniquely identifies the type of error. Can be mapped to predefined error codes documented in the Error Codes table below.
errorNameString"DOCUMENT_NOT_FOUND"A machine-readable name for the error. Matches the constant name from the Error Codes table.
fullStatusCodeString"4099.0008.0002"A composite status code made up of three parts: [errorCode].[serviceCode].[originCode]. This allows precise identification of what error occurred, in which service, and from which origin.
timestampInstant (ISO 8601 format)"2025-08-13T16:37:53.037939200Z"The exact date and time (in UTC) when the error occurred.
messageString"Document not found"A human-readable explanation of the error intended for display in logs, UI messages, or debugging tools.

UnderstandingfullStatusCode

The fullStatusCode provides a structured way to trace errors:

[errorCode].[serviceCode].[originCode]

  • errorCode → Maps to the main error type (see Error Codes Table below).
  • serviceCode → Identifies which internal bizAPIs service was involved (see Service Codes Table below).
  • originCode → Identifies the origin of the request or error trigger (see Origin Codes Table below).

Example:

4099.0008.0002

  • 4099 → DOCUMENT_NOT_FOUND
  • 0008cpp-service
  • 0002 → Originated from PORTAL

Error Codes

1. Authentication & Login Failures (0–2048)

Keycodemessage
AUTHENTICATION_FAILED0Authentication failed. Please verify your credentials and try again.
AUTHENTICATION_TIMEOUT1Authentication timed out. The service is taking longer than expected to respond.
AUTHENTICATION_INVALID_CREDENTIALS2Invalid credentials provided. Please check your username and password.
AUTHENTICATION_PAGE_UNREACHABLE3Unable to reach authentication page.
AUTHENTICATION_CAPTCHA_FAILED4Authentication failed due to CAPTCHA verification. Please try again.
AUTHENTICATION_PASSWORD_RECOVERY_REQUIRED5Password recovery is required. Please reset your password to continue.
AUTHENTICATION_SESSION_EXPIRED6Session expired or not found. Please authenticate again.
AUTHENTICATION_OTP_ERROR7Failed to submit OTP. An error occurred during the process.
AUTHENTICATION_OTP_EXCEPTION8Failed to submit OTP. An exception occurred in the process.
AUTHENTICATION_OTP_ATTEMPTS_EXCEEDED9Number of OTP attempts is about to be exceeded. Please authenticate manually to avoid account lockout.

2. Data Extraction & Processing Failures (2049–4096)

Keycodemessage
EXTRACTION_FAILED2049Failed to extract the requested data. Please try again later.
EXTRACTION_PENDING_DECISION2051Data extraction is pending decision. Please try again later.
PDF_GENERATION_FAILED2052Failed to generate PDF document. Please try again.
DOCUMENT_SEARCH_FAILED2053Error occurred while searching for the document. Please try again.
REQUEST_PROCESSING_FAILED2054Unable to process your request. Please try again later.
DOCUMENT_READ_FAILED2055Failed to read the document. The file may be corrupted or inaccessible.
SERVICE_DOWNLOAD_DISABLED2058Download functionality is currently disabled for this service.
SERVICE_ERROR2059A service error occurred. Please try again later.

3. Resource Not Found or Unavailable (4097–6144)

Keycodemessage
RESOURCE_UNAVAILABLE4097The requested resource is currently unavailable. Please try again later.
RESOURCE_NOT_FOUND4099The requested resource was not found.
DATE_NOT_AVAILABLE4103The selected date is not available. Please choose a different date.
NIF_WITHOUT_ACTIVITY4104No activity is registered for this tax identification number.
NIF_NONEXISTENT4105The provided tax identification number does not exist.
TAX_NUMBER_OUTDATED4106The tax number is outdated. Please provide the current tax identification number.
PORTAL_ACCESS_FAILED4108Failed to access the portal. Please try again later.

4. Timeout & Page Load Issues (6145–8192)

Keycodemessage
TIMEOUT_OCCURRED6145Operation timed out. The service is taking longer than expected to respond.
TIMEOUT_FILE_READ6146File read operation timed out. Please try again.
TIMEOUT_DATA_EXTRACTION6148Data extraction timed out. Please try again later.
TIMEOUT_SEARCH6149Search operation timed out. Please try again.

5. Input Validation & Formatting Errors (8193–10240)

Keycodemessage
INVALID_NIF8193The provided tax identification number is not valid.
FIELD_PAGE_CANNOT_BE_NEGATIVE8194Page number cannot be negative. Please provide a valid page number.
FIELD_PAGE_EXCEEDS_LIMIT8195Page number exceeds the maximum limit.
NUMBER_VALUES_REQUESTS_EXCEEDS_NUMBER_OF_RESULTS8196The number of requested values exceeds the available results.
MISSING_INPUTS8197Required input fields are missing. Please provide all necessary information.
SERVICE_NOT_IDENTIFIED8198No service identified. Please specify which service you want to use.
LICENSE_SERVICE_LIMIT_EXCEEDED8199Your license does not allow multiple services simultaneously. Please use one service at a time.
SERVICE_NOT_ALLOWED_FOR_LICENSE8200The requested service is not included in your license.
PORTAL_SERVICE_ERROR8201An error was reported by the portal service. Please contact support if this persists.
PARSING_ERROR8202Failed to parse the provided data. Please check the format and try again.
DATE_NOT_ALLOWED8203The provided date is not allowed. Date must be within the last 5 years.
MONTH_NOT_AVAILABLE8204The requested month is not available.
CONFIGURATION_ERROR8205A configuration error occurred. Please contact support.

Service Codes

KeyValue
crc-service1
ies-service2
nif-name-service3
ce-service4
debt-service5
estado-empresa-service6
rcbev2-service7
cpp-service8
at-docs-service9
at-pi-service10
at-irc-service11
at-iva-dp-service12
at-alerts-service13
at-iva-sa-service14
at-divida-service15
at-iva-enquadramento-service16
at-interacoes-service17
at-aggregator-service18
irs-by-code-service19
irs-by-user-password-service20
responsabilidade-credito-service21
seguro-by-matricula-service22
vehicle-by-nif-service23
ss-no-debt-service24
ss-docToPay-service25
ss-sa-service26
responsabilidade-credito-details-service27
irs-by-user-password-details-service28

Origin Codes

KeyValue
BIZAPIS1
PORTAL2
USER3