Preview prices
Previews calculations for one or more prices. Typically used for building pricing pages.
You can provide location information when previewing prices. You must provide this if you want Paddle to calculate tax or automatically localize prices. You can provide one of:
customer_ip_address
: Paddle fetches location using the IP address to calculate totals.address
: Paddle uses the country and ZIP code (where supplied) to calculate totals.customer_id
,address_id
,business_id
: Paddle uses existing customer data to calculate totals. Typically used for logged-in customers.
If successful, your response includes the data you sent with a details
object that includes totals for the supplied prices.
Each line item includes formatted_unit_totals
and formatted_totals
objects that return totals formatted for the country or region you're working with, including the currency symbol.
You can work with the preview prices operation using the Paddle.PricePreview()
method in Paddle.js. When working with Paddle.PricePreview()
, request and response fields are camelCase
rather than snake_case
.
Request Body
List of items to preview price calculations for.
Paddle ID for the price to add to this transaction, prefixed with pri_
.
Quantity of the item to preview.
Paddle ID of the customer that this preview is for, prefixed with ctm_
.
Paddle ID of the address that this preview is for, prefixed with add_
. Send one of address_id
, customer_ip_address
, or the address
object when previewing.
Paddle ID of the business that this preview is for, prefixed with biz_
.
Supported three-letter ISO 4217 currency code.
Paddle ID of the discount applied to this preview, prefixed with dsc_
.
Address for this preview. Send one of address_id
, customer_ip_address
, or the address
object when previewing.
Supported two-letter ISO 3166-1 alpha-2 country code for this address.
ZIP or postal code of this address. Include for more accurate tax calculations.
IP address for this transaction preview. Send one of address_id
, customer_ip_address
, or the address
object when previewing.
Response
Paddle ID of the customer that this preview is for, prefixed with ctm_
.
Paddle ID of the address that this preview is for, prefixed with add_
. Send one of address_id
, customer_ip_address
, or the address
object when previewing.
Paddle ID of the business that this preview is for, prefixed with biz_
.
Supported three-letter ISO 4217 currency code.
Paddle ID of the discount applied to this preview, prefixed with dsc_
.
Address for this preview. Send one of address_id
, customer_ip_address
, or the address
object when previewing.
IP address for this transaction preview. Send one of address_id
, customer_ip_address
, or the address
object when previewing.
Calculated totals for a price preview, including discounts, tax, and currency conversion.
List of available payment methods for Paddle Checkout given the price and location information passed.
Information about this response.
Unique ID for the request relating to this response. Provide this when contacting Paddle support about a specific request.
1234567891011121314151{
2 "items": [
3 {
4 "quantity": 20,
5 "price_id": "pri_01gsz8z1q1n00f12qt82y31smh"
6 },
7 {
8 "quantity": 1,
9 "price_id": "pri_01h1vjfevh5etwq3rb416a23h2"
10 }
11 ],
12 "currency_code": "USD",
13 "discount_id": "dsc_01gtgztp8fpchantd5g1wrksa3",
14 "customer_ip_address": "34.232.58.13"
15}