Supply Lens

How should shipping, discounts and tax appear?

Lesson 15 of 24 8 min read

Decide whether shipping, discounts and charges become named product lines, how tax is calculated, and what happens to lines with no SKU.

A sales order is more than its products. Shipping, discount codes, marketplace commission and tax all have to land somewhere, and where they land affects your margins report and what Unleashed passes to your accounting system. This lesson groups the settings for these "non-product" amounts.

Decision 1: shipping as a charge or a product line?

By default, shipping arrives as a charge. You can make it a product line instead, which gives it a product code you can report on.

shippingProductCodeCreates shipping as a line using this product code, rather than as a charge.
shippingLineProductCodeMapMaps individual shipping lines, by carrier or title, to product codes, with a fallback. Use it when different services should be reported separately.
shippingLineXeroSalesAccountThe sales account code set on shipping lines that Unleashed passes to Xero.
handleMixedTaxShippingLinesHandles shipping lines that mix taxable and non-taxable amounts so tax is calculated correctly in Unleashed.

Decision 2: discounts and charges

Without a product code, an adjustment such as a discount or a fee is created as a generic Charge line. Mapping it to a product code creates a proper named line instead.

discountProductCodeMapMaps discount adjustments to product codes, with a fallback.
chargeProductCodeMapMaps charges such as surcharges and fees to product codes, with a fallback.
adjustmentDescriptionMapReplaces the default Charge: … or Discount: … text on the created line.
adjustmentXeroSalesAccountMapSets the Xero sales account code on the created line.

Adjustments are matched on their code, reason, whether they are a charge or a discount, and a minimum or maximum amount. Code and reason matching is exact and case-sensitive. For example, to give a marketplace's brand discount and commission their own products:

"discountProductCodeMap": {
  "items": [
    { "adjustmentReason": "Brand Discounts", "isCharge": false, "value": "DISCOUNT" },
    { "adjustmentReason": "Commission", "isCharge": false, "value": "COMMISSION" }
  ]
}

Named lines do not round-trip

If you also import orders back out of Unleashed, a line created this way is read as an ordinary product line, not as an adjustment.

Decision 3: how is tax handled?

matchToNearestTaxRateMatches the incoming tax rate to the nearest rate configured in Unleashed instead of requiring an exact match. Useful when a channel sends rates like 0.1999.
setOrderTaxRateFromLinesSets the order's overall tax rate from the largest rate found on its lines.
groupTaxesAsLineItemsBreaks the order's taxes out as separate lines or charges instead of including them in unit prices. Mostly for regions where tax is reported as its own line.
groupTaxesExcludedCountriesUnleashed country IDs excluded from groupTaxesAsLineItems; orders to these countries are taxed normally.
productCodeForTaxLinesWith groupTaxesAsLineItems on, maps tax rates (as decimals, such as 0.15) to product codes, so each tax line is a product line.

Most UK businesses need only matchToNearestTaxRate, and sometimes setOrderTaxRateFromLines. Rounding is a closely related topic with its own lesson in the advanced module.

Decision 4: what about lines with no SKU?

defaultProductCodeWhenMissingSkuThe Unleashed product code to use for order lines that have no SKU at all in the source system, so the line is still created against a placeholder product.

This catches lines with no SKU, such as a custom item keyed in the shop. It does not rescue a line whose SKU is present but does not exist in Unleashed: that still holds the order with a product-not-found error, which you fix by aligning SKUs.

Decision 5: journal only to accounting?

Three settings, sendAccountingJournalOnly, sendAccountingJournalOnlyBySourceIntegration and sendAccountingJournalOnlyByTag, control whether Unleashed sends only an accounting journal to Xero or QuickBooks Online rather than the invoice. They are covered in the COGS lessons in the advanced module.

Hilltop's charges

Hilltop's finance team wants web shipping and café delivery reported separately, and the Shopify discount code WELCOME10 visible as its own line. Priya creates two non-stock products in Unleashed, SHIP-WEB and SHIP-CAFE, and uses shippingLineProductCodeMap to route each shipping line, with shippingLineXeroSalesAccount set to Hilltop's carriage income account. She maps discounts to a DISCOUNT product with discountProductCodeMap, and turns on matchToNearestTaxRate.

Recap

  • Shipping and adjustments become generic charges unless you map them to product codes.
  • Adjustment matching on code and reason is exact and case-sensitive.
  • matchToNearestTaxRate is the most common tax setting; tax-as-lines is for specific regions.
  • defaultProductCodeWhenMissingSku handles lines with no SKU, not SKUs missing from Unleashed.
  • Xero sales accounts can be set on shipping and adjustment lines.

Quick guides for this topic

Complete and continue

Your progress is saved in this browser. Create a free account to keep it everywhere, take quizzes and earn certificates.