Reference
Document template variants
POST/api/v1/document-template-variantsAdd document template variant
Adds a further variant (layout) to a document type. Version 1 is a copy of copy_from's active version, or of the built-in layout when copy_from is omitted. The key is made from the name; a name whose key the document type already has is refused. A new variant serves no project type and is not the default until assign_document_template_project_types or make_default_document_template_variant says so -- so it changes no document yet. catalog.manage only.scope catalog
Body (JSON)
| document_typerequired | one of quote, order_confirmation, service_spec, terms, dpa, service_report, invoice, sepa_mandate, commission_statement, credit_note |
| namerequired | stringe.g. "Kurzfassung". |
| copy_from | stringA variant of the same document type to copy, from list_document_templates. |
Response 200
| variant | object |
| variant.id | string |
| variant.document_type | string |
| variant.key | string |
| variant.name | string |
| variant.is_default | boolean |
| variant.language | string | null |
| variant.project_types[] | object[] |
| variant.project_types[].id | string |
| variant.project_types[].key | string |
| variant.project_types[].name | string |
| variant.active_version | object | null |
| variant.active_version.template | string |
| variant.active_version.version | integer |
| variant.active_version.name | string |
| variant.active_version.created_at | string |
| variant.active_version.created_by | string | null |
| variant.version_count | integer |
| variant.latest_version | integer | null |
| variant.url | string |
Schema
{
"type": "object",
"properties": {
"variant": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"document_type": {
"type": "string"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"is_default": {
"type": "boolean"
},
"language": {
"type": [
"string",
"null"
]
},
"project_types": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"key",
"name"
],
"additionalProperties": false
}
},
"active_version": {
"anyOf": [
{
"type": "object",
"properties": {
"template": {
"type": "string"
},
"version": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"name": {
"type": "string"
},
"created_at": {
"type": "string"
},
"created_by": {
"type": [
"string",
"null"
]
}
},
"required": [
"template",
"version",
"name",
"created_at",
"created_by"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"version_count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"latest_version": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"url": {
"type": "string"
}
},
"required": [
"id",
"document_type",
"key",
"name",
"is_default",
"language",
"project_types",
"active_version",
"version_count",
"latest_version",
"url"
],
"additionalProperties": false
}
},
"required": [
"variant"
],
"additionalProperties": false
}Refusals are problems with a code — see Errors.
PATCH/api/v1/document-template-variants/{id}Rename document template variant
Renames a variant. Only its display name changes; its key, versions and routing stay. catalog.manage only.scope catalog
Path
| idrequired | stringThe variant's id, from list_document_templates. |
Body (JSON)
| namerequired | string |
Response 200
| variant | object |
| variant.id | string |
| variant.document_type | string |
| variant.key | string |
| variant.name | string |
| variant.is_default | boolean |
| variant.language | string | null |
| variant.project_types[] | object[] |
| variant.project_types[].id | string |
| variant.project_types[].key | string |
| variant.project_types[].name | string |
| variant.active_version | object | null |
| variant.active_version.template | string |
| variant.active_version.version | integer |
| variant.active_version.name | string |
| variant.active_version.created_at | string |
| variant.active_version.created_by | string | null |
| variant.version_count | integer |
| variant.latest_version | integer | null |
| variant.url | string |
Schema
{
"type": "object",
"properties": {
"variant": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"document_type": {
"type": "string"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"is_default": {
"type": "boolean"
},
"language": {
"type": [
"string",
"null"
]
},
"project_types": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"key",
"name"
],
"additionalProperties": false
}
},
"active_version": {
"anyOf": [
{
"type": "object",
"properties": {
"template": {
"type": "string"
},
"version": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"name": {
"type": "string"
},
"created_at": {
"type": "string"
},
"created_by": {
"type": [
"string",
"null"
]
}
},
"required": [
"template",
"version",
"name",
"created_at",
"created_by"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"version_count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"latest_version": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"url": {
"type": "string"
}
},
"required": [
"id",
"document_type",
"key",
"name",
"is_default",
"language",
"project_types",
"active_version",
"version_count",
"latest_version",
"url"
],
"additionalProperties": false
}
},
"required": [
"variant"
],
"additionalProperties": false
}Refusals are problems with a code — see Errors.
DELETE/api/v1/document-template-variants/{id}Remove document template variant
Deletes a variant with all its versions, for good. Refused once any document was rendered from one of its versions, and for the default variant -- make another one the default first. Project types routed to it fall back to the default. catalog.manage only.scope catalog
Path
| idrequired | stringThe variant's id, from list_document_templates. |
Response 200
| deleted | boolean |
| variant | string |
Schema
{
"type": "object",
"properties": {
"deleted": {
"type": "boolean"
},
"variant": {
"type": "string"
}
},
"required": [
"deleted",
"variant"
],
"additionalProperties": false
}Refusals are problems with a code — see Errors.
POST/api/v1/document-template-variants/{id}/defaultMake default document template variant
Makes a variant its document type's default: the one used for documents whose project type has no variant of its own, or that have no project type. The previous default stops being it. A change applies to documents created from then on; quotes, order confirmations, service reports and invoices already sent or issued keep the version they were frozen with. catalog.manage only.scope catalog
Path
| idrequired | stringThe variant's id, from list_document_templates. |
Response 200
| variant | object |
| variant.id | string |
| variant.document_type | string |
| variant.key | string |
| variant.name | string |
| variant.is_default | boolean |
| variant.language | string | null |
| variant.project_types[] | object[] |
| variant.project_types[].id | string |
| variant.project_types[].key | string |
| variant.project_types[].name | string |
| variant.active_version | object | null |
| variant.active_version.template | string |
| variant.active_version.version | integer |
| variant.active_version.name | string |
| variant.active_version.created_at | string |
| variant.active_version.created_by | string | null |
| variant.version_count | integer |
| variant.latest_version | integer | null |
| variant.url | string |
Schema
{
"type": "object",
"properties": {
"variant": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"document_type": {
"type": "string"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"is_default": {
"type": "boolean"
},
"language": {
"type": [
"string",
"null"
]
},
"project_types": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"key",
"name"
],
"additionalProperties": false
}
},
"active_version": {
"anyOf": [
{
"type": "object",
"properties": {
"template": {
"type": "string"
},
"version": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"name": {
"type": "string"
},
"created_at": {
"type": "string"
},
"created_by": {
"type": [
"string",
"null"
]
}
},
"required": [
"template",
"version",
"name",
"created_at",
"created_by"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"version_count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"latest_version": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"url": {
"type": "string"
}
},
"required": [
"id",
"document_type",
"key",
"name",
"is_default",
"language",
"project_types",
"active_version",
"version_count",
"latest_version",
"url"
],
"additionalProperties": false
}
},
"required": [
"variant"
],
"additionalProperties": false
}Refusals are problems with a code — see Errors.
POST/api/v1/document-template-variants/{id}/project-typesAssign document template project types
Sets which project types use this variant for its document type. The list replaces the current assignment; an empty list removes them all. A project type assigned here leaves whichever other variant of the same document type had it. Project types by key (list_project_types) or id. A change applies to documents created from then on; quotes, order confirmations, service reports and invoices already sent or issued keep the version they were frozen with. catalog.manage only.scope catalog
Path
| idrequired | stringThe variant's id, from list_document_templates. |
Body (JSON)
| project_typesrequired | string[]Project type keys or ids. [] for none. |
Response 200
| variant | object |
| variant.id | string |
| variant.document_type | string |
| variant.key | string |
| variant.name | string |
| variant.is_default | boolean |
| variant.language | string | null |
| variant.project_types[] | object[] |
| variant.project_types[].id | string |
| variant.project_types[].key | string |
| variant.project_types[].name | string |
| variant.active_version | object | null |
| variant.active_version.template | string |
| variant.active_version.version | integer |
| variant.active_version.name | string |
| variant.active_version.created_at | string |
| variant.active_version.created_by | string | null |
| variant.version_count | integer |
| variant.latest_version | integer | null |
| variant.url | string |
Schema
{
"type": "object",
"properties": {
"variant": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"document_type": {
"type": "string"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"is_default": {
"type": "boolean"
},
"language": {
"type": [
"string",
"null"
]
},
"project_types": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"key",
"name"
],
"additionalProperties": false
}
},
"active_version": {
"anyOf": [
{
"type": "object",
"properties": {
"template": {
"type": "string"
},
"version": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"name": {
"type": "string"
},
"created_at": {
"type": "string"
},
"created_by": {
"type": [
"string",
"null"
]
}
},
"required": [
"template",
"version",
"name",
"created_at",
"created_by"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"version_count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"latest_version": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"url": {
"type": "string"
}
},
"required": [
"id",
"document_type",
"key",
"name",
"is_default",
"language",
"project_types",
"active_version",
"version_count",
"latest_version",
"url"
],
"additionalProperties": false
}
},
"required": [
"variant"
],
"additionalProperties": false
}Refusals are problems with a code — see Errors.