# Automate Invoicing & Payments

Once products and subscriptions are in place, the billing lifecycle takes over. Every invoicing period, Revenium needs to generate invoices against real usage, send them to the right customers, track whether they're paid, handle the occasional refund or credit, and keep every party informed through branded email notifications. Done manually, each of these steps is a support ticket waiting to happen. Done well, the lifecycle is invisible - invoices arrive, payments clear, and the only time a human gets involved is when something genuinely unusual happens.

Revenium automates the full cycle. This page walks through each part of the billing lifecycle under **Configuration > Billing**, so you know what to configure, what to monitor, and where to go when something needs attention.

### <i class="fa-credit-card">:credit-card:</i> Subscriptions - Where the Cycle Starts

Every invoice in Revenium traces back to a subscription. The **Subscriptions** tab is the authoritative view of every active customer relationship, showing Name, Product, Organization, Subscriber, Recurring Charge, and Subscription Period in one sortable list.

Two things about this view are worth calling out.

The first is that subscriptions don't only get created manually - they can also be **auto-discovered** or **auto-generated**. When a metering event arrives with a new subscription identifier, Revenium creates the subscription automatically so that no billable usage is ever dropped. You'll see these in the list with names like "Auto discovered subscription for..." or "Auto generated subscription for...". They start with "Activation Pending" status until fully configured, which is a useful signal for anyone reviewing provisioning: if a customer is live but their subscription is still pending activation, the manual configuration step hasn't happened yet.

The second is that the **Subscription Period** column tells you where each subscription is in its billing cycle. This is often the first place to look when a customer reports an invoicing issue - if the dates don't line up with expectations, the problem is usually in the subscription configuration rather than in the invoice generator.

#### Adding a Subscription Manually

Click the **+** button to add one. The base configuration needs:

* **Customer Name** - which organization this subscription belongs to
* **Product Selection** - the product the customer is buying
* **Subscriber's Email** - the end user receiving invoices and notifications
* **Subscriber Credentials** - optional; leave blank for auto-creation when the first metering event arrives
* **Subscription Name** - the label that appears on invoices and in internal dashboards
* **Subscription Start Date** - when billing begins

Four optional components sit alongside the base config: **Expiration Date** (for fixed-term contracts), **Custom Metadata**, **Allow Immediate Cancellations**, and **Notifications / Audience Filters**. Toggle them on when a subscription needs them rather than configuring them pre-emptively.

### <i class="fa-file-invoice">:file-invoice:</i> Invoices - The Financial Audit Trail

The **Invoices** tab is a full history of every invoice Revenium has generated, filterable by date range and sortable on any column. Columns include Timestamp, Customer, Subscription Owner, Product Name, Total Amount, Refund Amount, and Payment Configuration - giving you a single view that answers "when was it generated, who was it for, what was on it, has it been refunded, how is it being paid?"

Three controls make this view genuinely useful in practice:

* **Date range picker** - default view covers a recent window, but for historical queries or annual reconciliations you can scope to any period.
* **Show Failed Payments Only** - toggle that filters to only invoices where payment has failed. This is the list to work through when a finance team asks "what's outstanding?" - it filters out the noise of successfully paid invoices.
* **Advanced Search** and **Export** - search finds specific invoices across large datasets without scrolling; export pulls invoice data out as CSV for downstream finance or reconciliation workflows.

When an invoice doesn't look right, clicking through into it shows the line-item breakdown - recurring charges, usage charges per tier, any setup fees or one-time charges, taxes, and the final total. This is the record you send to customers disputing a bill, and the record you reference when something needs to be refunded.

### <i class="fa-arrow-u-turn-up-left">:arrow-u-turn-up-left:</i> Refunds - Issuing Credits

Things occasionally go wrong. A customer gets double-charged, a promotional credit needs to be applied, a pricing error needs to be corrected. The **Refunds** tab handles these cases, with a Credit History showing Timestamp, Created By, Product, Refund Amount, View Notes, and Actions.

Click **Issue Refund** to open the refund form:

* **Refund or Credit Type** - Issue a credit to be applied in a future invoice. This credits the customer's account so the amount comes off their next invoice, rather than generating an immediate payment reversal.
* **Customer** (required) - the customer the credit applies to
* **Subscription** (required) - the specific subscription to apply the credit against
* **Refund Amount** (required) - the value of the credit, in the subscription's currency
* **Creator** - auto-populated with the logged-in user; this is what shows up in the Created By column and in any audit trail
* **Refund Notes** - free-text context explaining why the credit was issued. Worth taking the time to fill in properly - this is what you'll thank yourself for when a customer asks six months later why a credit appeared on their account

Once saved, the credit is logged in the Credit History tab and will be applied automatically to the customer's next invoice on that subscription.

The Export option lets you pull the full credit history out for finance reconciliation, and the date range filter makes it easy to scope to a specific period for quarterly or annual reviews.

### <i class="fa-mailbox">:mailbox:</i> Notification Templates - Making Email Work for You

Every automated email Revenium sends to a customer goes out through a configurable template. The **Notification Templates** tab is where you customize what customers actually see when invoices arrive, subscriptions change, or payments fail.

#### Brand the Emails First

At the top of the page is **Email Notification Logo**. Upload your own logo here so that all emails carry your branding rather than Revenium's default. For most businesses this should be the first thing configured - customers see these emails long before they see any dashboard, and a branded invoice email looks significantly more professional than a generic one.

#### The Templates

Revenium ships with a template for every type of event a customer might need to hear about. Each one can be toggled on or off independently, and each can be previewed, edited, or test-sent from the Actions column:

* **New Invoice** - sent at the end of each invoicing period with the invoice attached
* **Subscription Update** - sent when a customer upgrades or downgrades to a different product
* **Subscription Canceled** - sent when a subscription is deactivated, whether through end-of-term or for other reasons
* **Subscription Created** - sent to confirm a new subscription and list the included assets
* **Free Trial Notification** - sent when a subscription's free trial period is ending
* **Quota Warning** - sent when a configured percentage of a product's quota has been consumed
* **Quota Tier Warning** - for volume-based pricing models, sent when a configured percentage of a tier's quota has been consumed
* **Successful Payment** - sent when payment is received for a monetized product with a linked payment provider
* **Payment Failed** - sent when a payment from a connected payment provider fails
* **Subscription Expiration Notice** - sent to product owners and subscribers when a subscription is set to expire

#### Editing a Template

Clicking into any template opens a view showing the email's current state - subject line, body, and where customer-specific values get substituted. Bodies use template variables like `{Recipient}`, `{Storefront Url}`, and `{Revenium Organization Name}` to personalise each message.

A typical New Invoice template body reads:

> Hi {Recipient},
>
> The invoice for your API usage is attached.
>
> If you have any question about the charges, please visit the help section of the API storefront {Storefront Url}
>
> Thanks, – The {Revenium Organization Name} Team

Edit these to match your own brand voice, support process, and tone. The defaults are functional but generic - a customized template tends to convert significantly better on payment actions and generates fewer support queries about what an email is asking the customer to do.

#### Send Test Emails Before Going Live

The Actions column includes a send icon that lets you fire a test email to yourself or a teammate. Use it whenever you've edited a template - it's much easier to spot a broken variable or awkward phrasing in your own inbox than in a customer's.

### <i class="fa-ruler-combined">:ruler-combined:</i> Designing an Invoicing Process

When putting this together for the first time, the order that works best is:

1. **Brand your emails** - upload the logo and edit the templates before any real customer invoice goes out
2. **Validate one subscription end-to-end** - use a 5-minute invoicing period (from the [Build Usage-Based Billing tutorial](/monetize-your-ai/tutorial-build-usage-based-billing.md)) to cycle through invoice generation, notification delivery, and payment tracking in under an hour
3. **Set up failed-payment monitoring** - plan who responds when the Show Failed Payments Only view shows a failure, not if
4. **Document your refund process** - decide upfront who has permission to issue credits and what the reasoning needs to include, so the Refund Notes field gets filled in properly from the start

Most billing problems come from skipping one of these steps. An un-branded template undermines the invoice. An un-tested subscription discovers problems at month-end instead of day one. An unclear refund process means credits get issued without context and nobody remembers why.

### <i class="fa-code">:code:</i> Via API

The whole lifecycle is available programmatically for teams integrating invoicing and payments into their own systems. [Subscriptions](https://revenium.readme.io/reference/get_subscription) have full CRUD endpoints so signups, upgrades, and cancellations can all happen through your product rather than through the UI. [Invoices](https://revenium.readme.io/reference/list_invoices) can be listed and inspected via API - useful for pulling invoice data into finance dashboards or customer-facing billing pages. Real-time [subscription billed amount](https://revenium.readme.io/reference/get_subscription_billed_amount) and [quota consumption](https://revenium.readme.io/reference/get_subscription_quota_consumed) endpoints let you surface current balance and usage inside your own product without waiting for the next invoicing cycle.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.revenium.io/monetize-your-ai/automate-invoicing-and-payments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
