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

# Link a contract model

> Attach a contract template to a quote template to auto-generate contracts when quotes are accepted

{/* AUDIT NOTE: Nav confirmed: Template (top-level sidebar item). Template edit opens the same full form as creation. Contract models are configured in the Payment & Terms section → Contract & Terms sub-section, which shows a table (Status / Name / Editable / Mandatory / Actions) with an Add button. There is no dropdown — you click Add to attach contract models. Save button confirmed as "Save". */}

Linking a contract model to a template allows Qwoty to automatically generate contracts with populated data when quotes are accepted. You configure the association at the template level, and every quote created from that template inherits the contract model.

## Prerequisites

* You have created or have access to a contract model with the required variables
* You have **Admin** or **Manager** permissions
* The template you want to configure already exists

## Access the template settings

In the left side menu, click **Template**, then click the **⋯** menu next to the template you want to configure and select **Edit**.

## Link the contract model

<Steps>
  <Step title="Locate the contract section">
    Scroll to the **Payment & Terms** section and expand **Contract & Terms**.
  </Step>

  <Step title="Add the contract model">
    In the **Contract & Terms** table, click **Add** and select the contract model you want to link from the list.

    <Info>Only active contract models appear in the list. If you don't see the model you need, verify it's not archived.</Info>
  </Step>

  <Step title="Save the template">
    Click **Save** to apply the changes.
  </Step>
</Steps>

## What happens next

All new quotes created from this template will automatically use the linked contract model. When a quote reaches the **Accepted** status, Qwoty generates a contract using the model and populates it with data from the quote and customer records.

Existing quotes created before you linked the contract model are not affected. You must manually assign a contract model to those quotes if needed. {/* TODO: verify if manual assignment is possible */}

## Troubleshooting

<AccordionGroup>
  <Accordion title="The contract model dropdown is empty">
    Verify that you have created at least one contract model and that it is not archived. Navigate to **Contracts** > **Models** {/* TODO: verify menu path */} to check.
  </Accordion>

  <Accordion title="Changes don't apply to existing quotes">
    Contract model assignments happen at quote creation. Update the template, then create a new quote to test the configuration.
  </Accordion>

  <Accordion title="Contract variables show as blank after acceptance">
    Check that the contract model variables match available quote and customer fields. Missing or misnamed variables like `{{quote.totla}}` instead of `{{quote.total}}` will not populate.
  </Accordion>
</AccordionGroup>

## Related resources

<CardGroup cols={2}>
  <Card title="Create a contract model" icon="file-contract" href="/user-guide/orders-contracts/how-tos/create-contract">
    Build contract templates with dynamic variables
  </Card>

  <Card title="Create a template" icon="table-layout" href="/user-guide/templates/how-tos/create-quote-template">
    Set up a new quote template with catalog and pricing
  </Card>

  <Card title="Contract model variables" icon="brackets-curly" href="/user-guide/orders-contracts/introduction">
    Reference list of available dynamic variables
  </Card>

  <Card title="Quote statuses" icon="list-check" href="/user-guide/quotes/reference/lifecycle">
    Understand quote lifecycle and status transitions
  </Card>
</CardGroup>
