Import B2B Orders - Xero and CSV Wholesale Invoice Import
Import wholesale invoices from a Xero export or any spreadsheet as B2B orders, with SKU matching, invoice reconciliation, multi-currency conversion and COGS overrides, without double-counting revenue or touching your D2C ad metrics.
Import B2B Orders
B2B order import brings your wholesale invoices into MerchantFlow in bulk -- straight from a Xero sales-invoice export, or from any spreadsheet whose columns you map. Every invoice becomes a manual B2B order, so it adds to revenue, COGS and your P&L exactly like one you typed in, while carrying zero ad spend and staying out of your Shopify and WooCommerce acquisition metrics.
Availability
The importer requires the Pro or Plus plan (including a Plus trial) and the orders:manage permission -- the same rules as manual order entry. Both are enforced on the server, not just by hiding the button.
Starting an import
Open Orders (/dashboard/orders) and choose Import B2B orders, next to New B2B order. The import runs in five steps.
1. Upload
Drop a .csv file (up to 10 MB and 50,000 rows). Comma, semicolon and tab-separated files all work, as do quoted descriptions that contain commas or line breaks.
- From Xero -- open Sales > Invoices, select the invoices and choose Export. Keep every column: totals, payments and credits are what the importer reconciles each invoice against.
- From anything else -- use your own spreadsheet, or Download CSV template for a ready-made layout: one row per invoice line, with the invoice details repeated on every line.
The page also lists your recent imports, each linking to its results.
2. Map columns
A Xero export is recognised automatically and its columns are mapped for you. For any other file, check how each column is mapped. Each column can feed only one field.
| Required | Notes |
|---|---|
| Invoice number | Rows with the same invoice number form one order |
| Customer | The company or buyer |
| Invoice date | The order date in your P&L |
| Quantity | Whole units |
| Unit price or Line amount | At least one |
| Description or Source SKU | At least one |
Everything else is optional: reference / PO, due date, status, document type, currency, exchange rate, invoice total, tax total, amount paid / due / credited, shipping charged, discount, line tax, account code, store SKU, unit COGS, order COGS, fulfilment cost, payment fee, shipping country and incoterm.
Sales amounts are read in the invoice's currency. Cost columns -- Unit COGS, Order COGS, Fulfilment cost and Payment fee -- are read in your reporting currency, because they are your own costs.
Under How to read this file you set:
| Setting | When it appears |
|---|---|
| Currency of every invoice | Only when no currency column is mapped -- you must choose one |
| Payment status of every invoice | Only when no status or payment columns are mapped -- you must choose one |
| Date format | Always. If every date in the file could be day-first or month-first (for example 03/04/2026), you must choose; the importer never guesses a month |
| Count revenue from unpaid invoices | Always -- see Payment status and revenue below |
| Exchange rate column, Discount column | When those columns are mapped |
| Line amounts | Always: detected from the invoice totals, or set to tax-exclusive / tax-inclusive |
Give the mapping a name under Save this mapping as and it is saved when you import. A later file with the same columns uses it automatically.
3. Match products
Each line is matched to a product in your store only when the match is certain:
- A choice you made, or a mapping you saved on an earlier import
- The Store SKU column, if you mapped one
- An exact SKU match
- The same SKU written with different spaces or hyphens (
GRP- LRGmatchesGRP-LRG), when only one product reads that way
When a file has no SKU column, the SKU is read from the start of each description -- GRP-YTH Grip Pads Youth gives GRP-YTH.
Anything else is listed under To review with suggestions. A suggestion is never applied for you: if your invoices say GRSWS and your store calls it GRS-WSML, click Use GRS-WSML to confirm it. A SKU shared by two products is Ambiguous and holds its invoices back until you pick one. You can also:
- Search your products by name or SKU to choose any product
- Mark a SKU Wholesale only (not in your store) -- it imports with its own SKU and no store product, and can carry a default unit cost
- Leave it unmatched -- it imports with its own SKU, so a COGS entry recorded under that SKU still applies
Remember for future imports (on by default) saves the choice, so the next file matches it straight away.
4. Review
Every figure on this step is what will be written. The summary shows New orders, Updates, Need attention, Skipped, how many will Count in P&L now versus Pending until paid, and the Total to import in your reporting currency. Open any invoice to see its lines, how each was matched and classified, and its totals.
An invoice with a problem is held back until you resolve it -- it is never imported half-right. For each invoice you can:
- Change a line's Type: Product, Shipping, Adjustment, Note or Excluded
- Enter a Unit COGS per line, an Order COGS override, or a Fulfilment cost
- Mark it an FOB order
- Enter or accept an exchange rate
- Choose how to resolve a totals difference
- Choose Don't import this invoice
Then choose Import n orders. Invoices that still need attention are skipped and listed.
5. Results
The import runs in the background, so large historical files never time out -- you can leave the page while it runs. The results list each invoice as Created, Updated, Skipped or Failed, with a link to its order. If any failed, Retry n failed invoices runs just those again; invoices that already imported are never written twice.
Margins for the imported orders are calculated straight away, and your P&L for the affected days updates within a few minutes.
How invoices are read
One order per invoice
A Xero export repeats the invoice total, tax, payments and customer on every line. The importer reads those once per invoice -- they are never added up -- and every row of an invoice must agree, or the invoice is held back. Lines become the order's line items.
Lines that are not products
| Line | Becomes |
|---|---|
| Freight, shipping, delivery or postage (with no SKU) | Shipping -- added to shipping charged |
Rounding, adjustment, discount or credit lines, Xero account 860, or any negative line with no SKU | Adjustment -- a negative amount becomes an order discount; a positive one a line with no product |
| A line with no quantity and no amount | Note -- ignored |
So a Xero rounding line such as rounding difference from orig invoice -0.91 never becomes a product, and the order still matches the invoice total exactly.
Reconciliation
Each invoice's lines, shipping and tax must add up to the invoice's own total:
| Difference | What happens |
|---|---|
| Under a cent | Reconciled |
| Up to 0.05 | Rounding reconciled -- the difference is added as a visible adjustment |
| Larger | Totals differ -- held back until you choose Add an adjustment so the order matches the invoice or Use the line items as calculated |
Line discounts are checked against the line amount (as a percentage, as Xero writes them, or as an amount), and tax-inclusive lines are imported ex tax. When per-line tax and the invoice tax differ by rounding, the invoice's tax total is used.
Payment status and revenue
Payment status comes only from the file -- the amounts paid, due and credited, the status column, or the default you chose. The importer never assumes an invoice was paid.
MerchantFlow counts Paid and Processing orders as revenue, and not Pending ones. Count revenue from unpaid invoices decides how unpaid invoices land:
| Invoice | When paid (default) | On the invoice date |
|---|---|---|
| Paid | Paid -- counts | Paid -- counts |
| Partly paid or unpaid | Pending -- not in the P&L until it is paid | Processing -- counts on the invoice date |
Each invoice in the review shows Counts in P&L or Pending - not in P&L until paid.
Credits applied to an invoice are recorded as a refund on the invoice date (Xero's export carries no credit-note date). For example, an invoice of NZ$396.76 with NZ$32.75 credited and NZ$364.01 outstanding imports as a pending order with a NZ$32.75 credit. Once it is paid, re-import the updated export: the same order is updated to paid, with net revenue of NZ$364.01.
Not imported: voided, deleted and draft invoices, invoices awaiting approval, bills, and credit notes -- a credit note's effect already comes through the credited amount on its invoice, so importing it too would count it twice. A fully credited invoice is skipped as well, since it has no net revenue, unless you choose Import it anyway.
Multi-currency invoices
Orders are stored in your reporting currency. An invoice in another currency is never imported without a confirmed exchange rate:
- No rate in the file -- the review suggests the market rate for the invoice date. Accept it per invoice with Use market rate, or for all at once with Use suggested market rates, or type your own (
1 USD = 1.71 NZD). - A rate column in the file -- its direction is checked, not assumed. Xero writes rates as invoice currency per one unit of your currency, other tools the other way round. The importer compares both readings with the market rate. If only one fits, it uses that one; if both or neither fit, or no market rate is available, you choose.
The original currency, the original amounts and the rate used are kept with the order for auditing.
COGS
Imported orders use your existing product costs unless you override them. When more than one applies:
- Order COGS override -- the order's total cost. Line costs, where given, decide how it is split across lines.
- Unit COGS on a line -- used for that line. The order's other lines take their standard product cost at the time of import, and the order's total is then fixed.
- Standard product costs -- with no override at all, COGS follows your product costs and updates if you change them, exactly like a hand-entered order.
FOB orders -- tick FOB order (or use an incoterm column starting FOB) when the buyer arranges freight from your supplier. The order gets no fulfilment cost, and standard costs leave out the handling component. If your product costs include inbound freight or duty, enter the FOB cost as an override.
Importing the same file twice
Imports are safe to repeat. Each invoice is identified by its invoice number:
| On a later import, the invoice is... | What happens |
|---|---|
| Unchanged | Skipped -- Already imported |
| Changed (for example, now paid) | Its existing order is updated in place |
| Changed, but you edited the order in MerchantFlow | Kept as you left it, unless you choose Update the existing order |
| The same number as a hand-entered B2B order's reference | Held back unless you choose Import it anyway |
| The same number, but a different customer | Held back -- never overwritten |
Common questions
Do imported orders affect ROAS, CAC or customer LTV? No. They are B2B orders: excluded from ad-spend allocation and from paid-acquisition metrics, and buyers are never added as customers. See Sales Channels.
Can I edit an imported order? Yes, with Edit like any manual order. Its credit is kept. A later re-import of a changed invoice then keeps your edit by default.
Why is an invoice missing from revenue? It is probably Pending -- unpaid or partly paid, with Count revenue from unpaid invoices set to When paid. Re-import the export once it is paid, or choose On the invoice date.
Does the importer connect to Xero directly? No. It reads a CSV export, so it works with Xero and with any other tool that can export invoice lines.
Do imported orders count toward my plan's order allowance? Yes, like every order.
Related
- Manual Orders -- enter one order by hand
- Sales Channels -- the Online / B2B split
- COGS Management -- product costs
Last updated: 6 November 2026
Last updated on
Manual Orders - Record B2B and Wholesale Revenue
Enter wholesale, B2B, and off-platform orders into MerchantFlow by hand so revenue that never touches your storefront still reaches your P&L, with full COGS and fulfillment cost attribution.
Sales Channels - Split Online and B2B Wholesale Reporting
Read your P&L as your whole business, online (D2C) orders only, or B2B wholesale only, and let MerchantFlow classify wholesale orders automatically from payment method, order tags, or Shopify draft orders.