# POST /pricing-preview

**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](https://developer.paddle.com/build/products/offer-localized-pricing). 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()`](https://developer.paddle.com/paddlejs/methods/paddle-pricepreview) method in Paddle.js. When working with `Paddle.PricePreview()`, request and response fields are `camelCase` rather than `snake_case`.

**Required permissions:** `transaction.read`

## Request body

- `customer_id` — Paddle ID of the customer that this preview is for, prefixed with `ctm_`.
- `address_id` — 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.
- `business_id` — Paddle ID of the business that this preview is for, prefixed with `biz_`.
- `currency_code` — Supported three-letter ISO 4217 currency code.
- `discount_id` — Paddle ID of the discount applied to this preview, prefixed with `dsc_`.
- `address` — Address for this preview. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
- `customer_ip_address` — IP address for this transaction preview. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
- `items`: array (required) — List of items to preview price calculations for. (Items: 1–100)

### Request example

```json
{
  "items": [
    {
      "quantity": 20,
      "price_id": "pri_01gsz8z1q1n00f12qt82y31smh"
    },
    {
      "quantity": 1,
      "price_id": "pri_01h1vjfevh5etwq3rb416a23h2"
    }
  ],
  "currency_code": "USD",
  "discount_id": "dsc_01gtgztp8fpchantd5g1wrksa3",
  "customer_ip_address": "34.232.58.13"
}
```

## Response (200)

- `data`: object (required)
  - `customer_id` (required) — Paddle ID of the customer that this preview is for, prefixed with `ctm_`.
  - `address_id` (required) — 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.
  - `business_id` (required) — Paddle ID of the business that this preview is for, prefixed with `biz_`.
  - `currency_code` (required) — Supported three-letter ISO 4217 currency code.
  - `discount_id` (required) — Paddle ID of the discount applied to this preview, prefixed with `dsc_`.
  - `address` (required) — Address for this preview. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
  - `customer_ip_address` (required) — IP address for this transaction preview. Send one of `address_id`, `customer_ip_address`, or the `address` object when previewing.
  - `details`: object (required) — Calculated totals for a price preview, including discounts, tax, and currency conversion.
    - `line_items`: array (required)
  - `available_payment_methods`: array (required)
- `meta`: object (required) — Information about this response.
  - `request_id`: string (required) — Unique ID for the request relating to this response. Provide this when contacting Paddle support about a specific request.

### Response example

```json
{
  "data": {
    "customer_id": null,
    "address_id": null,
    "business_id": null,
    "currency_code": "USD",
    "address": {
      "postal_code": "20149",
      "country_code": "US"
    },
    "customer_ip_address": "34.232.58.13",
    "discount_id": "dsc_01gtgztp8fpchantd5g1wrksa3",
    "details": {
      "line_items": [
        {
          "price": {
            "id": "pri_01gsz8z1q1n00f12qt82y31smh",
            "description": "Annual",
            "type": "standard",
            "name": "Annual (per seat)",
            "product_id": "pro_01gsz4t5hdjse780zja8vvr7jg",
            "billing_cycle": {
              "interval": "year",
              "frequency": 1
            },
            "trial_period": null,
            "tax_mode": "account_setting",
            "unit_price": {
              "amount": "30000",
              "currency_code": "USD"
            },
            "unit_price_overrides": [],
            "custom_data": null,
            "quantity": {
              "minimum": 1,
              "maximum": 999
            },
            "status": "active",
            "created_at": "2023-02-23T13:56:20.833019Z",
            "updated_at": "2024-04-11T13:47:49.566301Z",
            "import_meta": null
          },
          "quantity": 20,
          "tax_rate": "0",
          "unit_totals": {
            "subtotal": "30000",
            "discount": "3000",
            "tax": "0",
            "total": "27000"
          },
          "formatted_unit_totals": {
            "subtotal": "$300.00",
            "discount": "$30.00",
            "tax": "$0.00",
            "total": "$270.00"
          },
          "totals": {
            "subtotal": "600000",
            "discount": "60000",
            "tax": "0",
            "total": "540000"
          },
          "formatted_totals": {
            "subtotal": "$6,000.00",
            "discount": "$600.00",
            "tax": "$0.00",
            "total": "$5,400.00"
          },
          "product": {
            "id": "pro_01gsz4t5hdjse780zja8vvr7jg",
            "name": "AeroEdit Pro",
            "description": "Designed for professional pilots, including all features plus in Basic plus compliance monitoring, route optimization, and third-party integrations.",
            "type": "standard",
            "tax_category": "standard",
            "image_url": "https://paddle.s3.amazonaws.com/user/165798/bT1XUOJAQhOUxGs83cbk_pro.png",
            "custom_data": {
              "features": {
                "aircraft_performance": true,
                "compliance_monitoring": true,
                "flight_log_management": true,
                "payment_by_invoice": false,
                "route_planning": true,
                "sso": false
              },
              "suggested_addons": [
                "pro_01h1vjes1y163xfj1rh1tkfb65",
                "pro_01gsz97mq9pa4fkyy0wqenepkz"
              ],
              "upgrade_description": "Move from Basic to Pro to take advantage of aircraft performance, advanced route planning, and compliance monitoring."
            },
            "status": "active",
            "created_at": "2023-02-23T12:43:46.605Z",
            "updated_at": "2024-04-05T15:53:44.687Z",
            "import_meta": null
          },
          "discounts": [
            {
              "discount": {
                "id": "dsc_01gtgztp8fpchantd5g1wrksa3",
                "status": "active",
                "description": "Black Friday 2024",
                "enabled_for_checkout": true,
                "mode": "standard",
                "code": "BF2024",
                "type": "percentage",
                "amount": "10",
                "currency_code": "USD",
                "recur": false,
                "maximum_recurring_intervals": null,
                "usage_limit": 1000,
                "restrict_to": null,
                "expires_at": "2024-12-03T00:00:00Z",
                "times_used": 0,
                "custom_data": null,
                "import_meta": null,
                "discount_group_id": null,
                "created_at": "2023-03-02T11:03:00.623Z",
                "updated_at": "2023-08-22T13:32:28.295Z"
              },
              "total": "60000",
              "formatted_total": "$600.00"
            }
          ]
        },
        {
          "price": {
            "id": "pri_01h1vjfevh5etwq3rb416a23h2",
            "description": "Monthly",
            "type": "standard",
            "name": "Monthly (recurring addon)",
            "product_id": "pro_01h1vjes1y163xfj1rh1tkfb65",
            "billing_cycle": {
              "interval": "month",
              "frequency": 1
            },
            "trial_period": null,
            "tax_mode": "account_setting",
            "unit_price": {
              "amount": "10000",
              "currency_code": "USD"
            },
            "unit_price_overrides": [],
            "custom_data": null,
            "quantity": {
              "minimum": 1,
              "maximum": 100
            },
            "status": "active",
            "created_at": "2023-06-01T13:31:12.625056Z",
            "updated_at": "2024-04-09T07:23:00.907834Z",
            "import_meta": null
          },
          "quantity": 1,
          "tax_rate": "0",
          "unit_totals": {
            "subtotal": "10000",
            "discount": "1000",
            "tax": "0",
            "total": "9000"
          },
          "formatted_unit_totals": {
            "subtotal": "$100.00",
            "discount": "$10.00",
            "tax": "$0.00",
            "total": "$90.00"
          },
          "totals": {
            "subtotal": "10000",
            "discount": "1000",
            "tax": "0",
            "total": "9000"
          },
          "formatted_totals": {
            "subtotal": "$100.00",
            "discount": "$10.00",
            "tax": "$0.00",
            "total": "$90.00"
          },
          "product": {
            "id": "pro_01h1vjes1y163xfj1rh1tkfb65",
            "name": "Analytics addon",
            "description": "Unlock advanced insights into your flight data with enhanced analytics and reporting features. Includes customizable reporting templates and trend analysis across flights.",
            "type": "standard",
            "tax_category": "standard",
            "image_url": "https://paddle.s3.amazonaws.com/user/165798/97dRpA6SXzcE6ekK9CAr_analytics.png",
            "custom_data": null,
            "status": "active",
            "created_at": "2023-06-01T13:30:50.302Z",
            "updated_at": "2024-04-05T15:47:17.163Z",
            "import_meta": null
          },
          "discounts": [
            {
              "discount": {
                "id": "dsc_01gtgztp8fpchantd5g1wrksa3",
                "status": "active",
                "description": "Black Friday 2024",
                "enabled_for_checkout": true,
                "mode": "standard",
                "code": "BF2024",
                "type": "percentage",
                "amount": "10",
                "currency_code": "USD",
                "recur": false,
                "maximum_recurring_intervals": null,
                "usage_limit": 1000,
                "restrict_to": null,
                "expires_at": "2024-12-03T00:00:00Z",
                "times_used": 0,
                "custom_data": null,
                "import_meta": null,
                "discount_group_id": null,
                "created_at": "2023-03-02T11:03:00.623Z",
                "updated_at": "2023-08-22T13:32:28.295Z"
              },
              "total": "1000",
              "formatted_total": "$10.00"
            }
          ]
        }
      ]
    },
    "available_payment_methods": [
      "apple_pay",
      "card",
      "paypal",
      "google_pay"
    ]
  },
  "meta": {
    "request_id": "b8a54261-3aca-41bc-9432-26d3753ecf8b"
  }
}
```
