Supply Lens

Prices, discounts and delivery details

Lesson 7 of 12 8 min read

Get totals, coupons, tax and quantities right, and carry delivery notes, ship dates and tags through to fulfilment.

An order that arrives with the wrong total or without the customer's delivery note causes a credit, a complaint or a failed delivery. This lesson covers the order settings that decide how money, quantities and fulfilment details are carried across, so the order in your inventory system matches what the customer paid for and asked for.

Decision 1: how should discounts be applied?

couponTypesToProcessThe WooCommerce coupon types to apply as order-level discount adjustments. Only include coupon types whose discount isn't already reflected in the line prices.
metadataLineAdjustmentsA list of order metadata keys to turn into adjustments, either charges or discounts. Use it when a plugin stores an extra fee or discount on the order as metadata rather than as a normal line.

Avoid double discounts

Some coupon types reduce the price of each line; others take money off the order as a whole. If a coupon's discount is already in the line prices and you also list its type in couponTypesToProcess, the customer is discounted twice. Check a sample order for each coupon type you use before adding it.

Each entry in metadataLineAdjustments has these parts:

metadataKeyThe WooCommerce metadata key to read the amount from.
metadataCurrencyKeyOptional. A metadata key holding the currency for this adjustment.
productNameThe name the adjustment line will show.
skuOptional. A SKU to put on the adjustment line, for example to match a service item in your inventory system.
isChargetrue treats the amount as a charge (adds to the order); false treats it as a discount.

Decision 2: tax and quantities

tryDetermineTaxInclusionWhen true, Supply Lens tries to work out from the WooCommerce data whether prices include or exclude tax. Helps tax calculate correctly, particularly where a tax plugin presents tax differently from standard WooCommerce.
quantityInformationOptional. Adjusts line quantities using a metadata value as a multiplier. You give a regex pattern to match metadata, the metadata key holding the multiplier, and a divide flag that inverts it. A skuRegexPattern limits it to certain SKUs.

A regex (regular expression) is a pattern for matching text, such as "any SKU starting with CASE-". quantityInformation is for stores that sell in packs: if a plugin records "pack of 6" as metadata and your inventory system counts single units, the multiplier turns one pack into six units. Ask your Supply Lens contact to help write the pattern.

Decision 3: where is it fulfilled, and when?

defaultFulfillmentLocationIdThe fulfilment Location (warehouse) assigned to every imported order.
earliestShipDateMetaDataKeyThe metadata key holding the earliest date the order should ship, for example from a delivery-date plugin.
earliestShipDateMetaDataFormatHow that date is written, in .NET format syntax, for example yyyy-MM-dd for 2026-11-04.

The format must match the plugin's value exactly. If the plugin writes 04/11/2026, the format would be dd/MM/yyyy.

Decision 4: what notes and extra data should travel with the order?

storeCustomerNoteInShippingInstructionsWhen true, the note the customer typed at checkout is stored in the order's shipping instructions, so delivery notes reach the warehouse.
noteMetadataItemsMetadata keys whose values are added to the order notes, for example a gift message.
metaDataParseItemsMetadata records to extract and include in the imported Document.
shippingLineMetadataMetadata keys to read from WooCommerce shipping lines, such as details a shipping plugin adds.

Decision 5: should orders be tagged for routing?

documentLevelTagGenerationRules that add tags to orders based on order attributes.
documentLevelAdvancedTagGenerationMore advanced rules for the same purpose.

Tags are labels on a Document. Mappings can match on tags, so tagging lets you route different kinds of order differently: for example, sending some orders to one warehouse and the rest to another. The settings guide doesn't describe the rule format, so ask your Supply Lens contact to set these up.

Fernbrook's checkout extras

Fernbrook's store uses three plugins: a gift-wrap fee stored as metadata gift_wrap_fee, a gift message stored as gift_message, and a delivery-date picker that stores ship_after as 2026-11-04.

Priya adds a metadataLineAdjustments entry with metadataKey gift_wrap_fee, productName Gift wrapping, the SKU of the gift-wrap service item in Unleashed, and isCharge true. She adds gift_message to noteMetadataItems, sets earliestShipDateMetaDataKey to ship_after with format yyyy-MM-dd, and turns on storeCustomerNoteInShippingInstructions.

Fernbrook's 10%-off coupons already reduce each line price, so she leaves that coupon type out of couponTypesToProcess.

Recap

  • couponTypesToProcess applies order-level discounts: leave out coupon types already in line prices.
  • metadataLineAdjustments turns plugin metadata into charge or discount lines.
  • tryDetermineTaxInclusion and quantityInformation help totals and quantities come out right.
  • defaultFulfillmentLocationId and the earliest ship date settings control where and when orders ship.
  • Notes, metadata and tags can travel with the order so the warehouse sees what it needs.

Quick guides for this topic

Complete and take the quiz

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