Filing

Error handling

Use HTTP status codes and error details to understand why a request failed and what to do next.

The External Partner API returns error objects when a request fails. These error objects provide the information you need to respond.

Note:

For key terms used on this page, see API concepts.

Error objects

When a request fails, the response includes an errors array. Each item in the array is an ErrorItem object with message and subCode fields.

Field Type Description
message string Human-readable explanation of the problem
subCode string Machine-readable code to decide how to respond and to provide to support

Use subCode in your error-handling code to find the specific cause of the error. The subCode value stays the same across API versions. Use message for logging and debugging.

Note:

The 401 and 403 responses don't include the data field. The 400, 404, and 500 responses include the data field set to null.

Read an error response

Step 1 - Check the success field
Check success before you read the rest of the response. If it's false, skip data and go straight to errors.
Step 2 - Decide how your code responds
Use status to decide how your code responds. For example, retry when the status is 500, and refresh your token when it's 401.
Step 3 - Read the errors array
Iterate the errors array. Use subCode to decide how your code responds and message for logging. Ignore data on error.
Step 4 - Include trace details in support requests
Include timestamp, uuid, and message in your support requests to help Sovos trace the call.
Note:

See API Responses.

Handle an error

After you get an error, follow this two-step strategy:

Step 1 - Understand the error
  1. Check the status to find the problem category.

  2. Check the subCode in the errors array to find the specific cause.

  3. Decide how to handle it in your code.

Step 2 - Fix and retry
  1. Fix the request or the file and send it again.

  2. If the error comes from Sovos, try again later.

  3. If the problem continues, contact Sovos support and include the timestamp, uuid, and message from response.

HTTP status codes

Code Meaning What to do
200 Success

Process the response.

400 Bad request

Your request failed validation. Check the errors array for details.

A common cause is trying to import data for a filing that's already in Complete status.

401 Unauthorized

Your token is missing, invalid, or expired. The response has no data field.

Refresh your token and retry.

403 Forbidden

Your token is valid but you don't have permission for the resource or operation. Check errors[].subCode to find the specific problem.

Don't retry without changing your token or request. The response has no data field.

404 Not found

Check that the ID in your request is correct. The resource doesn't exist, has no data, or isn't visible to your token. data is null.

500 Server error

An unexpected error occurred on the server. data is null, and errors has at least one item.

Retry using exponential backoff. If the problem persists, contact Sovos support and include the uuid from the response.

400 Bad request example

Your request failed validation. A common cause is trying to import data for a filing that's already in Complete status.

JSON
{
        "success": false,
        "status": 400,
        "message": "Bad request",
        "timestamp": 1776333600000,
        "uuid": "a1b2c3d4-e5f6-7890-ab12-cdef34567890",
        "data": null,
        "errors": [
            {
            "message": "The filing is already complete. Transaction imports are not allowed.",
            "subCode": "IMPORT-400-FILING_COMPLETE"
            }
        ]
        }
404 Not found example

The resource doesn't exist or isn't visible to your token. Check that the ID in your request is correct.

JSON
{
        "success": false,
        "status": 404,
        "message": "Filing not found",
        "timestamp": 1776333600000,
        "uuid": "e5f6a7b8-c9d0-1234-ef01-567890123456",
        "data": null,
        "errors": [
            {
            "message": "No filing exists for the given company and filing id",
            "subCode": "FILING-404"
            }
        ]
        }

Types of errors

Authentication errors

Authentication errors use the errors[].subCode property in the response to find the specific cause of the error. For more details, see Known subcodes.

Note:

To get your credentials, contact Sovos. Sovos sets up credentials manually.

Known subCodes

Sovos returns these API-level errors directly in the API response. Each row shows the HTTP status, what the error means, and what to do.

subCode HTTP status Description What to do
AUTH-401 401 Authentication required. The bearer token is missing, malformed, expired, or fails signature/issuer validation.
  1. Get a new token and retry the request.

  2. Check that you send the token in the Authorization header as a bearer token, that it hasn't expired, and that it belongs to an account.

AUTH-403 403 Access denied. The token is authenticated but doesn't satisfy the authorization policy required by the endpoint.
  1. Check that the company in your request belongs to the account of your token.

  2. Use a token that is authorized for that account and company. Don't retry with the same token.

FILING-404 404 The referenced filing doesn't exist, no filings match, or no result files are available.
  1. Check the filing ID.

  2. If you listed filings, widen your filters. If you asked for result files, check that they are available for this filing.

IMPORT-404 404 The referenced import doesn't exist, no imports exist for the company, or no result files are available.
  1. Check the import ID.

  2. If you listed imports, check that imports exist for the company. If you asked for result files, check that they are available for this import.

IMPORT-400-PROFILE_NOT_FOUND 400 The import profile doesn't exist or is not visible to the caller.
  1. Use an import profile ID that exists and that your token can access.

  2. Send the request again.

IMPORT-400-FILING_NOT_FOUND 400 The filing doesn't exist, is not visible to the caller, or belongs to a different company than the one in the request.
  1. Use a filing ID that exists, that your token can access, and that belongs to the company in the request.

  2. Send the request again.

IMPORT-400-FILING_COMPLETE 400 The upload URL can't be generated because the filing is already in status COMPLETE.

Start the import on a filing that isn't complete.

VAL-400-01 400 company.id is required.

Add company.id to the request.

VAL-400-02 400 company.id must be a valid UUID.

Set company.id to a valid UUID.

VAL-400-03 400 metadata.importProfileId is required.

Add metadata.importProfileId to the request.

VAL-400-04 400 metadata.filingId is required.

Add metadata.filingId to the request.

VAL-400-05 400 metadata.filingId must be a valid UUID.

Set metadata.filingId to a valid UUID.

VAL-400-06 400 metadata.importProfileId must be a valid UUID.

Set metadata.importProfileId to a valid UUID.

VAL-400-07 400 metadata.filename is required.

Add metadata.filename to the request.

VAL-400-08 400 metadata.contentType is required.

Add metadata.contentType to the request.

VAL-400-12 400 metadata.fileSize must be greater than zero.

Set metadata.fileSize to a value greater than zero.

SRVR-500 500 Unexpected server-side error.

Try again. If the problem continues, contact Sovos support and include the uuid from the response.

Filing.CompanyNotFound 400 Company was not found for the specified account.
  1. Use a company ID that exists for the account in your token.

  2. Send the request again.

Import validation errors
Error code Description What to do
ProfileNotFound

Import Profile not found.

  1. Check that the import profile still exists and is active.

  2. Start a new import with a valid import profile ID.

If the profile exists, contact Sovos support.

AccountInactiveOrMissing

The authenticated account is inactive or couldn't be found.

Check that the account of your token is active. If it was deactivated or removed, contact Sovos support.

DoubleAdministrationSelected

This account has duplicate administration entries. Contact your administrator to resolve the duplicate administration codes.

  1. Find the administrations in your account that use the same administration code.

  2. Contact Sovos support and send the duplicate administration codes, so Sovos can resolve them.

  3. Start a new import.

ProfileDocumentColumnMissing

The value in row n, field X has an invalid format. Make sure the import profile column is present in the imported file or select "Import no columns" as null.

  1. Make sure the import profile column is present in the imported file, or select "Import no columns" as null in the import profile.

  2. Start a new import.

ImportFieldNotFound

The file is missing the row n, field X value. Edit the file and add the missing column or select "Import no columns" as null.

  1. Edit the file and add the missing column, or select "Import no columns" as null in the import profile.

  2. Start a new import.

ImportFieldIsEmpty

The file is missing the required data for row n. Edit the file and add the missing data.

  1. Edit the file and add the missing data in the row shown.

  2. Start a new import.

ImportIncorrectDataType

The value in row n, column X has an invalid format and couldn't be parsed into the expected data type.

  • For currency amounts, use a decimal point, for example, 400,755.52.

  • For dates, use the format configured in the import profile (For example, dd/mm/yyyy).

  • For numeric fields, use numbers only.

  • For boolean fields, use "true" or "false."

Correct the value in the row and column with invalid values.

ImportTranslationTableNoMatch

The translation table is missing a value.

  1. Add the missing value to the translation table, or edit the file to use a value that is in the translation table.

  2. Start a new import.

ImportTranslationTableMultipleMatches

A customer tax code matches more than one row in the translation table. The translation table converts a code from one system into another, so each code needs to match only one row. Example: In Field VATCode, the value OriginalVATcodeUsed = A1 matches more than one row in the translation table. Edit the imported file or the translation table to remove the duplication.

  1. Edit the imported file or the translation table, so that each code matches only one row.

  2. Start a new import.

ImpossibleError

Row n has a data problem. Check the values in this row against the expected format, and correct the file.

  1. Check the values in the row shown against the expected format, for example, an amount with too many digits.

  2. Correct the file

  3. Start a new import.

If no unexpected content stands out, contact Sovos support.

ImportFailedToAttachAdministration

Row n is missing information needed to link to an Administration code. This can happen for one of two reasons:

  • The row doesn't have an Administration code.
  • The Administration code isn't linked to a VAT Code or a Company Code.

Check the uploaded file to make sure it includes the Administration code, the VAT Code, and the Company Code.

  1. Check that the file includes the Administration code, the VAT Code, and the Company Code in the row shown, and that the Administration code is linked to a VAT Code and a Company Code.

  2. Start a new import.

MissingImportFieldInJson A field required by the JSON/import mapping is missing. Contact your administrator to correct the import profile.
  1. Check that the file includes every extra column (ExtraValue1 to ExtraValue5) used in the import profile, and that none was renamed or removed.

  2. If the file is complete, contact support Sovos to correct the import profile.

  3. Start a new import.

EnableHardBlock

Invoice blocked by an account-level hard-block policy set by the administrator.

  1. Check the invoice named in the error against the policy set for your account.

  2. If you don't have to import the invoice, remove it from the file. If you have to import the invoice, contact Sovos support to review the policy.

  3. Start a new import.

ImportFieldInvalidDateValue

Date year is earlier than the minimum supported year (1753).

  1. Correct the date in the row shown to a year of 1753 or later.

  2. Start a new import.

JSON mapper errors

These errors describe errors in the structure of your JSON file. You can find them in the import result files, not in the API response, so they have no HTTP status. To download the import result files, use Get import result files.

Error code Description What to do
ImportMalformedJson The source JSON file is invalid. Possible causes: Source JSON is malformed, source JSON root is not an object, source JSON root object is incomplete, or '{array}' is incomplete.
  1. Make sure the file is valid JSON.

  2. Check for missing or mismatched brackets, braces, or quotes, and that the root is a complete object.

  3. Start a new import.

ImportTrailingJsonContent Source contains content after the root JSON object.
  1. Remove the content after the closing brace of the root object, so that the file ends immediately after it.

  2. Start the process again.

ImportMissingSourceEntries Source JSON doesn't contain 'sourceEntries'.
  1. Add the sourceEntries section to the JSON file.

  2. Start a new import.

ImportDuplicateSourceEntries Source contains more than one 'sourceEntries' property.
  1. Keep only one sourceEntries property in the JSON file.

  2. Start a new import.

ImportSourceEntriesNotArray 'sourceEntries' must be a JSON array.
  1. Define sourceEntries as an array: "sourceEntries": [...].

  2. Start a new import.

ImportInvalidRecord Each source entry must be a JSON object.
  1. Enclose each transaction in source Entries in curly braces {} so that it is a valid JSON object.

  2. Start a new import.

ImportUnsupportedTemplate No JSON mapper template is registered for key '{key}'.
  1. Contact Sovos support, so that they can check whether the template for this JSON format is correct.

  2. Start a new import.

ImportInvalidSourceStream Source stream must be readable.

Upload the file again. If the problem continues, contact Sovos support.

ImportInvalidDestinationStream Destination stream must be writable.

Upload oad the file again. If the problem continues, contact Sovos support.

ImportSourceReadFailed Failed to read the source JSON stream.

Upload the file again. If the problem continues, contact Sovos support.

ImportDestinationWriteFailed Failed to write the mapped JSON stream.

Upload the file again. If the problem continues, contact Sovos support.

ImportCorruptInbound Inbound file error. Possible causes: The inbound file artifact is missing, the inbound file state is corrupt, or a single inbound file was expected but found {n}.

Upload the file again. If the problem continues, contact Sovos support.

Report generation errors

These errors happen while Sovos generates the report. Most come from Sovos, not from your file.

Error code HTTP status Description What to do
REPORT-500-INVALID_JOB 500 Sovos couldn't generate the report. Try again later. Try again later. If the problem continues, contact Sovos support.
REPORT-404-FILING_NOT_FOUND 404 Sovos couldn't generate the report. Requested filing could not be found.
REPORT-500-JOB_CANCELLED 500 Sovos couldn't generate the report. Try again later.
REPORT-500-INTERNAL_ERROR 500 Sovos couldn't generate the report. Try again later.
REPORT-500-INVALID_REPORT_CONFIGURATION 500 Sovos couldn't generate the report. Try again later.
REPORT-500-RESOURCE_NOT_FOUND 500 Sovos couldn't generate the report. Try again later.