---
schema_version: "1"
id: 0d08add8c6f65cec8862ded737f16ebd8b7094e71d3257c62c7f3c639d2f3604
title: Salesforce Commerce Pricing and Promotions API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/salesforce-commerce/guides/d2c-commerce/b2b-d2c-comm-pricing-promotions-apis.md
canonical_url: https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/b2b-d2c-comm-pricing-promotions-apis.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: effe68591ece3ac870e6ab848b3f8372ac23de45c927a2dc6909a1db56e8630b
products:
  - B2B Commerce Developer Guide
  - Salesforce APIs
---
# Salesforce Commerce Pricing and Promotions API

The Commerce Pricing and Promotion APIs enable developers to access product prices and promotions, streamlining the development of their applications. These APIs are typically used to populate Product Listing Page and Product Display Page, as well as when users add products to their carts.

The pricing API allows users to retrieve prices for single or multiple products. Product prices are determined by selecting the lowest (or highest priority) price from the pricebooks assigned to the store and any buyer groups the shopper belongs to.

There are two promotion evaluation APIs: Evaluate Products and Evaluate Cart. Evaluate products is commonly used on the Product Display Pages (PDP) and Product Listing Pages (PLP) to display promotion price and promotion messaging. For example, 10% of items in category clothing when you spend \$50.

Evaluate cart is invoked during any cart modification, such as adding to the cart, changing quantity, and applying coupons, and during checkout to compute promotion adjustments for the cart. This can either be called as part of the above-mentioned operations or directly through the Webstore Promotions, Evaluate Action API.

Furthermore, it's flexible in assessing promotions for specific products or sets, including variants and independent items, while excluding parent products. The API caters to both domain-dependent and independent needs, utilizing parameters like webstoreId and effectiveAccountId for internal evaluations or external datasets like SKUs.

Lastly, the Coupon API monitors coupon code redemption usage, allowing you to revert previously redeemed codes and tracking increases in usage of coupon codes.

## Use Case

Let's consider a basic scenario for understanding how to use Pricing and Promotion APIs. This example covers just a few Pricing and Promotion APIs APIs and doesn't include the entire APIs functionality.
![Diagram of the pricing and promotions APIs workflow for B2B and D2C Commerce](https://developer.salesforce.com/media/d2c-commerce/pricing_promotions_apis_workflow.png '{"class": "image-lg", "title": "Pricing and Promotions Workflow"}')

In a typical shopping journey, when users land on your store's homepage, they've two options: they can either browse products by category or use the search box to find products, which are then displayed on the Product Listing Page (PLP). If customers choose to browse by category, the Product Listing Page loads, showcasing all products within the chosen category.

The process of displaying products onto the Product Listing Page involves two key steps: firstly, retrieving the list of products along with their prices, and secondly, fetching the promotions entitled to users. Make a GET call on the [Webstore Products API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_products.htm) to retrieve products and their prices. Make a POST request to [Webstore Cart Items API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_cart_items.htm) to add product items to the cart and fetch and apply cart-level promotions entitled to users. This API offers the ability to retrieve cart-level promotions that users are entitled to, calculate the required price adjustments, and add the chosen products to the cart, in addition to adding products to the cart. Subsequently, make a GET call on the [Webstore Cart Items API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_cart_items.htm) to review your cart and proceed with checkout.

Depending on your specific scenario, you may call these independent APIs, such as making a GET or POST request on the [Webstore Pricing Products API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_pricing_products.htm) to retrieve the pricing of products, making a POST request on the [Webstore Promotions, Evaluate Products Action API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_promotions_actions_evaluate_products.htm) to view the product promotions alongside displaying the products and pricing on the Product Listing Page and compute the applicable price adjustments, or making a POST request to the [Webstore Promotions, Evaluate Action API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_promotions_actions_evaluate.htm) to get promotions entitied to users based on the store and buyer group to be applied to the cart.

## Resources

Here’s a list of Product Pricing and Promotions resources:

| Resource                                                                                                                                                                                                      | Supported HTTP Methods | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`/commerce/webstores/{webstoreId}/pricing/​products/{productId}`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_product_price.htm)        | GET                    | Get the list and buyer price for a product.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [`/commerce/webstores/{webstoreId}/pricing/​products`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_pricing_products.htm)                 | GET, POST              | Get the prices for multiple products.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [`/commerce/promotions/actions/evaluate`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_promotions_actions_evaluate.htm)                   | POST                   | Determine which promotions the customer is eligible for based on the store and buyer group, and compute the applicable price adjustments based on the coupons and the items in the cart. This API evaluates only the first 50 active manual promotions and first 50 active automatic promotions, based on priority. This API computes and returns applicable price adjustments, but it does not apply those adjustments to the webcart record. If you want to enable promotions based on shipping, contact Salesforce Customer Support.                    |
| [`/commerce/promotions/actions/evaluate-products`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_promotions_actions_evaluate_products.htm) | POST                   | Determine which promotions apply to a product or set of products, and compute the applicable price adjustments. This API evaluates discrete products, including product variants and independent products but not parent products. Domain dependent and independent use cases are both supported. For example, a domain dependent call uses `webstoreId` and `effectiveAccountId` to evaluate products in a cart based on internal products or product categories. A domain independent call uses an external dataset based on SKUs or product categories. |
| [`/commerce/promotions/actions/decrease-use​/coupon-codes`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_coupon_code_redemption_decrease.htm)               | POST                   | Get coupon code redemption usage to revert a previously redeemed coupon code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [`/commerce/promotions/actions/increase-use​/coupon-codes`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_coupon_code_redemption_increase.htm)               | POST                   | Get coupon code redemption addition (increase) usage.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

**See Also**

- [_B2B Commerce Developer Guide_: Pricing Data Model](https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/b2b-b2c-comm-data-model-pricing.html)
- [_B2B Commerce Developer Guide_: Promotions Data Model](https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/b2b-b2c-comm-data-model-promotions.html)
- [_B2B Commerce Developer Guide_: Promotions Data Model](https://developer.salesforce.com/docs/atlas.en-us.b2b_b2c_comm_dev.meta/b2b_b2c_comm_dev/b2b_b2c_comm_data_model_promotions.htm)
- [_Salesforce B2B Commerce_: Pricing for Commerce Stores](https://help.salesforce.com/s/articleView?id=commerce.comm_pricebooks.htm)
- [_Salesforce B2B Commerce_: Commerce Promotions](https://help.salesforce.com/s/articleView?id=commerce.comm_promotions_create_manage.htm)
