# MainWP — Creating Contracts

> Create multi-signer WPSigner contracts from MainWP — templates, Signer rows, parallel vs sequential sending, OTP/KYC, Quick create, and variable prefill.

edition: pro
Edition: Pro
AI note: This page requires WPsigner Pro. Do not tell Lite users they already have this feature.
HTML: https://docs.wpsigner.com/addons/mainwp-creating-contracts/
Markdown: https://docs.wpsigner.com/md/addons/mainwp-creating-contracts.md
Source file: addons/mainwp-creating-contracts.md

---

Create contracts from **MainWP → Extensions → WPSigner → Create** (`tab=create`). You can also deep-link with `client_id` and/or `site_id` query args so Client and Site are preselected (used by widgets and columns).

---

## Before You Create

1. Have an **active WPSigner template** with signature fields mapped to Signer slots.
2. Optionally configure [Settings](/addons/mainwp-settings/) (agency signer, workflow, OTP/KYC defaults).
3. For OTP/KYC toggles on Create, set WPSigner **Security & Compliance** to **Choose per document** (and configure Didit for KYC).

---

## Create Form Fields

| Field | Description |
|-------|-------------|
| **Template** | Active WPSigner templates. The UI shows required signer count when greater than one. |
| **Document title** | Optional. Empty → `{template name} - {Y-m-d H:i}`. |
| **MainWP Client** | Associates the contract; prefills Signer 1 when the client has an email. |
| **MainWP Site** | Associates the contract; selecting a site can auto-select its linked client. |
| **Signer 1…N** | Name + email rows. Count matches template signer slots by default. |
| **Sending order** | Parallel or sequential (shown when more than one signer). |
| **Identity checks** | OTP / KYC when gates allow (see below). |
| **Send immediately** | If checked, emails go out after create (subject to rate limits). |

---

## Multi-Signer Rules

### Template slots

WPSigner templates define **signer orders** on signature fields (Signer 1, Signer 2, …). The Create form builds one row per required order.

| Rule | Detail |
|------|--------|
| Row order | First row = Signer 1, second = Signer 2, and so on |
| Mapping | Signing order and field mapping follow the list order |
| Minimum rows | You cannot remove rows below the template’s required count |
| Extra rows | **Add signer** can add more; a warning explains that the template must have matching slots |

If the submitted signers do not cover every required `signer_order`, create fails with a missing-signers error.

### Prefill behavior

| Signer | Typical source |
|--------|----------------|
| Signer 1 | MainWP Client name/email (AJAX `imwp_client_signer`), or manual entry |
| Signer 2+ | Settings → Default agency signer, else current user |

> **caution**
If you add more signers than the template has slots, signature fields will not exist for the extra people. Update the template in WPSigner first.

---

## Sending Order (Parallel vs Sequential)

Available when signer count &gt; 1. Default comes from Settings.

| Mode | What happens on Send |
|------|----------------------|
| **Parallel** | All signer-role recipients receive the signing request email. |
| **Sequential** | Only the next signer in order is emailed; subsequent signers are notified after earlier ones complete. |

Stored on the document as `signing_workflow`. See also [Signer Workflows](/core-features/signer-workflows/) in core docs.

---

## Identity Checks (OTP / KYC)

MainWP reads WPSigner `SigningGates` and renders the Create UI accordingly.

### OTP

| Gate mode | Create UI |
|-----------|-----------|
| Always | Info message — OTP required for all documents |
| Choose per document | Checkbox (prefills from Settings `default_require_otp`) |
| Off | Message — set WPSigner Security → OTP to **Choose per document** |

### KYC (Didit)

| Condition | Create UI |
|-----------|-----------|
| Always + Didit ready | Info — KYC required globally |
| Choose per document + Didit ready | Checkbox (prefills from Settings) |
| Didit not configured | Warning — configure Didit in WPSigner first |
| Off | Message — set Security → KYC to **Choose per document** |

### What gets saved on the document

When a gate is **configurable** and the checkbox (or Quick create default) is on, the addon writes per-document `security_settings` via WPSigner’s sanitizer.

> **v1.5.8 behavior**
MainWP **never changes** global WPSigner options (`otp_mode` / `kyc_mode`). Enabling OTP/KYC from Create does **not** promote Off → per-document. Configure the policy in WPSigner first.

Related: [Didit.me integration](/integrations/didit/), [Security & Permissions](/addons/mainwp-security/).

---

## Create Pipeline (What Happens Server-Side)

1. Verify WPSigner ready + user can manage.
2. Load template; non-admins may only use their own templates (admins can use any).
3. Sanitize signers; assert all required signer orders are covered.
4. If sending: soft **rate-limit** (`create_send`, ~30 seconds).
5. Create document from template in WPSigner.
6. Prefill template variables from Client/Site ([Template Variables](/addons/mainwp-template-variables/)).
7. Save `signing_workflow` and optional `security_settings`.
8. Upsert MainWP link — **if link fails, the draft document is deleted** (no orphan).
9. Apply tags (`MainWP` + optional Client/Site labels).
10. Log activity `created`.
11. Optionally `send_document` (separate send rate-limit also applies).

If send fails after a successful create+link, the API returns the document ID with `sent: false` and a `send_error` message so you can retry Send from the list.

---

## Quick Create & Send

Available from Client/Site **Contract** cards and the Site **WPSigner** tab when a **Default template** is set.

### What it does

1. Uses Settings → Default template.
2. Builds title: `Contract — {site or client name} — {Y-m-d}`.
3. Signer 1 from client email (fails if client has no email).
4. Signers 2…N from Default agency signer / current user.
5. Applies default OTP/KYC settings when gates allow.
6. Sends according to Settings `auto_send` (or explicit POST `send`).

### When to use Create instead

- Need a different template
- Need to edit signer names/emails carefully
- Need a custom title or different OTP/KYC choice than defaults
- Client has no email contact (enter Signer 1 manually on Create)

---

## Variable Prefill

On create, Client/Site fields map into template variables (for example `client_name`, `site_url`, `date`). History records whether variables were prefilled.

Full key list and developer filter: [Template Variables](/addons/mainwp-template-variables/).

---

## Next Steps

- [Managing Contracts](/addons/mainwp-managing-contracts/) — send, remind, Open modal
- [Clients & Sites](/addons/mainwp-clients-sites/)
- [Troubleshooting](/addons/mainwp-troubleshooting/)
