Skip to content
← Back to Index

target ​

Keyword

 target(filter: (value) => boolean | nothing): [Target] 

The target keyword selects which parts of an order should be affected by a discount effect. It takes a filter function that receives each order line and fulfillment, returning true for items that should be targeted.

The result is passed to percentage or absolute as the first argument.

Availability ​

PromotionRuleReactorEgress
✓

Filter Function ​

The filter function receives each targetable entity on the order. You can use is pattern matching to distinguish between entity types:

  • fulfillment — a shipping/fulfillment entity
  • OrderLine — an individual order line

Examples ​

Target all fulfillments (free shipping) ​

filtrera
from percentage(target(e => e is Fulfillment), 100%)

Target specific order lines ​

filtrera
from absolute(target(e => e is OrderLine and e.productNumber == 'GIFT-WRAP'), 0)

Target by dynamic field ​

filtrera
from percentage(target(e => e is OrderLine and e.dynamic->'category' == 'clearance'), 30%)

Target everything ​

To target the entire order (all order lines and shipping), use the order symbol directly instead:

filtrera
from percentage(order, 10%)

See Also ​

© 2026 Hantera AB. Org. no.: 559242-9582