Skip to navigation

Store a PDF template

Stores a BlockTemplate for the organization of the API key and returns it with its id. Use the id as templateId in POST /pdf/generate or in formatOptions.templateId of the invoice routes. The template appears in the Console under PDF templates. isDefault: true makes it the default template of the whole organization: every other template of the organization loses the default. Requires an API key with pdf:template:create and purpose user; session keys get 403 SESSION_KEY_FORBIDDEN. Not metered.

Authentication

AuthorizationBearer

API Key authentication. Use sk_live_* for production or sk_test_* for testing.

Request

This endpoint expects an object.
namestringRequired1-100 characters
templatemap from strings to anyRequired
descriptionstringOptional<=500 characters
documentTypestringOptionalDefaults to invoice
sampleDatamap from strings to anyOptional
pageSettingsmap from strings to anyOptional
isDefaultbooleanOptionalDefaults to false

Response

Template stored
idstringformat: "uuid"

Template id — use it as templateId in POST /pdf/generate.

organizationIdstring
namestring
descriptionstring or null
documentTypestring
versionstring
templatemap from strings to any
The stored BlockTemplate.
sampleDatamap from strings to any or null
pageSettingsmap from strings to any or null
isDefaultboolean or null
isActiveboolean or null
countryCodestring or null
isSystemboolean
createdAtdatetime
createdBystring

api-key:<key name> for templates stored through this API.

updatedAtdatetime
updatedBystring

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
413
Content Too Large Error
500
Internal Server Error