---
title: "Generate rent receipts"
method: POST
path: "/leases/{lease_id}/receipts/generate"
tags: ["Leases"]
---

# Generate rent receipts

`POST /leases/{lease_id}/receipts/generate`

## Request

- Base URL: `https://api.faireplace.com/api`
- URL: `https://api.faireplace.com/api/leases/{lease_id}/receipts/generate`
- Auth: HTTP bearer

Generate rent receipts (quittances/reçus de loyer) for all active tenants of a lease for a given period.

**Art. 21 Loi 89-462**: The landlord must provide a rent receipt free of charge upon tenant request.
The receipt must separate rent and charges. If the full amount has been paid, a "quittance" is issued.
If only partial payment was made, a "reçu" is issued instead.

**Behavior:**
- One receipt is generated per active tenant (lessee) on the lease
- Each tenant's `rent_share` percentage is applied to rent and charges
- If a receipt already exists for the same tenant/period, it is skipped (no duplicates)
- A PDF is automatically generated for each receipt using the Typst template
- The PDF includes: landlord info, tenant info with rent share %, property details, itemized charges, totals, and legal text

**Permissions required:** `leases:write`

## Path parameters

- `lease_id` string, uuid, required

## Request body

- GenerateRentReceipts: Request to generate rent receipts for all active tenants of a lease for a given period. One receipt is generated per active tenant, applying their `rent_share` percentage to calculate their portion of rent and charges.
  - `period_start` string, date, required: Start date of the rental period
  - `period_end` string, date, required: End date of the rental period (must be after period_start)
  - `payments` LesseePayment[], required: Payment amounts per tenant. Determines whether each receipt is a quittance (full) or reçu (partial).
    - `lessee_id` string, uuid, required: ID of the tenant
    - `amount_paid` number, required: Amount paid by this tenant for the period
  - `payment_date` string, date, nullable: Date of payment (optional, shown on the PDF)

## Response `201`

Receipts generated successfully. Returns one receipt per active tenant.

- RentReceipt[]
  - `id` string, uuid, required: Unique identifier of the rent receipt
  - `lease_id` string, uuid, required: ID of the associated lease
  - `lessee_id` string, uuid, required: ID of the tenant this receipt is for
  - `lessee_name` string, required: Full name of the tenant
  - `period_start` string, date, required: Start date of the rental period
  - `period_end` string, date, required: End date of the rental period
  - `rent_amount` number, required: Rent amount for this tenant (adjusted by rent_share)
  - `charges_total` number, required: Total charges amount for this tenant (adjusted by rent_share)
  - `charges_detail` RentReceiptChargeDetail[], required: Itemized charge breakdown by category
    - `category_name` string, required: Name of the charge category (e.g., "Eau froide", "Chauffage collectif")
    - `category_id` string, uuid, nullable: UUID of the charge category (if available)
    - `amount` number, required: Amount for this charge line, adjusted by tenant's rent share
    - `calculation_method` string, required: Billing method used for this charge (e.g., Provision, Forfait)
  - `total_due` number, required: Total amount due (rent + charges)
  - `amount_paid` number, required: Amount actually paid by the tenant
  - `document_type` string, required: QUITTANCE (full payment) or RECU (partial payment)
  - `has_pdf` boolean, required: Whether a PDF has been generated for this receipt

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/faireplace/apis/faireplace-property-management-api.md) · [All operations](https://skmtc.dev/faireplace/apis/faireplace-property-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/faireplace/apis/faireplace-property-management-api/revisions/69de39762919?raw)
