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

# Invoices

> Learn how to manage invoices on Yorlet.

export const OverflowMenu = () => {
  return <span>overflow menu (•••)</span>;
};

Subscriptions automatically generate invoices for each billing cycle. Learn more about the [invoice lifecycle for subscriptions](/billing/subscriptions#subscription-lifecycle).

## Invoice lifecycle

Invoices are generated by subscriptions and are used to collect payments from your customers. The invoice lifecycle is as follows:

<Steps>
  <Step title="An invoice is created">
    The status of the invoice is `draft`.
  </Step>

  <Step title="Invoice finalised">
    The invoice is finalised and the status is `open`. You can no longer edit the invoice.
  </Step>

  <Step title="Payment attempted">
    Yorlet will wait for the customer to pay the invoice manually or automatically attempt to pay it using the customer’s default payment method.

    * If the payment is successful, the status of the invoice is `paid`.
    * If the payment is processing, the status of the invoice is `pending` and `pending_transaction=true`.
    * If the payment fails, the status of the invoice is `open`.
  </Step>

  <Step title="The customer does not pay the invoice">
    If the customer does not pay the invoice by the due date, the status of the invoice is `past due`.
  </Step>

  <Step title="Other invoices statuses">
    Optionally, you can change the status of an unpaid invoice to `uncollectible` or `void`.
  </Step>
</Steps>

## Invoice statuses

Invoices can have one of the following statuses:

| Status          | Description                                            |
| :-------------- | :----------------------------------------------------- |
| `draft`         | The invoice is being created and is not yet finalised. |
| `open`          | The invoice is finalised and is ready to be paid.      |
| `paid`          | The invoice has been paid.                             |
| `uncollectible` | The invoice is uncollectible.                          |
| `void`          | The invoice is void.                                   |

### Dashboard statuses

Additionally, invoices can have the following statuses in the dashboard, these are cosmetic and do not affect the invoice lifecycle:

| Status     | Description                                             |
| :--------- | :------------------------------------------------------ |
| `pending`  | The invoice is waiting for the payment to be processed. |
| `past due` | The invoice is overdue.                                 |

#### Finalising

When an invoice is ready to be paid it must be finalised. This will set `status=open` on the invoice. After an invoice is finalised it can no longer be edited or deleted. Subscriptions automatically create invoices when they are due, and automatically finalise approximately 1-2 hours later.

#### Paying an invoice

When a successful payment occurs the invoice is moved into the `paid` status. If an invoice's collection method is set to charge automatically a payment will be automatically attempted.

If the invoice was paid outside Yorlet you can mark the invoice as paid by changing the invoice's status, you can also add some context like a bank transfer reference.

#### Asynchronous payments

Some payment methods can take up to several days to confirm success, when an invoice is paid using one of these methods the invoice will be flagged as `pending_transaction=true` or `pending` in the Dashboard, and you will have to wait for the outcome of the charge.

### Change an invoice status

You can change the status of an invoice to `uncollectible` or `void` from the Dashboard.

To change the status of an invoice, follow these steps:

1. Navigate to the invoice you want to change the status of.
2. Click the <OverflowMenu /> menu and select **Change invoice status**.
3. Select the new status for the invoice.
4. Optionally, add a **Note** to the invoice.
5. Click **Change status** to change the status of the invoice.

#### Mark as uncollectible

Sometimes you may have customers that cannot pay their outstanding invoices. When an invoice is open you can decide to mark the invoice as unlikely to be paid by changing the invoice status to `uncollectible`. This allows you to track all amounts owed as part of your bad debt process.

#### Voiding an invoice

Voiding is like deleting an invoice when in draft, but it instead of removing it you can maintain a record of the invoice for reporting purposes. You can only void an invoice when it is either `open` or `uncollectible`.

#### Off-platform payments

If you receive a payment outside of Yorlet, you can manually mark the invoice as paid. This will update the invoice status to `paid`.

## Invoice actions

From an invoice's <OverflowMenu /> you can take a number of actions on an open invoice:

* **Charge invoice**: collect the outstanding amount using a selected payment method.
* **Send invoice**: email the customer a link to the [hosted invoice](/billing/invoices/hosted-invoices). If the invoice is still a draft, sending it also finalises it.
* **Attach payment**: link an existing payment to the invoice, for example when reconciling a payment that was taken separately.

You can also adjust an invoice without collecting the full balance:

* [Issue a credit note](/billing/invoices/credit-notes) to reduce the amount owed.
* [Create a part payment](/billing/invoices/part-payments) to collect part of the balance.
