Skip to main content

Apply Promotions To Cart (1.0)

Download OpenAPI specification:Download

Use this method to apply existing promotions to a cart to view how pricing during checkout will be calculated based on these promotions. As a default the NewStore promotion engine is used, otherwise a third party promotion engine will be used if properly configured (see NewStore documentation about third party promotion engine).

When using the NewStore promotions engine, this method is idempotent, and does not change the state of the cart or products added to the cart. When using a third party promotion engine the idempotency depends on the integration and third party promotion engine.

This method returns a version of the cart (DiscountedCart) with all specified promotions applied to it. The order of the discounts in the array of discounts attached to each item in a DiscountedCart is important and should not be changed when being used in other services or contexts.

Apply Promotions To Cart

Use this method to apply existing promotions to a cart to view how pricing during checkout will be calculated based on these promotions. This method returns a version of the cart (DiscountedCart) with all specified promotions applied to it. This method is idempotent, and does not change the state of the cart or products added to the cart. The order of the discounts in the array of discounts attached to each item in a DiscountedCart is important and should not be changed when being used in other services or contexts.

Authorizations:
newStoreAccessToken
Request Body schema: application/json

Request of apply promotions to the cart.

channelType
string

Typically web or store.

customerId
string

The customer ID.

currency
string

The currency of the cart.

couponCodes
Array of strings

The coupon codes to be applied.

storeId
string

The store ID.

shopId
string

The shop ID.

locale
string

The locale.

Array of objects (Item)

The individual items that the cart contains.

Responses

Request samples

Content type
application/json
{
  • "channelType": "store",
  • "customerId": "9deb5d3d-b40a-4c87-85c5-8a79d745b78a",
  • "currency": "USD",
  • "couponCodes": [
    ],
  • "storeId": "7c9f2605-9fb3-5444-8fee-47fe51608efe",
  • "shopId": "storefront-catalog-en",
  • "locale": "en-us",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "channelType": "store",
  • "customerId": "9deb5d3d-b40a-4c87-85c5-8a79d745b78a",
  • "currency": "USD",
  • "couponCodes": [
    ],
  • "storeId": "7c9f2605-9fb3-5444-8fee-47fe51608efe",
  • "shopId": "storefront-catalog-en",
  • "locale": "en-us",
  • "items": [
    ],
  • "warnings": [
    ]
}