# Invoices

URL: https://docs.sparklayer.io/help/ordering/invoices

Turn on SparkLayer Invoices so B2B customers can download PDF invoices from My Account, then add payment details, checkout data and your branding to them.

> **Quick summary**
>
> - SparkLayer Invoices creates a PDF invoice for each B2B order once it reaches **Processing**. Customers and sales agents download it with **View & Download Invoice** on the order in [My Account](https://docs.sparklayer.io/help/storefront/interfaces/my-account.md).
> - Turn on **Invoices** at **Settings > Configurations > Quotes and invoices** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/settings/general)), or **SparkLayer Wholesale > Settings > Configurations > Quotes and invoices** in the Shopify app, then add text such as bank details with **Invoice Settings**. To redesign the invoice, use [Templates](#change-the-invoice-design-with-theming).
> - SparkLayer Invoices (automatic PDF invoices, payment reminders and your own invoice template) needs the Growth plan or above. [Net terms and credit limits](https://docs.sparklayer.io/help/ordering/credit-net-terms-and-invoicing.md) don't: they're on every plan. 
> - For signed-in B2B customers only, in English, French or Spanish. Invoices can't show line-item tax, refunds, cancellations or part-fulfilled orders.

## How it works

How a SparkLayer invoice is created:

1. **Order placed**: By a B2B customer or a sales agent
2. **Order is Processing**: Draft orders and orders awaiting approval wait until they're completed
3. **Invoice generated**: With your company details, the order's items and your Content Zones
4. **Customer downloads it**: View & Download Invoice on the order in My Account

Each invoice shows:

- Your store name, address, website and phone number, with the order number and invoice date
- The **Bill to** and **Ship to** addresses
- The items (SKU, quantity, unit price and total), subtotal, shipping, tax, total and a tax summary
- Any [Content Zones](#add-payment-details-and-other-text-with-content-zones) you've filled in, at the bottom

[Download Example Invoice (via SparkLayer).pdf](https://docs.sparklayer.io/files/example-invoice.pdf)

Instead of SparkLayer Invoices, you can attach invoices made in another system, send invoices from your store, or use an app such as [Sufio](https://docs.sparklayer.io/help/integrations/customer-experience/sufio.md). See [Choose how to send invoices](https://docs.sparklayer.io/help/ordering/credit-net-terms-and-invoicing.md#choose-how-to-send-invoices).

**Shopify only:**

To compare the ways of invoicing step by step, see the interactive guide [How payments work](https://docs.sparklayer.io/help/guides/how-payments-work.md).

## Turn on invoices

1. Go to **Settings > Configurations > Quotes and invoices** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/settings/general)), or **SparkLayer Wholesale > Settings > Configurations > Quotes and invoices** in the Shopify app.
2. Turn on **Invoices** ("Send invoices to your B2B customers directly from SparkLayer").
3. Click **Save**.

**Invoice Settings** then appears beside **Invoices**, so you can [add your own content](#add-payment-details-and-other-text-with-content-zones). Content changes apply to all invoices, the next time each is viewed.

Invoices are created for orders placed from now on. Orders placed before you turned on Invoices don't get one.

Below Growth, you see a **Growth** badge and an **Unlock** button instead of the switch. **Unlock** shows what Growth adds and starts a free 14-day trial.

## Add payment details and other text with Content Zones

Content Zones are 3 optional blocks of text at the bottom of every invoice. Use them for payment terms, bank details, tax details, terms and conditions or legal statements.

1. Go to **Settings > Configurations > Quotes and invoices** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/settings/general)), or **SparkLayer Wholesale > Settings > Configurations > Quotes and invoices** in the Shopify app and make sure **Invoices** is on.
2. Next to **Invoice Settings**, click **Edit**. The **Edit Invoice Settings** panel opens.
3. For each zone you want, enter a **Title** (up to 50 characters, shown as a bold heading) and **Content** (up to 2,000 characters, shown smaller below it). Line breaks are kept.
4. Save your changes. 

Every zone, title and content box is optional. For example, a zone titled "Making payment" could list the account number, sort code, IBAN, BIC and bank name to pay into.

### Add checkout field data to an invoice

To show details collected at checkout, such as a delivery date from a [custom checkout field](https://docs.sparklayer.io/help/ordering/checkout-fields.md#add-a-custom-checkout-field), paste one of these snippets into a Content Zone's **Content** box.

No coding is needed. You can change plain words such as `Tax ID:`, but leave everything inside `{% %}` and `{{ }}` as it is. Where a snippet names a checkout field (such as `"tax-id"`), it must match the field's name.

**Show "Additional Information" field (e.g. Purchase Order)**

You need the [Additional Information field](https://docs.sparklayer.io/help/ordering/cart-and-checkout.md#set-up-the-additional-information-field-po-number) turned on at checkout first.

```html
{% if purchase.customer_reference %}
Customer Reference: {{ purchase.customer_reference }}
{% endif %}
```

**Show the payment type**

Shows a message based on the [payment method](https://docs.sparklayer.io/help/ordering/payment-methods.md) used for the order.

```html
{% if purchase.payment_method == "upfrontPayment" %}
A message for Pay Online by Card
{% elsif purchase.payment_method == "paymentOnAccount" %}
A message for Payment On Account
{% elsif purchase.payment_method == "paymentByInvoice" %}
A message for Pay By Invoice
{% elsif purchase.payment_method == "quote" %}
A message for Quote
{% else %}
{{ purchase.payment_method }}
{% endif %}
```

**Show the invoice due date**

You need [net terms](https://docs.sparklayer.io/help/ordering/credit-net-terms-and-invoicing.md#set-net-payment-terms) set on the customer's metafield first, so invoices get a due date.

```html
{% if data.purchase.dates.payment_due_at %}
<p>
Due Date: {{ data.purchase.dates.payment_due_at | ldate }}
</p> 
{% endif %}
```

**Show a custom "Shipping date"**

You need a custom "Shipping date" [checkout field](https://docs.sparklayer.io/help/ordering/checkout-fields.md#add-a-custom-checkout-field) first. The `field.name` must match the `name` of your checkout field.

```html
{% for field in purchase.custom_fields %}
{% if field.name == "delivery-date" %}
Shipping Delivery Date: {{ field.value }}
{% endif %}
{% endfor %}
```

**Show a custom "Order Notes"**

You need a custom "Order Notes" [checkout field](https://docs.sparklayer.io/help/ordering/checkout-fields.md#add-a-custom-checkout-field) first. The `field.name` must match the `name` of your checkout field.

```html
{% for field in purchase.custom_fields %}
{% if field.name == "order-notes" %}
Order Notes: {{ field.value }}
{% endif %}
{% endfor %}
```

**Show a custom "Tax ID"**

You need a custom "Tax ID" [checkout field](https://docs.sparklayer.io/help/ordering/checkout-fields.md#add-a-custom-checkout-field) first. The `field.name` must match the `name` of your checkout field.

```html
{% for field in purchase.custom_fields %}
{% if field.name == "tax-id" %}
Tax ID: {{ field.value }}
{% endif %}
{% endfor %}
```

**Show an Accounting ID ("Tax ID") from metafield**

You need the Accounting ID metafield on your store first (see below). It's the only metafield an invoice can show.

| Item | Details |
| --- | --- |
| **Custom data type** | [Customers](https://admin.shopify.com/settings/custom_data/customer/metafields) |
| **Metafield type** | `single line text` |
| **Namespace** | `sparklayer` |
| **Key** | `accounting_id` |
| **Use** | A unique accounting ID for the customer, for example the account ID in your ERP or accounts package. When it's set, it's also added to the order's metadata in your eCommerce platform. |

```html
{% if purchase.customers.sparklayer.accounting_id %}
<p>{{ purchase.customers.sparklayer.accounting_id }}</p>
{% endif %}
```

## Update your company details

Invoices show your company name, address, phone number and website at the top. SparkLayer syncs these from your store, and what you enter here overrides what B2B customers see.

1. Go to **Settings > Configurations > Store** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/settings/general)), or **SparkLayer Wholesale > Settings > Configurations > Store** in the Shopify app.
2. Next to **Store details**, click **Edit**.
3. Update the **Store name**, **Store address**, **Phone number**, **Email** and **Website URL**.
4. Click **Save**.

See [Settings](https://docs.sparklayer.io/help/dashboard/settings.md#store-details).

## Change the invoice design with theming

Theming gives full control of the invoice's layout, fonts, colours and content. Templates use a template language, so we recommend working with a web developer. Invoice templates need the Growth plan or above.

Go to **Settings > Templates** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/theme)), or **SparkLayer Wholesale > Settings > Templates** in the Shopify app and click **Create template**. This creates a template theme for your invoices, email notifications and translations. See [Settings](https://docs.sparklayer.io/help/dashboard/settings.md#templates) and the [templates developer docs](https://docs.sparklayer.io/developers/templates.md).

Example changes:

**Output the product image on an invoice**

In the `<thead>`, add a new `<th>` at the start:

```html
<thead>
<tr>
<th style="width: 10%"></th>
<th style="width: 60%">{{ "pdf.quote.section.line_items.table.headings.item" | t }}</th>
<th style="width: 10%">{{ "pdf.quote.section.line_items.table.headings.quantity" | t }}</th>
<th style="width: 15%" class="text-right">{{ "pdf.quote.section.line_items.table.headings.unit_price" | t }}</th>
<th style="width: 15%" class="text-right">{{ "pdf.quote.section.line_items.table.headings.total" | t }}</th>
</tr>
</thead>
```

In the `<tbody>`, add a new `<td>` at the start:

```html
<td>
<img src="{{ line.image_url }}&height=160" height="80">
</td>
```

**Output a logo on an invoice**

At the start of the template file, find this code:

```html
{% if data.merchant.store_name %}
 <h1>{{ data.merchant.store_name }}</h1>
{% endif %}
```

Host your logo image somewhere, then replace the code with:

```html
{% if data.merchant.store_name %}
 <img src="path-to-your-hosted-image-file" style="width: 200px; height: auto">
{% endif %}
```

## Test your invoices

There's no invoice preview, but changes show the next time an invoice is viewed. To check them:

1. **Place a test order.** Sign in to your store as a B2B customer or sales agent and place an order. It must reach **Processing**, so it can't be a draft order.
2. **Open the order** in My Account.
3. **Click View & Download Invoice.** The invoice opens in your browser, where you can download it.
4. **Make changes** to your [Content Zones](#add-payment-details-and-other-text-with-content-zones), [company details](#update-your-company-details) or [theme](#change-the-invoice-design-with-theming), then view the invoice again.

## Reference

### When invoices are available

| Situation | What happens |
| --- | --- |
| **Order is Processing** | An invoice is created. |
| **Order placed before you turned on Invoices** (old, past or historic orders) | No invoice. Invoices are only created for new orders, not for previous orders. |
| **Draft order, or an order awaiting approval** | No invoice until the order is completed. This includes orders from [company users](https://docs.sparklayer.io/help/customers/company-users.md) that need approval. |
| **Refunded or cancelled order** | No invoice. |
| **Split shipment** (part of the order fulfilled first) | The invoice shows all products on the order. |
| **Editing a completed order** (Processing but not yet fulfilled) | Your changes **don't** appear on the invoice. |
| **Editing a draft order** | Your changes appear once the order is completed (set to Processing). |

### Limitations

| Item | Limitation |
| --- | --- |
| **Line-item tax** | Invoices can't show a tax breakdown for each line. |
| **Refunds, returns, cancellations** | Invoices can't show these order statuses. |
| **Languages** | English, French and Spanish. Invoices are always in your store's default language, even if your store has several. For another language, contact [our support team](https://docs.sparklayer.io/help/support.md). |
| **Part fulfilment** | Part-fulfilled orders aren't supported. The invoice shows all products on the order, whether they've been fulfilled or not. |
| **Customers** | Only signed-in B2B customers set up in SparkLayer can get invoices. |

### Compliance

Every country has its own invoicing rules, from required fields to tax details and legal statements. Add the payment terms, bank details or legal wording you need with [Content Zones](#add-payment-details-and-other-text-with-content-zones).

> **Check your invoices meet local rules**
>
> SparkLayer isn't an accounting or legal service provider, and isn't liable for your invoices meeting local regulations. Ask a professional to check them.

## FAQs

**What SparkLayer plan do I need to be on to enable invoices?**

Growth, Pro or Enterprise. Net terms and credit limits, without SparkLayer Invoices, are on every plan. Change plan at **Plan card** in the SparkLayer Dashboard, or **SparkLayer Wholesale > Plan** in the Shopify app, or click **Unlock** next to **Invoices** to start a free trial. See [SparkLayer plans and pricing](https://www.sparklayer.io/pricing/).

**How do I turn on invoices?**

Turn on **Invoices** at **Settings > Configurations > Quotes and invoices** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/settings/general)), or **SparkLayer Wholesale > Settings > Configurations > Quotes and invoices** in the Shopify app. See [Turn on invoices](#turn-on-invoices).

**How do I view changes I make to invoices?**

Place a test order and download its invoice from My Account. See [Test your invoices](#test-your-invoices).

**How do multiple currencies work?**

Each invoice uses the order's currency, which is based on the customer's location or your store's settings.

**How does tax work on invoices?**

Tax is calculated from the settings in your store. See [Tax and shipping](https://docs.sparklayer.io/help/ordering/tax-and-shipping.md).

**I can't download an invoice. What am I doing wrong?**

- **The order is Processing.** Invoices aren't available before then.
- **The order was placed after you turned on Invoices.** Older orders don't have an invoice.
- **Your browser allows PDFs to download.** Check its settings.

If it still doesn't work, [contact our support team](https://docs.sparklayer.io/help/support.md).

**Can I get invoices for old or past orders?**

No. SparkLayer only creates invoices for new orders, once Invoices is on. It doesn't create them for previous or historic orders, including [imported order history](https://docs.sparklayer.io/help/platforms/shopify/metafields.md#import-order-history-into-sparklayer).

**If I edit an order, will the changes reflect on the invoice?**

Not once the order is completed (Processing). Changes to a draft order appear once it's completed.

**Can I show custom checkout fields on an invoice?**

Yes, for example a tax ID number. See [Add checkout field data to an invoice](#add-checkout-field-data-to-an-invoice).

**How do I set payment terms and how do they show on invoices**

Add them as free text in a [Content Zone](#add-payment-details-and-other-text-with-content-zones), for example a "Making payment" zone with your bank details. To show a due date based on the customer's net terms, see [Show the invoice due date](#show-the-invoice-due-date).

**How do I turn off my other invoicing system?**

For Sufio, in the SparkLayer Dashboard, go to **Integrations > Partners** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/integrations/partners)), or **SparkLayer Wholesale > Integrations > Partners** in the Shopify app and turn off **Sufio** under **Invoicing**. The Shopify app has no switch: Sufio's **Setup guide** explains how to disconnect it. For any other invoicing app, uninstall it from your store as usual.

**How do I fully customise how the invoice looks?**

Use [theming](#change-the-invoice-design-with-theming) at **Settings > Templates** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/theme)), or **SparkLayer Wholesale > Settings > Templates** in the Shopify app, with a web developer. [Our support team](https://docs.sparklayer.io/help/support.md) can help.

**Can I use my own invoices instead of the invoices from SparkLayer?**

Yes. See [Attach your own invoice to an order](https://docs.sparklayer.io/help/ordering/credit-net-terms-and-invoicing.md#attach-your-own-invoice-to-an-order).

**How does a customer share an invoice?**

They sign in, open the order and download the PDF to share, for example by email.

**Can I use invoices for my regular (non-B2B) customers?**

No. Invoices are only for signed-in B2B customers set up in SparkLayer.

We'd love to hear your feedback on invoices. Email our product team at [product@sparklayer.io](mailto:product@sparklayer.io).
