> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.withpaygent.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.withpaygent.com/_mcp/server.

# Orders & Invoicing

An **order** is the contract between you and a customer — which agents they use, when billing runs, and how they pay. **Invoices** are generated automatically from active orders. You don't create invoices manually; Paygent creates them when billing runs.

## How it flows

`Create order (Draft)` → `Add agents as lines` → `Activate order` → `Billing runs → invoice created` → `Send / edit / mark paid`

## Before you start

Make sure you have:

* ✓ At least one **Customer** with a billing address
* ✓ **Agents** with pricing configured (and optional plans)
* ✓ Optional: **Settings → Taxes**, **Settings → Email**, **Settings → Integrations** (Stripe for payment links)

---

## Part 1 — Create an order

Sidebar → **Orders** → **Create Order**. The wizard has three steps.

### Step 1 — Order Info

Pick the customer, optionally a billing contact, and give the order a name. The order name is for your team — customers see it on invoices too.

* **Customer** — required. Billing address comes from the customer record.
* **Contact (optional)** — who receives invoice emails. Use **Add Contact** if none exist yet.
* **Order name** — required (e.g. "Acme Corp — Annual Support").

### Step 2 — Order details

Set when billing runs, how long the order lasts, and whether to email invoices automatically.

| Field                         | What it means                                                              |
| ----------------------------- | -------------------------------------------------------------------------- |
| **Billing day**               | Day of the month billing runs (1–31).                                      |
| **Payment due days**          | Days after invoice date until payment is due (default 30).                 |
| **Order start date**          | When the subscription begins.                                              |
| **Order has no end date**     | Keep ON for ongoing subscriptions. Turn OFF to set an end date or term.    |
| **Invoice email to customer** | Auto-send on billing: off, invoice only, or invoice + Stripe payment link. |
| **Taxes (optional)**          | Customer tax defaults apply automatically when available.                  |

### Step 3 — Lines

Add the agents this customer is subscribing to. Each line is one agent (product). You can pick a billing plan or use default agent pricing.

* Click **ADD LINE** → search agents → **Add N Agent(s)**
* Per line: choose **Billing Plan** (Standard / Custom) or "No plan (use default pricing)"
* If the agent includes **credit benefits** on platform fee, configure **Prepaid wallet settings** (rollover, overage) on this step
* Click **Done** — order saves as **Draft**

---

## Part 2 — Activate the order

Draft orders don't bill. Open the order you just created and click **Activate**.

You can **Edit** a draft order anytime. Once active, use **Deactivate** to pause billing. The order detail page also has an **Invoices** tab showing invoices for that customer.

---

## Part 3 — Invoices (automatic)

When billing runs on an active order, Paygent creates an invoice with line items from usage, platform fees, seat fees, and taxes. Find invoices under sidebar **Invoices** or on the order's **Invoices** tab.

### What you can do with an invoice

| Action                    | Description                                                     |
| ------------------------- | --------------------------------------------------------------- |
| **Send Email**            | Email the invoice PDF to the customer (needs Settings → Email). |
| **Download**              | Get a PDF copy for your records.                                |
| **Edit Invoice**          | Adjust lines, taxes, or dates — unpaid invoices only.           |
| **Mark as paid**          | Record payment and release any pending wallet credits.          |
| **Record Payment**        | Log bank transfer, cash, check, etc. with amount and reference. |
| **Generate Payment Link** | Stripe checkout link (needs Stripe connected).                  |

> **Warning**
>
> **Paid invoices are locked.** Once marked paid, an invoice cannot be edited. Double-check line items on unpaid invoices using **Edit Invoice** before confirming payment.

## Editing an unpaid invoice

Open the invoice → **Edit Invoice**. You can update:

* Invoice date, due date, contract ID, invoice number
* Customer name, GSTIN, billing address, place of supply
* Line items — description, period, quantity, rate, HSN/SAC
* Tax lines and payment terms / notes

## Orders with credit wallets

If an order line includes agents with **credit benefits** (bundled credits on platform fee), configure wallet settings on the Lines step. When an invoice is generated, credits post as **pending**. When you **Mark as paid**, they move to the customer's available balance.

Full wallet guide: [Credits & Wallets](/documentation/introduction/credits-and-wallets)

---

## Example: onboarding a new customer

1. Create customer "Acme Corp" with billing address in Customers.
2. Orders → Create Order → pick Acme, name "Acme — Support Agent Annual".
3. Set billing day 1st, payment due 30 days, start today, no end date.
4. Add line: Support Agent, Pro Plan. Click Done.
5. Open order → Activate.
6. After billing runs → Invoices → open invoice → Send Email or Mark as paid.

## Checklist

* ✓ Customer exists with billing address
* ✓ Order created (3 steps) with at least one agent line
* ✓ Order activated
* ✓ Invoice appeared after billing cycle
* ✓ Invoice sent or marked paid

**Related:** [Plans](/documentation/introduction/plans) · [Subscription Fees](/documentation/introduction/subscription-fees) · [Taxes](/documentation/introduction/taxes) · [Credits & Wallets](/documentation/introduction/credits-and-wallets) · [Billable Metrics](/documentation/introduction/billable-metrics)