> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name: getPricePreview(planId: string, options: GetPricePreviewOptions)

# Method package: wixPricingPlansV2

# Method menu location: wixPricingPlansV2 --> orders --> getPricePreview

# Method Link: https://dev.wix.com/docs/velo/apis/wix-pricing-plans-v2/orders/get-price-preview.md

# Method Description:

Retrieves a plan's pricing.

The price preview uses the same logic as purchasing a plan, but the preview is not saved. Tax is only applied if
the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection). The price is returned
in the pricing model format used for orders. Learn more about pricing models ([REST](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/introduction.md#pricing-models)).

Buyers do not have to be logged in to preview the price, and as such, the details returned are not buyer-specific. To
generate a preview of a purchase for a specific buyer, call Get Offline Order Preview.



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## Get a price preview for an order

```javascript
import { orders } from 'wix-pricing-plans.v2';

/* Sample planId value: '838f2c9d-c8d0-4799-a10a-e2f23849db10' */

export async function myGetPricePreviewFunction(planId) {
  try {
    const pricePreview = await orders.getPricePreview(planId);

    return pricePreview;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}
/* Promise resolves to:
 * {
 *   "prices": [
 *     {
 *       "duration": {
 *         "cycleFrom": 1,
 *         "numberOfCycles": 2
 *       },
 *       "price": {
 *         "currency": "USD",
 *         "discount": "0"
 *         "proration": "0",
 *         "subtotal": "500.00",
 *         "tax": {
 *           "name": "Tax",
 *           "includedInPrice": false,
 *           "rate": "6.5",
 *           "amount": "32.50"
 *         },
 *         "total": "532.50"
 *       }
 *     }
 *   ]
 * }
 */ 
```

## Get a price preview for an order (export from backend code)

```javascript
import { Permissions, webMethod } from 'wix-web-module';
import { orders } from 'wix-pricing-plans.v2';

// Sample planId value: '838f2c9d-c8d0-4799-a10a-e2f23849db10' 


export const myGetPricePreviewFunction = webMethod(Permissions.Anyone, async (planId) => {
  try {
    const pricePreview = await orders.getPricePreview(planId);

    return pricePreview;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
});
/* Promise resolves to:
 * {
 *   "prices": [
 *     {
 *       "duration": {
 *         "cycleFrom": 1,
 *         "numberOfCycles": 2
 *       },
 *       "price": {
 *         "currency": "USD",
 *         "discount": "0"
 *         "proration": "0",
 *         "subtotal": "500.00",
 *         "tax": {
 *           "name": "Tax",
 *           "includedInPrice": false,
 *           "rate": "6.5",
 *           "amount": "32.50"
 *         },
 *         "total": "532.50"
 *       }
 *     }
 *   ]
 * }
 */

```

## Get a price preview for an order with options 

```javascript
import { Permissions, webMethod } from 'wix-web-module';
import { orders } from 'wix-pricing-plans.v2';

/* Sample planId value: '838f2c9d-c8d0-4799-a10a-e2f23849db10'
 *
 * Sample options value:
 * {
 *   couponCode: 'SUMMERSALE'
 * }
 */ 

export const myGetPricePreviewFunction = webMethod(Permissions.Anyone, async (planId, options) => {
  try {
    const pricePreview = await orders.getPricePreview(planId, options);

    return pricePreview;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
});

/* Promise resolves to:
 * {
 *   "prices": [
 *     {
 *       "duration": {
 *         "cycleFrom": 1,
 *         "numberOfCycles": 1
 *       },
 *       "price": {
 *         "coupon": {
 *           "code": "SUMMERSALE",
 *           "amount": "90.00",
 *           "_id": "271d5fe4-2105-47b8-81c1-b24201d1be68"
 *         },
 *         "discount": "90.00",
 *         "currency": "USD",
 *         "subtotal": "125.00",
 *         "tax": {
 *           "amount": "2.28",
 *           "includedInPrice": false,
 *           "name": "Tax",
 *           "rate": "6.5",
 *         },
 *         "total": "37.28"
 *       }
 *     },
 *     {
 *       "duration": {
 *         "cycleFrom": 2
 *       },
 *       "price": {
 *         "coupon": {
 *           "code": "SUMMERSALE",
 *           "amount": "90.00",
 *           "_id": "271d5fe4-2105-47b8-81c1-b24201d1be68"
 *         },
 *         "discount": "90.00",
 *         "currency": "USD",
 *         "subtotal": "100.00",
 *         "tax": {
 *           "amount": "0.65",
 *           "includedInPrice": false,
 *           "name": "Tax",
 *           "rate": "6.5"
 *         },
 *         "total": "10.65",
 *       }
 *     }
 *   ]
 * }
 */ 

```

---