- Bonus campaigns: when a bonus campaign is boosting the product, it also returns what the customer would normally earn, for messages like “Usually 250 points”.
Usage
Parameters
number | string
required
The product ID.
number | string
required
The selected variant ID.
number
The selected variant’s price in cents, as Liquid’s
{{ variant.price }} outputs it. Optional, but makes the call faster.number
default:"1"
The quantity to calculate for.
Example
Response
number
What the customer earns, including any bonus. Points in points mode (
500), or the store credit amount in store credit mode (140 for $140.00).string
value ready to display: "500" or "$140.00".number
What the customer would normally earn, without the bonus. Equal to
value when no bonus applies.string
regularValue ready to display.boolean
true when a bonus campaign is increasing what this customer earns on this product. Use it to decide whether to show bonus messaging.string
"points" or "store_credit". Use it to choose your wording.string
Error message when
success is false. Hide your message in that case.