Preview prices
POST {{baseUrl}}/pricing-preview
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
{"items"=>[{"quantity"=>"<integer>", "price_id"=>"<string>"}], "customer_id"=>"<string>", "address_id"=>"<string>", "business_id"=>"<string>", "currency_code"=>"<string>", "discount_id"=>"<string>", "address"=>{"country_code"=>"<string>", "postal_code"=>"<string,null>"}, "customer_ip_address"=>"<string,null>"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |