Commerce OCC API Changes

Objective

After completing this lesson, you will be able to identifying Commerce OCC API Changes

Enabling Validation of Product Quantity Limits

The order and cart-related APIs are enhanced to be able to enable the validation of product quantity against defined maximum and minimum limits without affecting the existing business logic.

The feature enhances cart-related APIs by adding validation of product quantity limits during operations like adding products to the cart, updating a cart, saving, restoring, cloning, and merging carts. If a product's quantity doesn't meet the specified limits, a warning message will be displayed. However, customers can still call these APIs successfully.

The feature also enhances order-related APIs by adding validation during operations such as placing orders, replenishing orders, canceling and returning orders. In these cases, it prevents customers from successfully calling these APIs and also an error message will be displayed. This feature ensures customers cannot order products that don't comply with the requirement. It also ensures that the product's remaining quantity continues to meet the minimum limit requirement after cancellations and returns.

Why?

This feature enhances logistical efficiency and prevents customers from depleting stock during shortages by enabling the verification of product quantity limits.

Display the Meridiem Indicator in the Store API Responses

Enhance the customer’s experience by displaying the meridiem indicator (AM and PM) in the store API responses.

What Changed?

To display the Meridiem Indicator in the Store API Responses, a new field named meridiemIndicator is added to de.hybris.platform.commercefacades.storelocator.data.TimeData under de.hybris.platform.commercefacades.storelocator.converters.populator.TimeDataPopulator.

Why?

This improvement makes the returned time easier to understand. As a result, it boosts customer’s efficiency and increases their satisfaction.

Prevent Applying a Discount with a Discount Rate Higher Than the Cart's Subtotal When the Discount Type is TARGET

The following quote API now includes enhancements that prevent sales representatives from applying a discount with a discount rate higher than the cart's subtotal:

/{baseSiteId}/users/{userId}/quotes/{quoteCode}/discounts

This rule applies specifically when the discount type is TARGET.

What Changed?

The de.hybris.platform.commerceservices.order.impl.DefaultCommerceQuoteService now includes new logic to handle discounts more effectively. If the discount type is TARGET and the discount rate exceeds the cart's subtotal, the system rejects the discount. This action triggers an IllegalArgumentException. As a result, an error message shows up in the response payload.

Why?

This feature enhances the customer experience as it allows them to pay only their actual subtotal when the expected target amount is greater than the subtotal. This flexibility improves customer satisfaction.

Improved Product OCC API to Prevent Non-Existent Product Returns

The product OCC API results can filter out products that do not exist in the database, ensuring that only valid products are returned.

Why?

This improvement increases customer satisfaction by enhancing the accuracy and reliability of product information for customers and vendors.

Restricting Punchout Requisitions to Signed-in Customers

The punchout requisition OCC API now requires customers to sign in to start a punchout requisition session.

To restrict punchout requisition sessions to signed-in customers, a new toggle named toggle.securePortalAuthenticationInterceptor.block.anonymous.punchout.requisition.enabled is added to de.hybris.platform.commercewebservicescommons.interceptor.SecurePortalAuthenticationInterceptor under the commercewebservicescommons extension.

Why?

This feature enhances system security by blocking anonymous customers from starting punchout requisition sessions.

Feature Activation

If you are running a version prior to 2211-jdk21.5, it is possible this feature is deactivated by default. To activate it, see Activating Restricting Punchout Requisitions to Signed-in Customers .

New API to Retrieve Product Availability Information in Specified Units

Customers can now use the following endpoint to retrieve real-time stock availability information for requested products in specified units: Get/ {baseSiteId}/productAvailabilities. This endpoint returns a list of items that indicate each product's specified stock information, such as quantity and stock status.

Why?

Real-time search helps customers find product availability across all locations, improving customer satisfaction.

Including B2BUnit Information in Cart

B2BUnit information is now included in cart model in the database when customers add products to B2B carts using the addToCart OCC API.

To enable this feature, a new toggle named toggle.cart.b2bUnit.addition.enabled is added to de.hybris.platform.b2bacceleratorfacades.order.impl.DefaultB2BCartFacade.java under the b2bacceleratorfacades extension.

Why?

The feature ensures that the cart reflects the specific B2B unit associated with the customer, streamlining purchasing processes and enhancing efficiency. Using it can improve business operations and customer satisfaction by providing a unified view of data.