GET
/v1/invoices/{id}/archive/{file}Returns one archived file, read from the bucket by the version that was locked, as it was archived. Its sha256 is checked on the way: a file whose bytes differ is never returned. Each read is added to the invoice’s history as api:archive-read, with the file and its sha256. Where one invoice has several files of one name (the check reports of several checks), the newest is returned.
Path parameters
- idstring (uuid)Required
- filestringRequired
A
filefromGET /v1/invoices/{id}/archive, such asoriginal,ciiorubl.
Status codes
| Status | Meaning |
|---|---|
200 |
The file, with the media type it was archived with. |
401 |
No usable credential was sent (invalid_credentials). |
404 |
This company filed no invoice with this id (unknown_invoice), or the invoice has no archived file of this name (not_archived). |
409 |
The file is waiting to be written to the archive (not_archived_yet), or it is a file we made that the newest check no longer accepts (invoice_rejected, invoice_not_validated, invoice_changed_since_check), the same refusal every download gives. It stays locked in the archive. An invoice already sent is decided by the check it was sent with, while that check accepted it. |
502 |
The bucket returned bytes that are not the archived file (archive_file_changed). Nothing was returned. |
503 |
This deployment has no archive bucket (archive_not_configured) or no database (no_database), or the bucket did not hand the file back (archive_unavailable). The file is still archived. |
GET
/v1/invoices/{id}/archive/{file}Example
curl https://api.certinvo.com/v1/invoices/$INVOICE_ID/archive/$ARCHIVE_FILE \
-H "Authorization: Bearer $CERTINVO_API_KEY"const invoiceId = '3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a'
const archiveFile = 'value'
const response = await fetch(`https://api.certinvo.com/v1/invoices/${invoiceId}/archive/${archiveFile}`, {
headers: {
Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
},
})
console.log(response.status, await response.json())import os
import requests
invoice_id = "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a"
archive_file = "value"
response = requests.get(
f"https://api.certinvo.com/v1/invoices/{invoice_id}/archive/{archive_file}",
headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}"},
)
print(response.status_code, response.text)200
application/octet-stream
The body is the file itself (application/octet-stream).
Success response