Skip to main content
JavaScript
// Purchase a fixed points product
Smile.purchasePointsProduct(132456921).then(
  (pointsPurchase) => {
    // Handle the points purchase object
  }
);

// Purchase a variable points product
Smile.purchasePointsProduct(
  132456921,
  { points_to_spend: 500 }
).then(
  (pointsPurchase) => {
    // Handle the points purchase object
  }
);
This method is deprecated. Specify includeSdk: true when initializing Smile UI, and then use the Smile.pointsProducts.purchase() method from the JavaScript SDK instead.
This method exchanges the currently logged-in customer’s points for a specified reward.

Parameters

id
integer
required
The unique identifier of the points product to be purchased.
options
object

Returns

This method returns a Promise that:
  • On success, resolves with a points purchase object.
  • On failure, resolves with an error object.
If the method is improperly invoked (e.g. missing required parameters) or no customer is currently logged-in, the Promise will be rejected.