/v1/invoices/{id}/archiveReturns every file of the invoice that is kept in the GoBD archive, oldest first. Only a workspace whose plan includes gobd-archive (GET /v1/plan) has files here.
A received invoice keeps the file as it arrived, whatever the verdict, and its check reports. An issued invoice keeps the files we wrote and its check reports, once the check did not reject it. A live file is locked in COMPLIANCE mode until the day after retainUntil: nobody can change or delete it before then. lockMode and lockedUntil are what the bucket answered when it was read back, not what was asked for. A sandbox file is not locked and is removed after 30 days.
state is waiting until the file is written; lastError then says why it is still waiting.
Path parameters
- idstring (uuid)Required
Response
A 200 answer carries these fields.
- invoiceIdstring (uuid)Required
- filesarray of objectRequired
Show 11 child fields
- filestringRequired
original, or the kind of file we made (ubl,cii,zugferd-pdf,gate-report.<run>…). - mediaTypestringRequired
- sha256stringRequired
- environmentstringRequiredOne of
live,sandbox. - statestringRequiredOne of
waiting,archived. - retainUntilstring (date) or nullRequired
The last day the file is kept. Null in the sandbox.
- legalBasisstring or nullRequired
The legal basis the file is kept under
- lockModestring or nullRequired
COMPLIANCEfor a live file, as the bucket answered. Null in the sandbox and while waiting. - lockedUntilstring (date-time) or nullRequired
The lock's end as the bucket answered.
- archivedAtstring (date-time) or nullRequired
- lastErrorstring or nullRequired
Why a waiting file is still waiting.
Status codes
| Status | Meaning |
|---|---|
200 |
{invoiceId, files: [ArchivedFile]}. An invoice with nothing in the archive has an empty list. |
401 |
No usable credential was sent (invalid_credentials). |
404 |
This company filed no invoice with this id (unknown_invoice). |
503 |
This deployment has no database (no_database). |
/v1/invoices/{id}/archivecurl https://api.certinvo.com/v1/invoices/$INVOICE_ID/archive \
-H "Authorization: Bearer $CERTINVO_API_KEY"const invoiceId = '3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a'
const response = await fetch(`https://api.certinvo.com/v1/invoices/${invoiceId}/archive`, {
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"
response = requests.get(
f"https://api.certinvo.com/v1/invoices/{invoice_id}/archive",
headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}"},
)
print(response.status_code, response.text){
"invoiceId": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
"files": [
{
"file": "string",
"mediaType": "string",
"sha256": "string",
"environment": "live",
"state": "waiting",
"retainUntil": "2026-09-17",
"legalBasis": "string",
"lockMode": "string",
"lockedUntil": "2026-09-17T09:30:00Z",
"archivedAt": "2026-09-17T09:30:00Z",
"lastError": "string"
}
]
}