Prorating Promotions

For order promotions, Salesforce B2C Commerce applies discounts to each order as a whole, and doesn't prorate order discounts. However, B2C Commerce does provide an API (described below), which calculates the prorated values in-memory and returns them to the caller. The API does not store the prorated values on the order, but simply recalculates them on the fly. Prorated price information is typically used to integrate with backend order-management and accounting systems that require all discounts to be itemized.

Order Promotions

The API calculates prorated values for order discounts across all qualifying units in the order. The API doesn't calculate the prices of non-qualifying products. It calculates a prorated value for each qualifying unit according to the adjusted price of the unit after product discounts, with consideration for previously applied order discounts. It calculates one product-level price adjustment for each line item that contains at least one unit included in the proration. It doesn't calculate a total price adjustment for the whole order.

Order promotions are still considered order promotions for the purpose of exclusivity rules. In particular, if a product line item receives a class exclusive product-promotion, it's still eligible to receive a prorated order discount.

Order promotions are prorated after product promotions.

Taxes

When calculating tax for a product line item, the API applies the tax rate of the product to the adjusted price after product and pro-rated order promotions are considered. The order total should be the same regardless of whether order promotions are pro-rated or not. However, because the API applies tax on a line-item by line-item basis, taxes might be slightly higher (due to a rounding error) when order promotions are pro-rated.

You can also use the Line Item Tax Basis feature to prorate taxes across an order and eliminate potential rounding errors.

Shipping Promotions

The merchandise total used for determining qualification for shipping promotions is the total of all product line items in the shipment after product and prorated order promotions are considered.

Examples

The following examples demonstrate how proration works on various product and order discounts.

Prorating an Order Discount

For this example, the promotion is '15% off orders over $100'.

Table 1. Without Proration
Product Quantity Base Price Net Price
SKU1 1 $60.00 $60.00
SKU2 1 $50.00 $50.00
Subtotal     $110.00
15% off orders over $100     -$16.50
Total     $93.50

Now, review the same information with proration.

Table 2. With Proration
Product Quantity Base Price Net Price
SKU1 1 $60.00 $60.00
15% off orders over $100     -$9.00
SKU2 1 $50.00 $50.00
15% off orders over $100     -$7.50
Total     $93.50

Prorating an Order Discount with an Additional Product Promotion.

For this example, promotion-1 is '15% off orders over $100' and promotion-2 is '$10 off SKU1 (class exclusive)'.

Table 3. Without Proration
Product Quantity Base Price Net Price
SKU1 1 $60.00 $60.00
$10 off SKU1     -$10.00
SKU2 1 $50.00 $50.00
Subtotal     $100.00
15% off orders over $100     -$15.00
Total     $85.00

Now, review the same information with proration.

Table 4. With Proration
Product Quantity Base Price Net Price
SKU1 1 $60.00 $60.00
$10 off SKU1     -$10.00
15% off orders over $100     -$7.50
SKU2 1 $50.00 $50.00
15% off orders over $100     -$7.50
Total     $85.00

Prorating an Order Discount with Excluded Product

For this example, the promotion is '15% off orders over $100'', with SKU3 excluded from the promotion.

Product Quantity Base Price Net Price
SKU1 1 $60.00 $60.00
SKU2 1 $50.00 $50.00
SKU3 1 $40.00 $40.00
Subtotal     $150.00
15% off orders over $100     -$16.00
Total     $133.50

Now, review the same information with proration.

Table 5. With Proration
Product Quantity Base Price Net Price
SKU1 1 $60.00 $60.00
15% off orders over $100     -$9.00
SKU2 1 $50.00 $50.00
15% off orders over $100     -$7.50
SKU3 1 $40.00 $40.00
Total     $133.50

Prorating a Product Discount with Buy-X-Get-Y and an additional Order Discount.

For this example, the product promotion is 'Buy one item and get a cheaper item for free' and the order promotion is '10% off your order'.

Proration helps when processing completed orders, such as when processing a product return.

In the Buy-X-Get-Y promotion, the customer sees SKU1 as discounted and SKU2 as free. However, with proration, the cost of the free item, $10.99, is divided among each product. SKU1's cost decreases to $19.19 and SKU2's cost increases to $7.81. The products are then discounted further by the order promotion; SKU1's cost decreases to $17.27 and SKU2's cost decreases to $7.03. When processing a return for SKU2, the customer receives back $7.03 instead of $0.00.

Table 6. Without Proration
Product Quantity Base Price Net Price
SKU1 1 $27.00 $27.00
SKU2 1 $10.99 $10.99
Buy one item and get a cheaper item for free     -$10.99
SKU3 1 $24.00 $24.00
Subtotal     $51.00
10% off your order     -$5.10
Total     $45.90

Now, review the same information but with product promotion prorated.

Table 7. With the Product Promotion Proration
Product Quantity Base Price Net Price
SKU1 1 $27.00 $27.00
Buy one item and get a cheaper item for free     -$7.81
SKU2 1 $10.99 $0.00
Buy one item and get a cheaper item for free     +$7.81
SKU3 1 $24.00 $24.00
Subtotal     $51.00
10% off your order     -$5.10
Total     $45.90

Now, review the same information but both promotions prorated.

Table 8. With the Order and Product Promotions Proration
Product Quantity Base Price Net Price
SKU1 1 $27.00 $27.00
Buy one item and get a cheaper item for free     -$7.81
10% off your order     -$1.92
SKU2 1 $10.99 $0.00
Buy one item and get a cheaper item for free     +$7.81
10% off your order     -$0.78
SKU3 1 $24.00 $24.00
10% off your order     -2.40
Total     $45.90

B2C Commerce provides an algorithm for prorating Buy-X-Get-Y product discounts. Use the APIs described in the following section to implement this algorithm.

Proration APIs

If your application requires the itemized information described above, these APIs enable you to retrieve prorated prices:

Class Method
dw.order.PriceAdjustment

getProratedPrices() : Map

dw.order.ProductLineItem

getProratedPriceAdjustmentPrices() : Map

getProratedPrice() : Money

dw.order.Shipment

getProratedMerchandizeTotalPrice() : Money

The following methods only consider price adjustments, while the methods listed above consider both order and BOGO price adjustments.

Class Method
dw.order.ProductLineItem

getAdjustedPrice(boolean applyOrderLevelAdjustments) : Money

dw.order.Shipment getAdjustedMerchandizeTotalPrice(boolean applyOrderLevelAdjustments) : Money

See the API documentation for additional details.

Related Links

Campaigns and Promotions

Promotions and Taxation