Paddle Billing
Search

Paddle.PricePreview()

Previews localized prices given location information supplied.

Use Paddle.PricePreview() to return a pricing preview object for items and location information supplied.

Pricing preview objects hold calculated totals for prices, including discounts, taxes, and currency conversion. Typically used for building pricing pages. For more advanced pricing pages, consider the Paddle.TransactionPreview() method instead.

Accepts the same request body as the preview prices operation in the Paddle API, except fields must be formatted as camelCase rather than snake_case.

Returns a promise that contains an object that matches the response from the preview prices operation. Field names are camelCase rather than snake_case.

Requires a client-side token for authentication. If you're passing the older seller parameter to Paddle.Initialize(), replace this with token to use Paddle.PricePreview().

Parameters

requestobject

Pricing preview request body. Must include an items array.

Check the preview prices operation documentation to learn about the fields you can send in a request. Convert snake_case field names to camelCase, as is convention for JavaScript.

Examples

This example includes a request with two items where the country code is the United States.

The request is passed to Paddle.PricePreview(), which returns a promise. It prints the response to the console.

Related pages