Skip to main content
Returns the bonus campaign running on a product, such as double points this weekend. Returns null when the product isn’t part of an active campaign.

Usage

Parameters

number | string
required
The product ID.

Example

endsAt is in UTC. Pass your store’s timezone when formatting a date, otherwise customers see it in their own timezone.
To show how much the customer earns with the bonus, use getProductEarningValue. Only show bonus messaging when its bonusApplied is true.

Response

data is null when no campaign applies to the product.
string
"multiplier" (for example double points) or "tiered" (a bonus for spending over an amount).
string
The campaign name.
number
Multiplier campaigns only. For example 2 for double points.
array
Tiered campaigns only. Each tier has spendFormatted ("$500.00") and bonusFormatted ("$25.00" or "500"), plus the raw numbers spendThreshold and bonusValue.
string
When the campaign ends, as an ISO 8601 date in UTC.
object | null
Set when the campaign only applies if a specific product is in the cart: { met, productIds }, where met is true once one of productIds is in the cart. Otherwise null.
string
Error message when success is false.