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

# Quote and billing automations

> Start workflows when a quote is accepted or an invoice goes overdue, act on quotes and subscriptions from a workflow, and work with quotes through Stella and MCP.

Every quote and billing moment is a [workflow trigger](/automation/workflows/triggers), and workflows get actions to draft, send and bill quotes. Stella, your AI teammate, and MCP clients get tools to read billing and work with quotes. In the workflow pickers, all of these sit under a **Revenue** group.

## Triggers

Each trigger runs on the **customer record** the quote or invoice belongs to, so the steps after it (update a property, create a task, enroll in a sequence, send an email) act on that record.

| Trigger | Fires when | Filter |
| - | - | - |
| **Quote Status Changed** | A quote is sent, viewed, accepted, declined, voided or expires. | **Status**: any of Sent, Viewed, Accepted, Declined, Expired, Void. Empty means every change. |
| **Payment Succeeded** | An invoice is paid, by an autopay charge or by the customer paying the link. | |
| **Payment Failed** | An autopay charge fails. The invoice stays open until it's paid. | |
| **Invoice Overdue** | An open invoice passes its due date. Checked daily, and fires once per invoice. | |
| **Subscription Changed** | A subscription starts, changes (seats, plan, discount, status, cancellation) or is canceled. A renewal that only moves the period forward doesn't count. | **Change**: any of Started, Updated, Canceled. Empty means every change. |
| **Trial Ending** | Three days before a subscription's free trial ends. | |
| **Contract Up for Renewal** | Once per term, when a contract comes within its notice days of its end, whether it renews or ends. | |

The billing triggers come from your Stripe account in real time, and fire only for invoices and subscriptions Custral can link to one of your customer records.

### What each trigger hands to later steps

Type `{{` in a later step to pick these. Amounts are in cents (minor units).

| Trigger | Fields |
| - | - |
| **Quote Status Changed** | Quote number, Quote status, Quote link, Contact name, Contact email, Why they declined |
| **Payment Succeeded**, **Payment Failed** | Invoice number, Invoice total, Amount due, Currency, Pay link, Customer name, Customer email, Due date |
| **Invoice Overdue** | The invoice fields above, plus Days overdue |
| **Subscription Changed** | What changed, Plan, Subscription status, Seats, MRR, Currency, Billing interval, Trial ends |
| **Trial Ending** | Plan, Subscription status, Seats, MRR, Currency, Billing interval, Trial ends |
| **Contract Up for Renewal** | Contract, Contract name, Term ends, Days left, Renews automatically, Recurring amount, Currency, Billing interval |

## Actions

| Action | Does |
| - | - |
| **Create Draft Quote** | Drafts a quote on a customer record from catalog products at catalog prices, with one **Quantity** for every product. Optional contact name and email, a whole-quote discount (**Percent** or **Amount**; **Once**, **Several months** or **Forever**) and **Way to pay** (Workspace default, Autopay or Send invoices). Later steps can read its number and link. |
| **Send Quote** | Marks a quote sent and emails its link to the quote's contact. **Send from** picks the mailbox; leave it empty to send from the quote creator's mailbox. Subject and message are optional. Usually points at the quote a Create Draft Quote step made. |
| **Bill Next Instalment Now** | Bills an accepted quote's earliest unbilled dated instalment today: charged on autopay, or invoiced. Use it for milestone billing, such as "bill the second half when the project goes live". |
| **Apply Discount to Subscription** | Adds a discount to the customer's running subscription, from its next invoice. Percent or amount; once, several months or forever. |
| **Enroll in Collections** | Enrolls an overdue invoice's customer in a collections sequence, carrying the invoice (number, amount, pay link) so the emails can name it. A customer already being chased is left alone. This is the step the seeded [collections](/revenue/receivables-and-collections#collections) workflow uses. |

A discount amount is typed in the quote's currency: `50` for \$50, and `20` for 20%.

<Warning>
  **Bill Next Instalment Now** and **Apply Discount to Subscription** change what a customer pays. They're allowed in workflows because a person set the workflow up, the same way Send Email is. All five actions preview in **Try it** without writing anything.
</Warning>

### Example: thank a customer who accepts

<Steps>
  <Step title="Trigger">
    **Quote Status Changed**, Status: Accepted.
  </Step>

  <Step title="Update the record">
    Set a status field on the customer record, for example to Customer.
  </Step>

  <Step title="Send a thank-you email">
    A **Send Email** step to `{{trigger.contactEmail}}` that greets `{{trigger.contactName}}` and links the accepted quote with `{{trigger.publicUrl}}`.
  </Step>
</Steps>

## Stella and MCP

Stella and MCP clients share one set of quote and billing tools. **No tool moves money**: none of them charges a card, bills an instalment or discounts a subscription. Those happen only when a customer accepts or pays, on a schedule, by a workflow, or by a click in the app.

| Tool | Kind | Does |
| - | - | - |
| `list_quotes` | Read | Lists quotes, the workspace's or one customer's, newest first, with number, customer, status and total. Filters by status. |
| `get_quote` | Read | One quote in full: lines, discount, payment schedule, way to pay, the customer link, and whether billing started. |
| `get_customer_billing` | Read | A customer's quotes, live Stripe subscriptions, recent invoices with pay links, and upcoming instalments. |
| `list_invoices` | Read | One customer's invoices, or the workspace's for a period with collected, outstanding and overdue totals per currency. |
| `list_subscriptions` | Read | A customer's subscriptions: plan, status, MRR, discount, way to pay, trial and renewal dates. |
| `get_revenue_metrics` | Read | MRR, ARR, active subscriptions, net revenue retention, billed revenue per month and top customers. Admins only. |
| `plan_quote` | Preview | Stella only. Drafts a quote from catalog products and shows it on a card in the chat **before anything is saved**. **Save draft quote** saves it as a draft and opens it; **Ask Stella to adjust** redrafts it; **Cancel** saves nothing. |
| `create_quote` | Write | Saves a draft quote from catalog products with no preview. Nothing is sent and nobody is charged. In the chat, Stella uses `plan_quote` instead. |
| `update_quote` | Write | Edits a draft: products, discount, way to pay, contact or expiry. A sent or decided quote is refused. |
| `send_quote` | Write | Marks a draft sent and returns the customer link. **Sends no email**: share the link, or ask Stella to draft an email with it. |
| `void_quote` | Write | Withdraws a quote the customer hasn't accepted or declined, so its link stops working. |

**In Stella**, a new quote is drafted on a preview card, and pressing **Save draft quote** is your approval. The four write tools ask for your approval in **Ask** mode, and run on their own in **Auto** mode (see [Permissions](/ai/permissions)). Stella names quotes by number, such as Q-0042. Try *"Draft a quote for Northwind: 10 seats of Pro, 20% off for 3 months"* or *"Which invoices are overdue?"*.

**Over MCP**, a key with `mcp:read` gets the read tools. The four write tools appear only when the key also has **`quotes:write`**. See [MCP](/dev/mcp/overview).

## Webhooks

The same moments are delivered to your own server as webhook events: `quote.viewed`, `quote.accepted`, `quote.declined`, `quote.expired`, `payment.succeeded`, `payment.failed`, `invoice.overdue`, `subscription.started`, `subscription.updated`, `subscription.canceled`, `trial.ending` and `contract.renewing`. A quote being sent or voided triggers workflows but delivers no webhook. See [Quote and billing events](/dev/webhooks/events/quotes-and-billing).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.