PDF templates for receivables

Monite offers several built-in PDF templates for receivables. Each entity can set the default template in the entity settings. The templates can be customized to include the entity logo.

List the available templates

To get a list of available templates, call GET /document_templates:

curl 'https://api.sandbox.monite.com/v1/document_templates' \
  -H 'Authorization: Bearer ACCESS_TOKEN'

The response contains a list of the templates with some internal metadata. The fields of note are id (template ID), template (HTML content of the template), and preview (a preview image link). The template ID can be used later to set the default template.

{
  "data": [
    {
      "document_type": "receivable",
      "language": "EN",
      "name": "classic",
      "template": "... HTML content of the template ...",
      "template_type": "block",
      "preview": "https://s3.amazonaws.com/link/to/image.png",
      "id": "94f9280b-d7d2-48ca-8290-3727d1b61861",
      "created_at": "2022-07-11T08:55:54.591602+00:00",
      "updated_at": "2022-07-11T08:55:54.591623+00:00",
      "blocks": [
        "entity_info",
        "entity_contact",
        ...
      ]
    },
    ...
  ]
}

Customize the templates with entity logo

PDFs templates for receivables include the entity logo. You can upload the logo by using PATCH /entities/{entity_id}/logo:

curl -X PATCH 'https://api.sandbox.monite.com/v1/entities/aea39...912/logo' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -F [email protected]/to/image.png

Preview the templates

The preview fields in the response from GET /document_templates contain the links to preview the templates with sample data:

{
  "data": [
    {
      ...,
      "preview": "https://s3.amazonaws.com/link/to/image1.png",
      "id": "94f9280b-d7d2-48ca-8290-3727d1b61861",
      ...
    },
    {
      ...,
      "preview": "https://s3.amazonaws.com/link/to/image2.png",
      "id": "b9767779-562c-40d7-9604-6fc8f8986dff",
      ...
    },
    ...
  ]
}

Set the default template

Entities can set or change the default PDF template at any time. The specified template will be used for all new receivables created by the entity. Existing PDFs previously generated by the entity are not affected.

To set the default template, call PATCH /entities/{entity_id}/settings and provide the template ID in the request body:

curl -X PATCH 'https://api.sandbox.monite.com/v1/entities/aea39...912/settings' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{
       "template": {
         "receivables_pdf_template_id": "b9767779-562c-40d7-9604-6fc8f8986dff"
       }
     }'

Did this page help you?