Leases
Documents
PDF

Generate a lease PDF

Generates a PDF document from a lease template with the provided data. Returns the PDF directly as binary with performance headers.

post/leases/{lease_id}/pdf

Request

  • Base URL: https://api.faireplace.com/api
  • URL: https://api.faireplace.com/api/leases/{lease_id}/pdf
  • Auth: HTTP bearer

Path parameters

lease_idstring uuid required
Example:550e8400-e29b-41d4-a716-446655440000

Unique lease ID

Request body

template_idstring uuid required

Document template ID to use

template_type'LeaseContract' | 'Amendment' | 'InventoryReport' | 'RentReceipt' | 'NoticeToVacate' | 'OtherDocument' required

Template type (LeaseContract, Amendment, InventoryReport, etc.)

dataobject required

Data to insert into the template (JSON format)

Example request

{
  "template_id": "550e8400-e29b-41d4-a716-446655440000",
  "template_type": "LeaseContract",
  "data": {
    "tenant_name": "Jean Dupont",
    "property_address": "123 Rue de la Paix, 75001 Paris",
    "rent_amount": 850
  },
  "format_options": {
    "paper_size": "A4",
    "margins": {
      "top": 25,
      "right": 25,
      "bottom": 25,
      "left": 25
    },
    "font_size": 12,
    "add_metadata": true,
    "pdf_standard": "PDF/A-1b",
    "page_ranges": [
      "1-5",
      "10"
    ],
    "custom_form_fields": [
      {
        "field_name": "tenant_signature",
        "field_type": "signature",
        "position": {
          "page": 1,
          "x": 50.5,
          "y": 100,
          "width": 80,
          "height": 20
        },
        "label": "Tenant signature",
        "placeholder": "Sign here",
        "required": true,
        "validation_rules": {
          "min_length": 3,
          "max_length": 50,
          "pattern": "^[A-Za-z\\s]+$"
        },
        "options": [
          "Option 1",
          "Option 2",
          "Option 3"
        ]
      }
    ]
  }
}

Response

PDF generated successfully

Changes

No recorded changes to this operation across all 1 revision of this API.