> ## Documentation Index
> Fetch the complete documentation index at: https://dev.smile.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Purchase a points product

> `Smile.purchasePointsProduct(id, options?)`

<Danger>
  This method is deprecated and will be removed on August 1, 2026. Specify `includeSdk: true` when [initializing Smile UI](/ui/initializing), and then use the [`Smile.pointsProducts.purchase()`](/js/resources/points-products/purchase) method from the JavaScript SDK instead.
</Danger>

This method exchanges the currently logged-in customer's points for a specified reward.

## Parameters

<ParamField path="id" type="integer" required>
  The unique identifier of the points product to be purchased.
</ParamField>

<ParamField path="options" type="object">
  <Expandable title="properties">
    <ParamField path="points_to_spend" type="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 `exchange_type` is variable, otherwise should be left blank.
    </ParamField>
  </Expandable>
</ParamField>

## Returns

This method returns a `Promise` that:

* On success, resolves with a [points purchase](/ui/objects/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.

<Panel>
  ```javascript JavaScript lines theme={null}
  // Purchase a fixed points product
  Smile.purchasePointsProduct(132456921).then(
    (pointsPurchase) => {
      // Handle the points purchase object
    }
  );

  // Purchase a variable points product
  Smile.purchasePointsProduct(
    132456921,
    { pointsToSpend: 500 }
  ).then((pointsPurchase) => {
    // Handle the points purchase object
  });
  ```
</Panel>
