// Purchase a fixed points productSmile.pointsProducts.purchase(132456921).then( (pointsPurchase) => { // Handle the points purchase object });// Purchase a variable points productSmile.pointsProducts.purchase( 132456921, { pointsToSpend: 500 }).then((pointsPurchase) => { // Handle the points purchase object});
Points Products
Purchase a points product
Smile.pointsProducts.purchase(id, options?)
JavaScript
// Purchase a fixed points productSmile.pointsProducts.purchase(132456921).then( (pointsPurchase) => { // Handle the points purchase object });// Purchase a variable points productSmile.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
integer
required
The unique identifier of the points product to be purchased.
object
Show properties
integer
A positive integer representing the number of points that will be spent on behalf of the customer. Only applies when purchasing a points product whose exchangeType is variable, otherwise should be left blank.