Loyalty API

Type

AssetProgress1

Numeric display progress toward an achievement.

Kind Type
Used in Cart2, CustomerBalance3, EstimateAccrual1, ListCustomers3, LoggedOutBalance1, QueryOrderDetails1

For a “Make 5 orders” achievement, {"current":1,"target":5} means one qualifying order. An order-count counter counts orders, not the number of items in them.

Values reflect the latest evaluation and are not capped at the target. Completing an achievement can reset current to zero while the asset's is_completed and is_rewarded remain true. Recurring achievements then track the next cycle. Use those flags to display completion rather than comparing these counters.

Per-order achievements always report current=0 and target=1, even after being earned. They have no partial progress.

When no customer progress has been recorded, including in LoggedOutBalance1, supported counters return zero current with the achievement's target.

Units depend on the achievement: orders, items, categories, referrals, actions, a configured counter, or whole currency units. Spend counters use the currency of the achievement's spend requirement, not cents: current is rounded down and target up. For example, 19.99 toward 20.01 returns 19 of 21. These values are not converted to the requested market's currency.

Properties

  • current integer required

    Latest evaluated counter value. Always included, including when zero.

  • target integer required

    Positive target for this counter.

Previous
Asset2