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.
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.
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
successbefore you read the rest of the response. If it'sfalse, skipdataand go straight toerrors. - Step 2 - Decide how your code responds
-
Use
statusto 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
errorsarray. UsesubCodeto decide how your code responds andmessagefor logging. Ignoredataon error. - Step 4 - Include trace details in support requests
-
Include
timestamp,uuid, andmessagein your support requests to help Sovos trace the call.
See API Responses.
Handle an error
After you get an error, follow this two-step strategy:
- Step 1 - Understand the error
-
-
Check the
statusto find the problem category. -
Check the
subCodein theerrorsarray to find the specific cause. -
Decide how to handle it in your code.
-
- Step 2 - Fix and retry
-
-
Fix the request or the file and send it again.
-
If the error comes from Sovos, try again later.
-
If the problem continues, contact Sovos support and include the
timestamp,uuid, andmessagefrom 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 |
| 401 | Unauthorized |
Your token is missing, invalid, or expired. The response has no Refresh your token and retry. |
| 403 | Forbidden |
Your token is valid but you don't have permission for the resource or operation. Check Don't retry without changing your token or request. The response has no |
| 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. |
| 500 | Server error |
An unexpected error occurred on the server. Retry using exponential backoff. If the problem persists, contact Sovos support and include the |
- 400 Bad request example
-
Your request failed validation. A common cause is trying to import data for a filing that's already in
Completestatus.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[].subCodeproperty 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-401401 Authentication required. The bearer token is missing, malformed, expired, or fails signature/issuer validation. -
Get a new token and retry the request.
-
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-403403 Access denied. The token is authenticated but doesn't satisfy the authorization policy required by the endpoint. -
Check that the company in your request belongs to the account of your token.
-
Use a token that is authorized for that account and company. Don't retry with the same token.
FILING-404404 The referenced filing doesn't exist, no filings match, or no result files are available. -
Check the filing ID.
-
If you listed filings, widen your filters. If you asked for result files, check that they are available for this filing.
IMPORT-404404 The referenced import doesn't exist, no imports exist for the company, or no result files are available. -
Check the import ID.
-
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_FOUND400 The import profile doesn't exist or is not visible to the caller. -
Use an import profile ID that exists and that your token can access.
-
Send the request again.
IMPORT-400-FILING_NOT_FOUND400 The filing doesn't exist, is not visible to the caller, or belongs to a different company than the one in the request. -
Use a filing ID that exists, that your token can access, and that belongs to the company in the request.
-
Send the request again.
IMPORT-400-FILING_COMPLETE400 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-01400 company.id is required. Add
company.idto the request.VAL-400-02400 company.id must be a valid UUID. Set
company.idto a valid UUID.VAL-400-03400 metadata.importProfileIdis required.Add
metadata.importProfileIdto the request.VAL-400-04400 metadata.filingIdis required.Add
metadata.filingIdto the request.VAL-400-05400 metadata.filingIdmust be a valid UUID.Set
metadata.filingIdto a valid UUID.VAL-400-06400 metadata.importProfileIdmust be a valid UUID.Set
metadata.importProfileIdto a valid UUID.VAL-400-07400 metadata.filenameis required.Add
metadata.filenameto the request.VAL-400-08400 metadata.contentTypeis required.Add
metadata.contentTypeto the request.VAL-400-12400 metadata.fileSizemust be greater than zero.Set
metadata.fileSizeto a value greater than zero.SRVR-500500 Unexpected server-side error. Try again. If the problem continues, contact Sovos support and include the uuid from the response.
Filing.CompanyNotFound400 Company was not found for the specified account. -
Use a company ID that exists for the account in your token.
-
Send the request again.
-
- Import validation errors
-
Error code Description What to do ProfileNotFoundImport Profile not found.
-
Check that the import profile still exists and is active.
-
Start a new import with a valid import profile ID.
If the profile exists, contact Sovos support.
AccountInactiveOrMissingThe 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.
DoubleAdministrationSelectedThis account has duplicate administration entries. Contact your administrator to resolve the duplicate administration codes.
-
Find the administrations in your account that use the same administration code.
-
Contact Sovos support and send the duplicate administration codes, so Sovos can resolve them.
-
Start a new import.
ProfileDocumentColumnMissingThe 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.
-
Make sure the import profile column is present in the imported file, or select "Import no columns" as null in the import profile.
-
Start a new import.
ImportFieldNotFoundThe file is missing the row n, field X value. Edit the file and add the missing column or select "Import no columns" as null.
-
Edit the file and add the missing column, or select "Import no columns" as null in the import profile.
-
Start a new import.
ImportFieldIsEmptyThe file is missing the required data for row n. Edit the file and add the missing data.
-
Edit the file and add the missing data in the row shown.
-
Start a new import.
ImportIncorrectDataTypeThe 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.
ImportTranslationTableNoMatchThe translation table is missing a value.
-
Add the missing value to the translation table, or edit the file to use a value that is in the translation table.
-
Start a new import.
ImportTranslationTableMultipleMatchesA 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 valueOriginalVATcodeUsed= A1 matches more than one row in the translation table. Edit the imported file or the translation table to remove the duplication.-
Edit the imported file or the translation table, so that each code matches only one row.
-
Start a new import.
ImpossibleErrorRow n has a data problem. Check the values in this row against the expected format, and correct the file.
-
Check the values in the row shown against the expected format, for example, an amount with too many digits.
-
Correct the file
-
Start a new import.
If no unexpected content stands out, contact Sovos support.
ImportFailedToAttachAdministrationRow 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.
-
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.
-
Start a new import.
MissingImportFieldInJsonA field required by the JSON/import mapping is missing. Contact your administrator to correct the import profile. -
Check that the file includes every extra column (ExtraValue1 to ExtraValue5) used in the import profile, and that none was renamed or removed.
-
If the file is complete, contact support Sovos to correct the import profile.
-
Start a new import.
EnableHardBlockInvoice blocked by an account-level hard-block policy set by the administrator.
-
Check the invoice named in the error against the policy set for your account.
-
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.
-
Start a new import.
ImportFieldInvalidDateValueDate year is earlier than the minimum supported year (1753).
-
Correct the date in the row shown to a year of 1753 or later.
-
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 ImportMalformedJsonThe 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. -
Make sure the file is valid JSON.
-
Check for missing or mismatched brackets, braces, or quotes, and that the root is a complete object.
-
Start a new import.
ImportTrailingJsonContentSource contains content after the root JSON object. -
Remove the content after the closing brace of the root object, so that the file ends immediately after it.
-
Start the process again.
ImportMissingSourceEntriesSource JSON doesn't contain 'sourceEntries'. -
Add the
sourceEntriessection to the JSON file. -
Start a new import.
ImportDuplicateSourceEntriesSource contains more than one 'sourceEntries' property. -
Keep only one
sourceEntriesproperty in the JSON file. -
Start a new import.
ImportSourceEntriesNotArray'sourceEntries' must be a JSON array. -
Define
sourceEntriesas an array: "sourceEntries": [...]. -
Start a new import.
ImportInvalidRecordEach source entry must be a JSON object. -
Enclose each transaction in source Entries in curly braces {} so that it is a valid JSON object.
-
Start a new import.
ImportUnsupportedTemplateNo JSON mapper template is registered for key '{key}'. -
Contact Sovos support, so that they can check whether the template for this JSON format is correct.
-
Start a new import.
ImportInvalidSourceStreamSource stream must be readable. Upload the file again. If the problem continues, contact Sovos support.
ImportInvalidDestinationStreamDestination stream must be writable. Upload oad the file again. If the problem continues, contact Sovos support.
ImportSourceReadFailedFailed to read the source JSON stream. Upload the file again. If the problem continues, contact Sovos support.
ImportDestinationWriteFailedFailed to write the mapped JSON stream. Upload the file again. If the problem continues, contact Sovos support.
ImportCorruptInboundInbound 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_JOB500 Sovos couldn't generate the report. Try again later. Try again later. If the problem continues, contact Sovos support. REPORT-404-FILING_NOT_FOUND404 Sovos couldn't generate the report. Requested filing could not be found. REPORT-500-JOB_CANCELLED500 Sovos couldn't generate the report. Try again later. REPORT-500-INTERNAL_ERROR500 Sovos couldn't generate the report. Try again later. REPORT-500-INVALID_REPORT_CONFIGURATION500 Sovos couldn't generate the report. Try again later. REPORT-500-RESOURCE_NOT_FOUND500 Sovos couldn't generate the report. Try again later.
