Zum Inhalt

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_typerequiredone of quote, order_confirmation, service_spec, terms, dpa, service_report, invoice, sepa_mandate, commission_statement, credit_note
namerequiredstringe.g. "Kurzfassung".
copy_fromstringA variant of the same document type to copy, from list_document_templates.

Response 200

variantobject
variant.idstring
variant.document_typestring
variant.keystring
variant.namestring
variant.is_defaultboolean
variant.languagestring | null
variant.project_types[]object[]
variant.project_types[].idstring
variant.project_types[].keystring
variant.project_types[].namestring
variant.active_versionobject | null
variant.active_version.templatestring
variant.active_version.versioninteger
variant.active_version.namestring
variant.active_version.created_atstring
variant.active_version.created_bystring | null
variant.version_countinteger
variant.latest_versioninteger | null
variant.urlstring
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

idrequiredstringThe variant's id, from list_document_templates.

Body (JSON)

namerequiredstring

Response 200

variantobject
variant.idstring
variant.document_typestring
variant.keystring
variant.namestring
variant.is_defaultboolean
variant.languagestring | null
variant.project_types[]object[]
variant.project_types[].idstring
variant.project_types[].keystring
variant.project_types[].namestring
variant.active_versionobject | null
variant.active_version.templatestring
variant.active_version.versioninteger
variant.active_version.namestring
variant.active_version.created_atstring
variant.active_version.created_bystring | null
variant.version_countinteger
variant.latest_versioninteger | null
variant.urlstring
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

idrequiredstringThe variant's id, from list_document_templates.

Response 200

deletedboolean
variantstring
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

idrequiredstringThe variant's id, from list_document_templates.

Response 200

variantobject
variant.idstring
variant.document_typestring
variant.keystring
variant.namestring
variant.is_defaultboolean
variant.languagestring | null
variant.project_types[]object[]
variant.project_types[].idstring
variant.project_types[].keystring
variant.project_types[].namestring
variant.active_versionobject | null
variant.active_version.templatestring
variant.active_version.versioninteger
variant.active_version.namestring
variant.active_version.created_atstring
variant.active_version.created_bystring | null
variant.version_countinteger
variant.latest_versioninteger | null
variant.urlstring
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

idrequiredstringThe variant's id, from list_document_templates.

Body (JSON)

project_typesrequiredstring[]Project type keys or ids. [] for none.

Response 200

variantobject
variant.idstring
variant.document_typestring
variant.keystring
variant.namestring
variant.is_defaultboolean
variant.languagestring | null
variant.project_types[]object[]
variant.project_types[].idstring
variant.project_types[].keystring
variant.project_types[].namestring
variant.active_versionobject | null
variant.active_version.templatestring
variant.active_version.versioninteger
variant.active_version.namestring
variant.active_version.created_atstring
variant.active_version.created_bystring | null
variant.version_countinteger
variant.latest_versioninteger | null
variant.urlstring
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.