> ## Documentation Index
> Fetch the complete documentation index at: https://docs.platform.arb.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Render a PDF from a template with optional files and JSON data

> Renders a PDF using a template, placeholder values, optional uploaded files, and optional JSON data. **Multipart parts** (order not strict): 1. `documentID` (text, required), 2. `placeholders` (JSON; may be `{}`), 3. zero or more file parts named `file.<fieldName>` (PNG images), 4. zero or more data parts named `data.<fieldName>` (JSON objects for HTML templates only).
**Template types**: - **PDF templates**: Support placeholders and file.* parts only. Reject data.* parts. - **HTML templates**: Support placeholders, file.* parts, and data.* parts.
The entire request body must not exceed **10 MiB**.




## OpenAPI

````yaml api-reference/pdfs.yaml post /templates/render
openapi: 3.0.3
info:
  title: pdfs
  description: >-
    The PDFs service takes a stored PDF template and fills in placeholder fields
    with the values you give it. It then sends back the completed PDF for you to
    save, email, or use however you want.
  version: 1.0.0
servers:
  - url: https://pdfs.platform.arb.inc
security: []
tags:
  - name: /
  - name: markdown
  - name: pleadings
  - name: templates
paths:
  /templates/render:
    post:
      tags:
        - templates
      summary: Render a PDF from a template with optional files and JSON data
      description: >
        Renders a PDF using a template, placeholder values, optional uploaded
        files, and optional JSON data. **Multipart parts** (order not strict):
        1. `documentID` (text, required), 2. `placeholders` (JSON; may be `{}`),
        3. zero or more file parts named `file.<fieldName>` (PNG images), 4.
        zero or more data parts named `data.<fieldName>` (JSON objects for HTML
        templates only).

        **Template types**: - **PDF templates**: Support placeholders and file.*
        parts only. Reject data.* parts. - **HTML templates**: Support
        placeholders, file.* parts, and data.* parts.

        The entire request body must not exceed **10 MiB**.
      operationId: postTemplatesRender
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - documentID
                - placeholders
              properties:
                documentID:
                  type: string
                  description: Identifier of the template to render.
                  example: mailParkingNotice
                placeholders:
                  type: object
                  description: >-
                    JSON object mapping placeholder names to string values. May
                    be empty (`{}`).
                  additionalProperties:
                    type: string
                  example:
                    url: https://portal.arb.inc
                    inviteCode: ABC-123-XYZ
                    qrCodeBase64: iVBORw0KGgoAAAANSUhEUgAA...
                data:
                  type: object
                  description: >
                    **Dynamic JSON data parts** (HTML templates only): zero or
                    more parts named `data.<fieldName>` (e.g. `data.content`,
                    `data.ticket`). Each part contains JSON-encoded data
                    (objects, arrays, primitives). PDF templates will reject
                    data.* parts.
                  additionalProperties:
                    type: object
                  example:
                    content:
                      ticketNumber: ABC123
                      licensePlate: XYZ9999
                      state: XX
                      lotName: Test Parking Lot
                      lotStreet: 123 Example Street
                      lotCity: Sample City
                      lotState: XX
                      lotZip: '12345'
                      entryPlateImageUrl: https://example.com/images/plate1.jpg
                      entryVehicleImageUrl: https://example.com/images/vehicle1.jpg
                      exitPlateImageUrl: https://example.com/images/plate2.jpg
                      exitVehicleImageUrl: https://example.com/images/vehicle2.jpg
                      totalAmount: '99.99'
                files:
                  type: object
                  description: >
                    **Dynamic file parts**: zero or more parts named
                    `file.<fieldName>` (e.g. `file.qrCode`, `file.attachment`).
                    For PDF templates: must match template field names. For HTML
                    templates: available as {fieldName}Base64 in template.
                  additionalProperties:
                    type: string
                    format: binary
            encoding:
              placeholders:
                contentType: application/json
              data:
                contentType: application/json
              files:
                contentType: image/png
      responses:
        '200':
          description: PDF successfully rendered.
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '404':
          description: Template not found.
          content:
            text/plain:
              schema:
                type: string
                example: template not found
        '410':
          description: Invalid file name.
          content:
            text/plain:
              schema:
                type: string
                example: File names must begin with 'file.'
        '411':
          description: Invalid file type.
          content:
            text/plain:
              schema:
                type: string
                example: Invalid file type.
        '413':
          description: Request or part too large (over 10 MiB).
          content:
            text/plain:
              schema:
                type: string
                example: request entity too large

````