Best practices
Follow these recommendations to avoid common problems when working with the External Partner API.
Data upload
- Check filing status before importing
-
Before you start a transaction import, check that the target filing has a
Preparationstatus. Filings in theIn ProgressorCompletestatus don't accept imports. If the filing isComplete, the API returns a 400 error with subcodeIMPORT-400-FILING_COMPLETE.Use GET /v1/indirect-tax/vat-filing/filings/{filingId} to confirm the status before calling the import endpoint.
- Uploading files with the uploadURL
-
The
uploadUrlis a time-limited URL. Send your PUT request directly to S3, not to the Sovos API. Don't include anAuthorizationheader. The time-limited URL carries its own authentication. Adding anAuthorizationheader to the PUT request causes it to fail.If you send a new transaction import for a filing that's still in
Preparationstatus, Sovos deletes the earlier import's data and replaces it with the new import's data. The most recent import is always the source of truth for that filing period. There's no conflict or rejection if you submit more than one import for the same filing. - Upload files before the time-limited URL expires
-
The
uploadUrlthe API returns when you start an import expires 10 minutes after the API returns it. If you miss the window, start a new import to get a fresh URL.Don't store the upload URL for later use. Generate the URL immediately before you upload, and upload it right away.
- Set the Content-Type header
-
Set the
Content-Typeheader toapplication/jsonand make sure the file size matches themetadata.fileSizevalue you sent in thePOSTrequest.
Processing and monitoring
After you upload your file, poll GET /v1/indirect-tax/vat-filing/transactions/imports/{importId} every 30 seconds to check the import status. Keep polling until the status reaches COMPLETED or FAILED.
Result files
Download URLs for result files expire 10 minutes after the API returns them. Each file has its own accessUrl and expirationDate. Check the expiration date before downloading, and call the result files endpoint again if a URL has expired.
Sovos deletes filing result files 30 days after the filing reaches Complete. Download and store any filing result files you need before that window closes.
The 30-day deletion window applies to all filing-related data after reaching Complete. Confirm with Sovos whether the same window applies to import result files.
