Skip to guide content
Guides
How-to guides12 minutes

Contract variables and formatting

Guide details
Last reviewed
2026-10-26

Before you start

  • Prepare reusable contract templates for bookings.
  • Use HTML for flexible contracts with inline signer fields, a source editor, and live browser preview, or PDF for exact uploaded layouts.
  • Use the supported variable catalog to merge real booking, pricing, customer, company, vehicle, and organization values.
  • Use repeat sections like {{#pricing.line_items}} ... {{/pricing.line_items}} in HTML contracts for pricing rows.
  • Use richer contract variables like {{vehicle.niv}}, {{customer.legal_full_name}}, {{company.tax_id}}, and {{booking.additional_driver_count}} when you need legal or operational detail.
  • Use core tax and branding variables like {{customer.tax_id}}, {{customer.tax_legal_name}}, {{company.tax_id}}, {{organization.legal_name}}, {{organization.tax_id}}, and {{organization.logo_url}} when the contract needs RFC, billing, or logo data without depending on Portal.
  • Use {{#booking.additional_drivers}} ... {{/booking.additional_drivers}} in HTML, Markdown, or text templates when the contract must list every extra driver.
  • Use lightweight conditionals like {{#if booking.has_company}} ... {{/if}} and {{#unless booking.has_company}} ... {{/unless}} in HTML, Markdown, or text templates when one contract must adapt between company and individual renters.
  • Set the template as active so it appears when you generate documents.

Steps

Step 1

Open Commercial → Contract Templates

Go to Commercial → Contract Templates to review existing documents or create a new one.

Step 2

Create a template

Create a new template, give it a name, choose the type, and pick one of the two primary modes:

  • HTML for flexible, signer-aware contracts built in Resvo.
  • PDF for exact uploaded legal forms with positioned fields.

Existing Markdown and plain-text templates remain available as existentes formats, but new authoring now centers on HTML and PDF.

Step 3

Add your content

Add your standard terms and insert variables from the editor panel instead of typing raw placeholders manually.

For HTML templates:

  • Edit the source in the HTML editor, use the starter bloques de ejemplo for common blocks, and keep Browser Preview visible while you work.
  • Use scalar variables like {{booking.code}} or {{customer.name}}.
  • Use core legal and tax values like {{customer.tax_id}}, {{customer.tax_legal_name}}, {{company.tax_id}}, {{organization.legal_name}}, {{organization.tax_id}}, {{organization.tax_person_type}}, {{organization.tax_country_code}}, {{organization.tax_legal_structure}}, and {{organization.logo_url}} when the agreement needs RFC, billing, or business-profile branding details.
  • Use repeat sections like {{#pricing.line_items}} ... {{/pricing.line_items}} when you need one row per pricing item.
  • Use repeat sections like {{#booking.additional_drivers}}- {{name}} | {{license_number}} | {{date_of_birth}}{{/booking.additional_drivers}} when your contract needs every attached driver.
  • Use lightweight branching like {{#if booking.has_company}} ... {{/if}} and {{#unless booking.is_company_rental}} ... {{/unless}} for renter-type clauses.
  • Insert inline signer fields such as a required customer name field and a required customer signature field directly from the toolbar.
  • Required signer fields stay visible in preview diagnostics until the signer provides them, and the captured signature image is rendered directly in the final HTML and generated PDF.
  • Use Generated PDF as the export fidelity check, to check page layout, resolved values, and signer fields.

For PDF templates:

  • Bind only scalar variables to mapped fields.
  • Use summary-style scalar fields like {{booking.additional_driver_names}} or {{booking.additional_driver_summary}} instead of repeat sections.
  • Use manual fields for values staff or the signer must complete later.

Legacy Markdown and plain-text templates can still be edited, and you can convert them to HTML when you are ready.

Review the preview to make sure the contract reads the way you expect before saving or sending.

Step 4

Save and manage availability

Save your changes, review any unsupported-token warnings, then set the template as active or default if you want it used automatically.

Use {{booking.inspections.handoff_id}} and {{booking.inspections.return_id}} to identify the rental's handoff and final return. Both references exist before vehicle assignment or inspection scheduling. Rescheduling, cancellation, replacement inspections, vehicle reassignment, and rental lifecycle corrections keep these references. The inspection results and exported evidence PDF display the matching Contract reference, alongside the individual inspection record's identity.

For Long-term rentals, {{booking.inspections.recurring_id_prefix}} followed by 001, 002, and so on identifies numbered recurring checks. {{booking.inspections.recurring_first_id}} supplies the complete first reference before an appointment exists. Numbers are allocated once per rental across all recurring schedules when due checks are registered; they are not calendar-period numbers. Rescheduling or replacing the inspection for the same due check keeps its number. A newly registered due check receives a new number, and canceled or superseded numbers are never reused.

To list already registered checks, use {{booking.inspections.recurring_ids}} in a PDF field, or a repeat section in HTML:

{{#booking.inspections.recurring}}
<p>Inspection {{number}}: {{id}}</p>
{{/booking.inspections.recurring}}

The registered list is empty until due checks exist. A generated contract retains the list captured when it was generated. Use the prefix when the contract needs to refer to future checks.

These references identify operational records. They do not assert inspection completion or acknowledgment of future photos. The customer can sign the inspection itself in its existing flow. Vehicle-swap inspections and unrelated additional checks do not share the rental's handoff or final-return reference.

Rental terms, evidence and document details

The variable library also includes Document, Rental terms, Mileage terms, Return terms, Vehicle insurance, Payment history, Inspection evidence and Amendments. Search a group or variable name and select Insert variable or Insert section. Scalar values also support PDF mappings; repeat sections require HTML, Markdown or text.

  • Document identity: document.reference, document.sequence, document.created_at_formatted. Allocated when generating a document. The template preview has no saved document ID or generation time.
  • Signing: document.is_signed, document.signer_name, document.signed_at_formatted, document.signature_method. Blank before signing. Native signing fills these values in the final artifact using the saved template and booking snapshot. Uploaded and externally signed files keep their original bytes.
  • Mileage: rental_terms.mileage.policy, included_distance, distance_unit, allowance_period, excess_rate_formatted under the same prefix. Daily rules are captured from the effective pickup branch/organization rules at generation. Disabled mileage fees mean unspecified, not unlimited. Long-term values come from the saved terms.
  • Return fees: rental_terms.fuel.*, rental_terms.late_return.*. Daily return branch/organization rules, with explicit currencies and units. These describe configured rules, not charges already incurred. Long-term return-fee values remain blank.
  • Assigned category and insurance: assigned_category.name, vehicle_insurance.provider, vehicle_insurance.policy_number, vehicle_insurance.expires_on. Assigned category is separate from reserved category. Insurance is selected for the assigned vehicle and local rental start date; unknown validity dates leave it blank. This is distinct from the protection plan and does not certify full-rental coverage.
  • Payment/refund history: payment_history.entries. Recorded captures and refunds, with method, time, currency and transaction reference. Refund amounts stay positive and have type refund. Payment status is the status captured at generation.
  • Inspection evidence: inspection_evidence.entries. Actual handoff/return inspections and the latest recorded immutable acceptance version for each execution. An acceptance version is not proof that later edits or future evidence were accepted.
  • Amendments: agreement_amendments.entries. Signed, non-void amendment and extension documents. Historical fields that were not saved remain blank.

Check rental_terms.source and rental_terms.captured_at_formatted. A Daily rule captured today does not establish what was agreed before this document. A Long-term amendment uses pending_recurring_amendment until accepted through its existing workflow. Signed documents are not refreshed from later settings, payments or inspections. Generate the appropriate new agreement or annex for new evidence.

Use rental_terms.mileage_allowances for all Long-term mileage benefits, including renewal frequency, partial allowances, rollover and excess review rules. Do not calculate billed days or total allowance from booking.nights; price rows and the saved recurring agreement retain the actual pricing semantics.

Show signing details only when present:

<p>Document: {{document.reference}}</p>
{{#if document.is_signed}}
<p>Signed by {{document.signer_name}} on {{document.signed_at_formatted}}</p>
{{/if}}

Keep {{field:customer_signature}} as the native signature field when collecting a signature. Signing metadata does not replace consent or a required signature field. Optional source values should use conditional blocks. Deposit formatting now uses the saved deposit currency and displays zero deposits.

Validate your work

  • The template appears in the list with the correct format and status.
  • When you generate a document, the template is available to select.
  • Deactivated templates are no longer offered for new bookings.

Verify the complete document flow

Select the intended rental-mode scope. Check a representative individual and company booking in the preview, resolve missing values and inspect the generated PDF before making the template available. Creating a template does not generate or sign a customer document. Use the booking’s Documents workflow and verify the current signed version there.