e-invoicing

Updating invoices

Updating invoices can be used for adding attachments and metadata or adjusting the storage period.

The following diagram gives a detailed overview of the process for updating invoices based on the Archiving business process:

Overview process for updating invoices.

Step 1: Client Sends the JSON to Sovos

The client sends a PATCH request to the /v2/archived-documents/{documentId} endpoint.

To make this request, set the following request body parameters:

Name Type Description
actionCode String Use document.archiveUpdate
metadata Object
attachments Array A list of attachments related to the document
fileName String The name of the file
mimeType String The MIME type of the file
attachmentType String The type of attachment
data String The content of the attachment
customProperties Array A list of custom properties for the document
name String The name of the custom property
value String The value of the custom property
Request Sample
JSON
{
  "actionCode": "document.archiveUpdate",
  "metadata": {
    "attachments": [
      {
        "fileName": "Test-invoice.xml",
        "mimeType": "application/xml",
        "attachmentType": "LegalInvoice",
        "data": "content of invoice as base64 encoded"
      }
    ],
    "customProperties": [
      {
        "name": "AckDt",
        "value": "2021-03-17 10:14:07"
      }
    ]
  }
}
Response Sample
JSON
{
  "timestamp": "1699458506",
  "success": true,
  "status": 202,
  "message": "Document Updated",
  "data": {
    "transactionId": "string",
    "documentId": "string"
  }
}

Step 2: Sovos Updates Invoice

Sovos updates the invoice with the new attachments and metadata. The reference ID of the invoice remains the same.

Step 3: Sovos Returns Invoice Reference

As part of the application response, the client receives an invoice reference (documentId) related to the specific file that has been updated.

Error handling

When handling errors, the client application must follow the Indirect Tax API's error handling principles, as specified in the error handling documentation.

In general, all error codes in the 400 range are client errors, which you need to analyze. After fixing the error, you can resend the request. Error codes 408 and 429 are exceptions: In these cases, you should wait at least 60 seconds before retrying. Error codes in the 500 range are server errors. In that case, resend the request according to the instructions given on the error handling documentation, which also includes a full list of error codes Indirect Tax API can return.