> 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`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetPricingBreakdown

# Package: suppliersHub

# Namespace: MarketplaceProvider

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/suppliers-hub/marketplace-provider-service-plugin/get-pricing-breakdown.md

## Introduction

Retrieves pricing breakdown for a product from the marketplace provider.

Wix calls this method when a site owner views pricing details in the Suppliers Hub Marketplace. Wix calls it only when your implementation enables it by setting `toggleGetPricingBreakdownEnabled` to `true` in `MarketplaceProviderConfig`.

Wix uses the response to display a pricing breakdown including base cost, suggested retail price, potential profit, and markup rate.

---

## REST API

### Schema

```
 Method: getPricingBreakdown
 Description: Retrieves pricing breakdown for a product from the marketplace provider.  Wix calls this method when a site owner views pricing details in the Suppliers Hub Marketplace. Wix calls it only when your implementation enables it by setting `toggleGetPricingBreakdownEnabled` to `true` in `MarketplaceProviderConfig`.  Wix uses the response to display a pricing breakdown including base cost, suggested retail price, potential profit, and markup rate.
 URL: null
 Method: POST
 Method parameters:
   param name: currency | type: currency | description: Currency for the pricing breakdown.  | validation: format CURRENCY
   param name: providerProductId | type: providerProductId | description: Product GUID on the provider's platform.  | validation: minLength 1, maxLength 36
 Return type: GetPricingBreakdownResponse
  - name: pricingBreakdown | type: PricingBreakdown | description: Pricing breakdown for the product.  
     - name: baseCostRange | type: PriceRange | description: Range of the base cost across all variants. This is the base cost charged by the provider.  
        - name: from | type: string | description: Lower bound of the price range.  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":3}
        - name: to | type: string | description: Upper bound of the price range. Absent when all variants have the same price.  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":3}
     - name: suggestedRetailPriceRange | type: PriceRange | description: Range of the suggested retail price across all variants. Calculated as cost multiplied by the markup rate.  
     - name: potentialProfitRange | type: PriceRange | description: Range of the potential profit across all variants. Calculated as the suggested retail price minus the base cost.  
     - name: markupRate | type: string | description: Markup rate applied to the base cost to calculate the suggested retail price. For example, `0.60` for a 60% markup, or `2.5` for a 250% markup.  | validation: decimalValue {"gte":"0","lte":"10","maxScale":3}
     - name: currency | type: string | description: Currency of the monetary values.  | validation: format CURRENCY


```

### Examples

### Get Pricing Breakdown
Retrieves pricing breakdown details for a marketplace product

```curl
curl -X POST \
'https://provider.example.com/v2/get-pricing-breakdown' \
-H 'user-agent: Wix' \
-H 'accept-encoding: gzip, deflate' \
-H 'content-type: text/plain; charset=utf-8' \
-d '{
  "providerProductId": "73cfa507-221b-417a-bd62-c7b62065068e",
  "currency": "USD"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.suppliersHub.MarketplaceProvider.getPricingBreakdown(request, metadata)
 Description: Retrieves pricing breakdown for a product from the marketplace provider.  Wix calls this method when a site owner views pricing details in the Suppliers Hub Marketplace. Wix calls it only when your implementation enables it by setting `toggleGetPricingBreakdownEnabled` to `true` in `MarketplaceProviderConfig`.  Wix uses the response to display a pricing breakdown including base cost, suggested retail price, potential profit, and markup rate.
 Method parameters:
   param name: metadata | type: Context | description: this message is not directly used by any service, it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform. e.g. SPIs, event-handlers, etc.. NOTE: this context object MUST be provided as the last argument in each Velo method signature.  Example: ```typescript export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) { ... } ```  
        - name: requestId | type: string | description: A unique identifier of the request. You may print this GUID to your logs to help with future debugging and easier correlation with Wix's logs.  
        - name: currency | type: string | description: [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.  | validation: format CURRENCY
        - name: identity | type: IdentificationData | description: An object that describes the identity that triggered this request.  
           - ONE-OF: 
              - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site.  | validation: format GUID
              - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site.  | validation: format GUID
              - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.).  | validation: format GUID
              - name: appId | type: string | description: GUID of an app.  | validation: format GUID
        - name: languages | type: array<string> | description: A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`.  
        - name: instanceId | type: string | description: The service provider app's instance GUID.  | validation: format GUID
   param name: request | type: GetPricingBreakdownRequest    
        - name: providerProductId | type: string | description: Product GUID on the provider's platform.  | validation: minLength 1, maxLength 36
        - name: currency | type: string | description: Currency for the pricing breakdown.  | validation: format CURRENCY
 Return type: PROMISE<GetPricingBreakdownResponse>
  - name: pricingBreakdown | type: PricingBreakdown | description: Pricing breakdown for the product.  
     - name: baseCostRange | type: PriceRange | description: Range of the base cost across all variants. This is the base cost charged by the provider.  
        - name: from | type: string | description: Lower bound of the price range.  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":3}
        - name: to | type: string | description: Upper bound of the price range. Absent when all variants have the same price.  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":3}
     - name: suggestedRetailPriceRange | type: PriceRange | description: Range of the suggested retail price across all variants. Calculated as cost multiplied by the markup rate.  
     - name: potentialProfitRange | type: PriceRange | description: Range of the potential profit across all variants. Calculated as the suggested retail price minus the base cost.  
     - name: markupRate | type: string | description: Markup rate applied to the base cost to calculate the suggested retail price. For example, `0.60` for a 60% markup, or `2.5` for a 250% markup.  | validation: decimalValue {"gte":"0","lte":"10","maxScale":3}
     - name: currency | type: string | description: Currency of the monetary values.  | validation: format CURRENCY


```

### Examples

### getPricingBreakdown
```javascript
import { marketplaceProvider } from '@wix/suppliers-hub/service-plugins';

async function getPricingBreakdown(request,metadata) {
  const response = await marketplaceProvider.getPricingBreakdown(request,metadata);
};
```

### getPricingBreakdown (with elevated permissions)
```javascript
import { marketplaceProvider } from '@wix/suppliers-hub/service-plugins';
import { auth } from '@wix/essentials';

async function myGetPricingBreakdownMethod(request,metadata) {
  const elevatedGetPricingBreakdown = auth.elevate(marketplaceProvider.getPricingBreakdown);
  const response = await elevatedGetPricingBreakdown(request,metadata);
}
```

### getPricingBreakdown (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { marketplaceProvider } from '@wix/suppliers-hub/service-plugins';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { marketplaceProvider },
  // Include the auth strategy and host as relevant
});


async function getPricingBreakdown(request,metadata) {
  const response = await myWixClient.marketplaceProvider.getPricingBreakdown(request,metadata);
};
```

---