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

// Purchase a variable points product
Smile.pointsProducts.purchase(
  132456921,
  { pointsToSpend: 500 }
).then((pointsPurchase) => {
  // Handle the points purchase object
});
This async 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: If the method is improperly invoked (e.g. missing required parameters) or no customer is currently logged in, the Promise will be rejected.