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

# How-to: Create a contract via AI

## Overview

Zenskar allows you to automatically create contracts by uploading contract documents in PDF format. Our AI-powered contract ingestion extracts key billing and pricing terms directly from the document and uses them to generate a draft contract in the Zenskar system.

## When to use this method

Use this method when you already have a signed or finalized contract document and want to reduce manual data entry. Zenskar’s AI saves time by parsing the document and populating fields such as:

* Customer details
* Billing cadence
* Payment terms
* Contract start and end dates
* Auto-renewal conditions
* Fees and usage terms

## Steps to upload a contract document for AI processing

1. Navigate to **Contracts** → **AI Contracts** in the Zenskar dashboard.
2. Click the **UPLOAD PDF CONTRACTS** button.
3. Upload the PDF version of your contract.

> 🚧 Note
>
> The extraction model works best on clear, structured PDFs (not scans or images).

4. Once the PDF is uploaded, Zenskar AI will use the default prompt to extract details from the contract document:

   |                                  |                                                                          |
   | :------------------------------- | :----------------------------------------------------------------------- |
   | **Zenskar Default Saved Prompt** | Extract relevant billing information and products from contract details. |

   You can optionally click **CHANGE PROMPT** to select a different extraction prompt, especially if your contract uses a non-standard format. This gives you more control over how key terms are extracted and ensures better alignment with your contract structure.

<Cards columns={1}>
  <Card title="Custom prompts" href="https://docs.zenskar.com/docs/create-a-contract-via-ai#create-a-custom-prompt" icon="fa-book" target="">
    Learn how to use custom prompts.
  </Card>
</Cards>

5. 🔍 **Review** the extracted contract details and **make edits** as needed. You can edit any field as needed before saving the contract.

> 🚧 Note
>
> While Zenskar AI reduces manual work, it is important to review the draft contract.

<Cards columns={1}>
  <Card title="Edit draft contract" href="https://docs.zenskar.com/docs/create-a-contract-via-ai#edit-the-draft-contract" icon="fa-book" target="">
    Learn how to edit the draft contract.
  </Card>
</Cards>

6. Click the **+ Create New Contract** button.

<Image align="center" className="border" border={true} src="https://files.readme.io/582a8b5093d46892ed3642c9e167f990a834ecf57e26db1f294c7048498eae57-upload-contract-documents-for-AI-extraction.gif" />

## How Zenskar AI processes a contract document

When you upload a contract document (typically a PDF), Zenskar AI performs a series of steps to convert the unstructured agreement into a structured, editable contract

<Accordion title="Step 1: Parse the document layout" icon="fa-shoe-prints">
  Zenskar AI analyzes the structure of the uploaded file—identifying headings, sections, tables, and key-value pairs. This step uses natural language processing (NLP) and layout-aware models to understand how information is organized.
</Accordion>

<Accordion title="Step 2: Extract billing-related information" icon="fa-shoe-prints">
  The AI identifies and extracts relevant fields such as:

  * Customer name and contact details

  * Billing cadence (e.g., monthly, annual)

  * Payment terms (e.g., Net 30)

  * Contract start and end dates

  * Auto-renewal clauses

  * Fees, usage terms, and thresholds

  Zenskar AI intelligently analyzes contract language to identify the billable metric: a key input for usage-based pricing. For example, if the contract includes phrases like “per API call” or “based on user count,” Zenskar AI detects them and maps them to Zenskar's contract object.
</Accordion>

<Accordion title="Step 3: Map extracted values to a Zenskar contract" icon="fa-shoe-prints">
  The extracted data is automatically mapped into Zenskar’s contract object. This includes assigning the right values to structured fields like dates, pricing components, and terms.
</Accordion>

<Accordion title="Step 4: Generate a draft contract" icon="fa-shoe-prints">
  A draft contract is created in Zenskar, pre-filled with all extracted fields. This draft serves as a starting point for review and finalization.

  > ❗️ While Zenskar AI reduces manual work, it is important to review the draft contract.
</Accordion>

<br />

## Create a custom prompt

If you're not satisfied with the generated contract, you can guide the AI by writing your own prompt. This gives you more control over how contract terms are extracted and mapped.

To create a custom prompt:

1. After uploading the contract PDF, click **CHANGE PROMPT**.
2. In the dialog that opens, select **Write a custom prompt**.
3. Enter a name for your prompt in the **Prompt name** field.
4. In the **Write your custom prompt here...** field, type your instructions. The following examples should help you get started.

   <Table>
     <thead>
       <tr>
         <th>
           Custom prompt
         </th>

         <th>
           What it does
         </th>
       </tr>
     </thead>

     <tbody>
       <tr>
         <td>
           Use `API Calls` as the usage metric
         </td>

         <td>
           Maps usage-based products to `API Calls` as the billing metric.
         </td>
       </tr>

       <tr>
         <td>
           When extracting product names from the contract, match them only against the following predefined list of three valid product names: "Digital Services", "Digital - Services", "Services - Digital"

           Ignore variations or permutations such as hyphenation or word order differences. If a match is found within the list, normalize the name to "Digital Services".

           Do not create a new product if the extracted name doesn’t match one from the list.
         </td>

         <td>
           This prompt ensures that product names extracted by AI are matched only against a predefined list of three valid products, ignoring naming variations, to prevent creation of duplicates.
         </td>
       </tr>
     </tbody>
   </Table>
5. Click **SAVE PROMPT**.

💡 You can reuse saved prompts later by choosing Saved Prompts instead of writing a new one. Custom prompts are especially useful for handling unique contract formats or business-specific terminology.

<Image align="center" src="https://files.readme.io/88ae351e396959353d3b467fc6f714eaaf38a33dc86830f4f4f8d3507d4e8569-custom-ai-prompt.gif" />

## Edit the draft contract

After uploading a contract document, Zenskar AI generates a draft contract pre-filled with all detected details — including customer information, contract period, products, pricing, and features. You can review and modify this draft before finalizing the contract by clicking the **+ Create New Contract** button.

<Accordion title="Customer and contract information" icon="fa-shoe-prints">
  * **Customer Name** and **Email** are shown based on the uploaded contract.
  * A banner will indicate if the customer or contract is new. Zenskar will automatically create them when the contract is finalized.
  * You can edit contract details by clicking the 🖉 icon next to the **Contract** field.
</Accordion>

<Accordion title="Phases" icon="fa-shoe-prints">
  Each contract has one or more billing phases. By default, Zenskar adds at least one phase extracted from the document.

  * Click the 🖉 icon next to the phase date range to update the start and end dates.
  * Use the **+ Add Phase** or **+ Add Trial Phase** buttons to add additional contract periods (e.g., for renewals or free trials).
</Accordion>

<Accordion title="Features" icon="fa-shoe-prints">
  The **Features** section allows you to configure global contract terms like:

  * Discounts (e.g., “10% off”)
  * Minimum commitment amounts
  * Tax settings

  To update this section, click the **Configure Features** button.
</Accordion>

<Accordion title="Products" icon="fa-shoe-prints">
  Each detected billable item is listed as a **product**. You can:

  * Review and edit the **product name**, **pricing model** (e.g., tiered, per-unit, flat), **quantity**, **unit price**, **billing cadence** (prepaid/postpaid), and **product period**.
  * Click **🖉 Edit** to modify individual product details.
  * Click **+ Add Product** to manually add additional items.
  * Use the **⋮** menu to delete products.
</Accordion>

<Image align="center" className="border" border={true} width="60% " src="https://files.readme.io/16d5f5a30819cef5770cde5a2dd868923ab391c8ba6806a7e1bbab21eb751ca4-ai-contract-edit-draft.png" />

Once you're done editing, proceed to save and publish the contract by clicking the **+ Create New Contract**.
