---
title: "POST /api/document-templates"
method: POST
path: "/api/document-templates"
tags: ["api", "document-templates"]
---

# POST /api/document-templates

`POST /api/document-templates`

Create a Document Template

## Request body

- union
  - object
    - `title` string, required — The title of the document template
    - `type` 'ticket' | 'invoice' | 'voucher' | 'member-card' | 'header-card', required — The type of document template for which document it should be used. ticket = The document template will be used on tickets. invoice = The document template will be used on invoices.
    - `target` 'thermal' | 'digital' | 'wallet', required — The target of document template for which targets it should be used.
    - `template` object
      - `svg` string — An SVG string representing the design of the document template
      - `json` object — A JSON object representing the exact design of the document template
      - `wallet` union — The wallet settings of the template
        - object — The apple wallet settings of the document template
          - `logo` string, nullable — The Logo of the Apple Wallet Template
          - `backgroundColor` string, nullable — The background color of the Apple Wallet Template
          - `foregroundColor` string, nullable — The foreground color of the Apple Wallet Template
          - `labelColor` string, nullable — The label color of the Apple Wallet Template
          - `codeType` 'Code128' | 'QR' — The type of the code which appears on the Apple Wallet Ticket
          - `backFields` object[] — The back fields of the template
            - `label` string, required — The label of the back field
            - `value` string, required — The value of the back field
            - `fieldType` 'text' | 'phone' | 'link', required — The type of the back field
          - `genericFields` object — The root fields of the template
            - `auxiliaryStoreIdentifiers` number[] — The auxiliary store identifiers
            - `bagPolicyUrl` string — The bag policy URL
            - `transitInformationUrl` string — The transit information URL
            - `parkingInformationUrl` string — The parking information URL
            - `purchaseParkingUrl` string — The purchase parking URL
            - `directionsInformationUrl` string — The directions information URL
            - `orderFoodUrl` string — The order food URL
            - `merchandiseUrl` string — The merchandise URL
            - `accessibilityUrl` string — The accessibility URL
            - `footerBackgroundColor` string, nullable — The footer background color
          - `semanticFields` object — The semantic fields of the template
            - `playlistIds` string[] — The playlist identifiers
          - `frontFields` object
            - `section` 'section_or_block' | 'block' | 'section_and_block'
          - `ticketTypeLabel` string, nullable — The custom ticket type label of the Apple Wallet Template
          - `stripImage` string, nullable — The strip image of the Apple Wallet Template
          - `artworkImage` string, nullable — The artwork image of the Apple Wallet Template
          - `logoArea` 'event_name' — Whether Event Name as Logo Text is enabled
        - object — The google wallet settings of the document template
          - `logo` string, nullable — The Logo of the Google Wallet Template
          - `backgroundColor` string, nullable — The background color of the Google Wallet Template
          - `codeType` 'Code128' | 'QR' — The type of the code which appears on the Google Wallet Ticket
          - `backFields` object[] — The back fields of the template
            - `label` string, required — The label of the back field
            - `value` string, required — The value of the back field
            - `fieldType` 'text' | 'phone' | 'link', required — The type of the back field
          - `stripImage` string, nullable — The strip image of the Google Wallet Template
    - `format` 'CUSTOM', required
    - `localization` object — Localization of the document template for multiple languages
    - `dimension` object, required
      - `width` number, float, required — The width in pt of the document template
      - `height` number, float, required — The height in pt of the document template
  - object
    - `title` string, required — The title of the document template
    - `type` 'ticket' | 'invoice' | 'voucher' | 'member-card' | 'header-card', required — The type of document template for which document it should be used. ticket = The document template will be used on tickets. invoice = The document template will be used on invoices.
    - `target` 'thermal' | 'digital' | 'wallet', required — The target of document template for which targets it should be used.
    - `template` object
      - `svg` string — An SVG string representing the design of the document template
      - `json` object — A JSON object representing the exact design of the document template
      - `wallet` union — The wallet settings of the template
        - object — The apple wallet settings of the document template
          - `logo` string, nullable — The Logo of the Apple Wallet Template
          - `backgroundColor` string, nullable — The background color of the Apple Wallet Template
          - `foregroundColor` string, nullable — The foreground color of the Apple Wallet Template
          - `labelColor` string, nullable — The label color of the Apple Wallet Template
          - `codeType` 'Code128' | 'QR' — The type of the code which appears on the Apple Wallet Ticket
          - `backFields` object[] — The back fields of the template
            - `label` string, required — The label of the back field
            - `value` string, required — The value of the back field
            - `fieldType` 'text' | 'phone' | 'link', required — The type of the back field
          - `genericFields` object — The root fields of the template
            - `auxiliaryStoreIdentifiers` number[] — The auxiliary store identifiers
            - `bagPolicyUrl` string — The bag policy URL
            - `transitInformationUrl` string — The transit information URL
            - `parkingInformationUrl` string — The parking information URL
            - `purchaseParkingUrl` string — The purchase parking URL
            - `directionsInformationUrl` string — The directions information URL
            - `orderFoodUrl` string — The order food URL
            - `merchandiseUrl` string — The merchandise URL
            - `accessibilityUrl` string — The accessibility URL
            - `footerBackgroundColor` string, nullable — The footer background color
          - `semanticFields` object — The semantic fields of the template
            - `playlistIds` string[] — The playlist identifiers
          - `frontFields` object
            - `section` 'section_or_block' | 'block' | 'section_and_block'
          - `ticketTypeLabel` string, nullable — The custom ticket type label of the Apple Wallet Template
          - `stripImage` string, nullable — The strip image of the Apple Wallet Template
          - `artworkImage` string, nullable — The artwork image of the Apple Wallet Template
          - `logoArea` 'event_name' — Whether Event Name as Logo Text is enabled
        - object — The google wallet settings of the document template
          - `logo` string, nullable — The Logo of the Google Wallet Template
          - `backgroundColor` string, nullable — The background color of the Google Wallet Template
          - `codeType` 'Code128' | 'QR' — The type of the code which appears on the Google Wallet Ticket
          - `backFields` object[] — The back fields of the template
            - `label` string, required — The label of the back field
            - `value` string, required — The value of the back field
            - `fieldType` 'text' | 'phone' | 'link', required — The type of the back field
          - `stripImage` string, nullable — The strip image of the Google Wallet Template
    - `localization` object — Localization of the document template for multiple languages
    - `format` 'A4' | 'LETTER' | 'LEGAL' | 'BOARDING-PASS' | 'PLASTIC-CARD' | 'CARD' | 'LABEL' | 'APPLE' | 'GOOGLE', required — The format of document template for the dimensions.

## Response `201`

Created

- POSTDocumentTemplatesCreateADocumentTemplate201Response
  - `_id` string, required — The ID of the document template
  - `sellerId` string, required — The ID of the seller of the document template
  - `title` string, required — The title of the document template
  - `type` 'ticket' | 'invoice' | 'voucher' | 'member-card' | 'header-card', required — The type of document template for which document it should be used. ticket = The document template will be used on tickets. invoice = The document template will be used on invoices.
  - `target` 'thermal' | 'digital' | 'wallet', required — The target of document template for which targets it should be used.
  - `template` object
    - `svg` string — An SVG string representing the design of the document template
    - `json` object — A JSON object representing the exact design of the document template
    - `wallet` union — The wallet settings of the template
      - object — The apple wallet settings of the document template
        - `logo` string, nullable — The Logo of the Apple Wallet Template
        - `backgroundColor` string, nullable — The background color of the Apple Wallet Template
        - `foregroundColor` string, nullable — The foreground color of the Apple Wallet Template
        - `labelColor` string, nullable — The label color of the Apple Wallet Template
        - `codeType` 'Code128' | 'QR' — The type of the code which appears on the Apple Wallet Ticket
        - `backFields` object[] — The back fields of the template
          - `label` string, required — The label of the back field
          - `value` string, required — The value of the back field
          - `fieldType` 'text' | 'phone' | 'link', required — The type of the back field
        - `genericFields` object — The root fields of the template
          - `auxiliaryStoreIdentifiers` number[] — The auxiliary store identifiers
          - `bagPolicyUrl` string — The bag policy URL
          - `transitInformationUrl` string — The transit information URL
          - `parkingInformationUrl` string — The parking information URL
          - `purchaseParkingUrl` string — The purchase parking URL
          - `directionsInformationUrl` string — The directions information URL
          - `orderFoodUrl` string — The order food URL
          - `merchandiseUrl` string — The merchandise URL
          - `accessibilityUrl` string — The accessibility URL
          - `footerBackgroundColor` string, nullable — The footer background color
        - `semanticFields` object — The semantic fields of the template
          - `playlistIds` string[] — The playlist identifiers
        - `frontFields` object
          - `section` 'section_or_block' | 'block' | 'section_and_block'
        - `ticketTypeLabel` string, nullable — The custom ticket type label of the Apple Wallet Template
        - `stripImage` string, nullable — The strip image of the Apple Wallet Template
        - `artworkImage` string, nullable — The artwork image of the Apple Wallet Template
        - `logoArea` 'event_name' — Whether Event Name as Logo Text is enabled
      - object — The google wallet settings of the document template
        - `logo` string, nullable — The Logo of the Google Wallet Template
        - `backgroundColor` string, nullable — The background color of the Google Wallet Template
        - `codeType` 'Code128' | 'QR' — The type of the code which appears on the Google Wallet Ticket
        - `backFields` object[] — The back fields of the template
          - `label` string, required — The label of the back field
          - `value` string, required — The value of the back field
          - `fieldType` 'text' | 'phone' | 'link', required — The type of the back field
        - `stripImage` string, nullable — The strip image of the Google Wallet Template
  - `dimension` object — An object indicating the dimensions of the document template
    - `width` number, float, required — The width in pt of the document template
    - `height` number, float, required — The height in pt of the document template
  - `format` 'A4' | 'LETTER' | 'LEGAL' | 'BOARDING-PASS' | 'PLASTIC-CARD' | 'CARD' | 'LABEL' | 'CUSTOM' | 'APPLE' | 'GOOGLE', required — The format of document template for the dimensions.
  - `localization` object — Localization of the document template for multiple languages
  - `createdAt` string, date-time — An ISO timestamp indicating when the document template was created
  - `updatedAt` string, date-time — An ISO timestamp indicating when the document template was updated

## Other responses

- `400` — Bad Request
- `401` — Unauthorized

---

[API](https://skmtc.net/vivenu/apis/vivenu-api.md) · [All operations](https://skmtc.net/vivenu/apis/vivenu-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vivenu/vivenu-api/revisions/36be0dca14e7/schema)
