# Accountancy

URL: https://docs.sparklayer.io/help/integrations/accountancy
Applies to: Shopify

Connect SparkLayer to Xero or QuickBooks Online so B2B orders become invoices automatically and customers can download them from their account.

> **Quick summary**
>
> - SparkLayer has direct integrations with **Xero** and **QuickBooks Online**. They turn B2B orders paid by invoice or on account into invoices in your accounting app, and can create the matching contacts.
> - Data goes from SparkLayer into your accounting app, shortly after each eligible B2B order comes in. Each guide lists which orders qualify. With Xero, payments on those invoices also come back to SparkLayer. Changes you make to an invoice in the accounting app don't come back.
> - Connect one in the SparkLayer Dashboard at **Integrations > Partners** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/configuration/integrations/partners)), or **SparkLayer Wholesale > Integrations > Partners** in the Shopify app, under **Accountancy**: turn on its switch and sign in to Xero or QuickBooks. Both need the Pro or Enterprise plan and a Shopify store.
> - Customers can view and download each invoice from **My Account** on your store.

## How the accountancy integrations work

How a B2B order becomes an invoice:

1. **B2B order**: Paid by invoice or on account
2. **SparkLayer**: Matches or creates the contact
3. **Xero or QuickBooks**: Invoice created through the API
4. **My Account**: Customer views and downloads the invoice

Both integrations work the same way, with a few differences:

| Feature | Xero | QuickBooks Online |
| --- | --- | --- |
| Creates invoices for Pay by Invoice and Pay on Account orders | Yes | Yes |
| Creates contacts automatically (optional) | Yes | Yes |
| Invoice per shipment for Pay on Account orders (optional) | Yes | Yes |
| Sales receipts for upfront payment orders | Not documented | Yes (optional) |
| Payments on invoices shown on the SparkLayer order | Yes | Not documented |

To see where each integration fits in the Pay by Invoice and Pay on Account flows, try the interactive guide [How payments work](https://docs.sparklayer.io/help/guides/how-payments-work.md).

- [Xero](https://docs.sparklayer.io/help/integrations/accountancy/xero.md): Create invoices and import payments · Direct integration
- [QuickBooks Online](https://docs.sparklayer.io/help/integrations/accountancy/quickbooks.md): Create invoices from B2B orders · Direct integration
