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.
name
template
description
documentType
sampleData
pageSettings
isDefault
Response
Template stored
id
Template id — use it as templateId in POST /pdf/generate.
organizationId
name
description
documentType
version
template
The stored BlockTemplate.
sampleData
pageSettings
isDefault
isActive
countryCode
isSystem
createdAt
createdBy
api-key:<key name> for templates stored through this API.
updatedAt
updatedBy
Errors
400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
413
Content Too Large Error
500
Internal Server Error
