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

> ## Agent Instructions
> Spree 6 (v6.x) is the current version. Pages with /v5/ in their URL document Spree 5: follow them in a project that runs Spree 5, or to see what an upgrade changes.
> Spree 6 differs greatly from Spree 4 and 5: it is fully headless, and older code and tutorials mostly do not apply. Before relying on what you remember about Spree, read https://spreecommerce.org/docs/developer/upgrades/spree-6-vs-older-versions.md
> The current REST APIs are the Store API (store.yaml), the Admin API (admin.yaml) and the Seller API (seller.yaml), all under /api/v3.
> The specs named legacy-v2-*, the Storefront API and Platform API pages and their tutorials document the older API v2, which Spree 5 and earlier serve. Read them to maintain or migrate an API v2 client, and build new work on the current APIs.

# Invoices & Documents

> Learn how to issue invoices, receipts and credit notes in Spree Commerce, keep other paperwork on orders, send it to customers, and handle invoice requests.

An invoice is the legal record of a sale, issued by whoever sold the goods. Your customers need it for their accounts, and in many countries you must keep it for years. Spree keeps every invoice, receipt and credit note on the order it belongs to, sends it to the customer, and lets customers ask for one.

Spree can create the invoice for you, with your company's details, your own numbering and a PDF. If you issue invoices in your own accounting or invoicing software instead, upload the PDF to the order, or connect the software so it uploads them for you.

Other paperwork, such as the customer's purchase order, a specification or a shipping document, lives next to invoices on the same order.

## Invoices and Documents on an Order

Every order has two sections for its paperwork, below its fees and taxes:

* **Invoices** - The order's invoices, receipts and credit notes, with their number, type, issue date and total, and any open invoice request from the customer.
* **Documents** - Everything else. Each document is private to your team unless you choose to show it to the customer.

Click a file's name to download it.

## Before You Start: Your Company Details

An invoice must show who issued it, so Spree issues nothing until you add your company. Follow the **Add your company details** step in Getting Started, or go to **Settings → [Business entities](https://spreecommerce.org/docs/user/settings/business-entities.md)** and add a business entity with:

* **Legal name** - Your company's registered name.
* **Registration number** - Your company register number, if you have one.
* **Address** - Your registered address. Required.
* **Tax numbers** - Your VAT or other tax registration numbers. Required on invoices from a company in the EU.
* **Number formats** - How invoices, receipts and credit notes are numbered. See [Invoice Numbers](#invoice-numbers).

If you sell from more than one company, for example one in the EU and one in the US, add a business entity for each. Then open each market in **Settings → Markets** and choose its **Business entity**. Orders from that market are invoiced by that company. A market with no entity chosen uses your default one.

## How to Generate an Invoice

1. Open the order and find its **Invoices** section.
2. Under **Invoices**, click **Generate** and choose **Invoice** or **Receipt**.

Spree numbers the document, creates the PDF from the order, and adds it to the card. The PDF shows your company's and the customer's details, each item with its net price, tax rate and tax, and a summary per tax rate.

An order has one invoice. If the order already has a receipt and the customer needs an invoice, generate an invoice: it replaces the receipt.

If **Email new invoices to customers** is on in your settings, the customer is sent the PDF straight away.

### Issuing Invoices Automatically

Turn on **Issue invoices automatically** in **Settings → Store → Invoices**, and Spree does this for you:

* When an order is paid, it issues an invoice for a business customer. Anyone else gets the document their business entity gives consumers: a receipt unless you changed it. See [Business Entities](https://spreecommerce.org/docs/user/settings/business-entities.md#documents-for-consumers).
* When a customer asks for an invoice, it issues one.
* When you refund an order, it issues a credit note for the refunded amount.
* When you edit an order and its total changes, it issues a credit note for the whole invoice or receipt and then a new one for the order as it is now. Refunding the difference afterwards adds no second credit note. A free order's receipt or invoice has nothing to give back, so it gets no credit note, only the new document.

### Invoice Numbers

Each business entity has its own numbering, with a separate series for invoices, receipts and credit notes. Numbers follow each other with no gaps, as tax law requires.

A number format is text with placeholders: `{number}` for the counter, `{year}` for the year and `{month}` for the month. For example, `INV-{year}-{number}` gives `INV-2026-0001`, `INV-2026-0002`, and starts again from `0001` in 2027. Use `{month}` to start again every month, or leave both out to never start again.

### Correcting an Invoice

An invoice can't be edited once it exists, because it's a legal record. To correct one, click **Generate** and choose **Credit note**, then enter the amount to give back. The credit note points at the original invoice.

## How to Upload an Invoice

Use this when your own invoicing software issued the invoice.

1. Open the order and find its **Invoices** section.
2. Under **Invoices**, click **Upload invoice**.
3. Choose the PDF and fill in:
   * **Type** - Invoice, Receipt, or Credit note.
   * **Number** - The number your invoicing software gave it. Each number can be used once per type.
4. Click **Upload**.

Spree takes the issue date and totals from the order. Open **More details** to change them, for example for an invoice that covers part of an order. A credit note also asks for its **Total**, entered as a negative amount, and the invoice it **Corrects**.

If you uploaded the wrong file and the customer hasn't been sent it yet, delete it and upload the right one. Once the customer has it, upload a credit note instead.

## How to Send an Invoice Again

Click the **⋯** menu next to an invoice and choose **Send again**. The customer is emailed the PDF, even if automatic invoice emails are turned off.

## Invoice Requests

A customer who bought as a private person can ask for an invoice from their order page, adding their company name and tax number. In some countries, such as Poland, customers have a right to ask for one.

An open request shows in the order's **Invoices** section with the details the customer gave. It's fulfilled as soon as the order gets an invoice, generated or uploaded. A receipt or a credit note leaves the request open.

Customers can ask while the order has no invoice, for as many days after paying as you allow in **Settings → Store → Invoices**. Set it to 0 to turn requests off.

## Orders Missing an Invoice

In **Orders**, add the **Missing invoice** filter to see every placed and paid order that doesn't have an invoice or receipt yet. On a marketplace, each seller's page shows how many of their orders are missing one.

## All Invoices

**Orders → Invoices** lists every invoice, receipt and credit note in the store, across all orders and seller payouts. Filter it by type or date and click **Export** for your accountant.

## How to Add Another Document

1. In the order's **Documents** section, click **Upload document**.
2. Give it a name, choose the file, and switch on **Visible to customer** if the customer should see it.
3. Click **Upload**.

You can change a document's name or visibility later from its **⋯** menu. Documents the customer added from their account are marked as theirs and are always visible to them.

## Settings

In **Settings → Store**, the **Invoices** card has these settings:

* **Issue invoices automatically** - Issues receipts, invoices and credit notes as orders are paid and refunded. Leave it off if your own software issues invoices.
* **Email new invoices to customers** - Sends the customer the PDF when an invoice is added. Turn it off if your invoicing software already emails invoices.
* **Invoice requests** - How many days after paying a customer can ask for an invoice. Set it to 0 to turn requests off.

## Marketplaces

On a marketplace, each seller invoices the orders they sell, in their own name. Sellers upload invoices from their own panel, and customers see them on their order. Spree generates invoices only for orders your own company invoices. When a checkout includes items from several sellers, the customer gets one invoice from each.

Your commission invoices to sellers belong on their payouts: open a payout in **Sellers → Payouts** and upload the invoice there. Sellers see these invoices in their panel.


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