> ## 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.

# Customer billing page

> Give your customers a page with their plan, card and invoices, inside your product or at a link you send, and choose what they can change there.

The billing page shows one customer their own billing: their plan and next charge, the card on file, their usage this period and their invoices. You decide what it shows and what the customer can do there. It reads everything live from your Stripe account, so it always matches what Stripe holds.

It reaches customers three ways:

* **Inside your product**, drawn by a few lines of code your developers add. See [Bill from your product](/dev/guides/bill-from-your-product#6-give-customers-a-billing-page).
* **At a link you send by hand**, from the customer's record.
* **Inside Custral**, on a record page or any page, with the **Customer billing** block.

<Note>
  The billing page needs payments set up first: products, customers and Stripe. See [Set up payments](/revenue/payments). Its settings are **admin only**.
</Note>

## Set it up

Open **Revenue → Billing page**. Everything on the tab saves from the bar at the bottom of the screen.

### What customers see

The plan, its status and the next charge are always shown. Each of these can be turned off:

* **Payment method**: the card or bank account on file, with its expiry.
* **Usage this period**: shown when the customer's plan has metered products, with the count and the cost so far.
* **Invoices**: each one with Stripe's own invoice page and PDF.
* **Billing contact**: the address invoices go to.

### What customers can do

| Action | What happens |
| - | - |
| **Update their card** | The customer adds a card on Stripe's own page. It becomes the default for every subscription they have. |
| **Change plan** | The customer picks a plan and sees the exact charge first. An upgrade is charged now. **Downgrades take effect** sets whether a downgrade waits for the end of the period or happens straight away. Moving between monthly and yearly is always charged now. |
| **Cancel at end of period** | The plan ends when the current period does. Nothing is refunded. Turn on **Ask for a reason** to ask why; the reason is saved in Stripe and sent with the subscription event, so a workflow can follow up. |

A customer with no plan yet can **Choose a plan**, which goes through Stripe Checkout, whenever Change plan is on.

A customer under a signed contract can upgrade during the contract's term, but can't downgrade or cancel from the page.

### Plans they can switch to

The plans a customer chooses between when they change plan. **Add plan** opens a side sheet:

* **Name** and **Description**, plus a list of **Features**.
* **Monthly product** and **Yearly product**: the products the plan bills, by month and by year. Prices come from the products, so editing a price on the product updates the plan.
* **Trial days**, for a customer choosing a plan for the first time.
* **Button label**, which defaults to "Switch to" and the plan's name.
* **Talk to sales link**, shown instead of a button for a plan you sell by hand.
* **Mark as popular**, to highlight one plan.

Drag plans to set the order customers see them in.

If a product's price in Custral differs from its price in Stripe, a warning names the plan, and customers can't switch to it until you press **Push to Stripe**.

### Embed

For your developers:

* **Allowed return domains**: where the page's Back link and Stripe's pages may send a customer. Press Enter after each host.
* **Copy embed code** copies the snippet your developers start from.
* The API key that opens a billing page needs the `billing:portal` scope. Create one in **Settings → Quotes and invoicing → Developer API**.

## Check what a customer sees

**Preview as…** picks a customer and opens their page exactly as they would see it, with every button off.

On a customer's record, the **Billing** panel has two more:

* **View as customer** opens the same preview.
* **Copy billing link** makes a link to that customer's page that works for 24 hours. Anyone with the link can use it, so send it only to them.

## The Customer billing block

Add **Customer billing** to a record page, or to any page and pick a customer. It shows the plan, next charge, usage and card on file, read from the same page your customer sees. Choose **Compact** for one row or **Full** to add the invoices. **Open** shows the customer's whole page.

## Troubleshooting

| You see | Do this |
| - | - |
| The tab says to connect Stripe | Finish the Connect Stripe step in [Set up payments](/revenue/payments). |
| A plan shows a price warning | Press **Push to Stripe** so Stripe charges what the plan shows. |
| A customer's page says the link has expired | Open a new one. A page opened from your product lasts 15 minutes; a copied link lasts 24 hours. |
| Back or Stripe's page is refused | Add your app's host to **Allowed return domains**. |


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