Skip to content

Main content

Coupon Gift Qualifying Base Flag Tool

Calculate coupon gift qualifying base flag from explicit caller-supplied inputs.

Loading tool…

Description

Add giftValue to purchasedValue only when includeGift is true.

Fixed and percentage discounts act differently and may produce different prices when their order changes. Threshold pricing also depends on whether a new rate applies to all units.

Add giftValue to purchasedValue only when includeGift is true.

When to use this tool

Use Coupon Gift Qualifying Base Flag when you need a transparent promotional price or eligibility term.

How to use the tool and how it works

  1. Enter purchasedValue, giftValue, suppliedThreshold, includeGift. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read qualifyingBase, qualifies. Inspect qualifies before interpreting the associated values.

Add giftValue to purchasedValue only when includeGift is true. Compare that qualifyingBase inclusively with suppliedThreshold.1

Input fieldMeaning and unitsAccepted input
purchasedValuePurchased ValueRequired. Finite number; minimum 0.
giftValueGift ValueRequired. Finite number; minimum 0.
suppliedThresholdSupplied ThresholdRequired. Finite number; minimum 0.
includeGiftInclude GiftRequired. Boolean.
Output fieldInterpretationReturned shape
qualifyingBaseQualifying BaseRequired. Finite number.
qualifiesQualifiesRequired. Boolean.
json
{
  "input": {
    "purchasedValue": 80,
    "giftValue": 30,
    "suppliedThreshold": 100,
    "includeGift": false
  },
  "output": {
    "qualifyingBase": 80,
    "qualifies": false
  }
}

Limitations and assumptions

  • The inclusion rule is caller supplied; actual promotional terms, taxes, and item eligibility are not checked.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Check actual offer terms, item eligibility, taxes, and monetary rounding before applying a computed price.

References

  1. Calculation and input contract: marketing/coupon-gift-qualifying-base-flag — tool.io

Similar or alternative tools