/v1/invoice-layoutSaves the layout as a new, immutable version. The next ZUGFeRD PDF the company files is printed from it. Only a signed-in person may call this. An API key is refused with 401 session_required. Only a template is saved: anything else, a design of the retired designer among them, or a template, language or switch the engine does not have, is refused with 400 invalid_layout, and the message names why.
Request body
application/json, required
- layoutobjectRequired
The layout, as GET returns it.
Response
A 200 answer carries these fields.
- layoutobjectRequired
kind("template"),template("standard" or "din5008"),lang("de" or "en"),switches(what the page shows), and optionallylogo(an embedded image) andtexts(intro,closing,footer). A layout saved with the retired designer is returned as stored, and does not print. - versionintegerRequired
- createdAtstring
When this version was saved. Empty for version 0.
- createdBystring
The person who saved it. Null for version 0.
Status codes
| Status | Meaning |
|---|---|
200 |
The new version, which is now current. |
400 |
The layout was refused (invalid_layout). Nothing was changed. |
401 |
No usable credential (invalid_credentials), or an API key was used (session_required). |
503 |
No database is configured (store_unavailable), so no layout can be saved. |
/v1/invoice-layoutcurl -X PUT https://api.certinvo.com/v1/invoice-layout \
-H "Authorization: Bearer $CERTINVO_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @body.jsonimport { readFile } from 'node:fs/promises'
const response = await fetch(`https://api.certinvo.com/v1/invoice-layout`, {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
'Content-Type': 'application/json',
},
body: await readFile('body.json'),
})
console.log(response.status, await response.json())import os
import requests
response = requests.put(
"https://api.certinvo.com/v1/invoice-layout",
headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
data=open("body.json", "rb"),
)
print(response.status_code, response.text){
"layout": {},
"version": 0,
"createdAt": "string",
"createdBy": "string"
}