Salesforce Commerce Cart API
Salesforce Cart Connect APIs provide developers with a powerful set of APIs to build and customize cart management solutions within the Commerce Cloud platform. These APIs enable developers to effortlessly perform various tasks, including creating, updating, and managing carts. Key functionalities encompass adding or removing items, adjusting quantities, transferring items to wishlists, applying promotions, using coupons, and splitting a cart into multiple delivery groups.
The visibility settings for cart messages enable real-time updates and notifications, ensuring customers stay informed about changes to their carts, such as item availability, price adjustments, or promotional offers.
Moreover, developers can create multiple active carts for the same buyer and choose which cart to serve as the primary one. Additionally, the capability to add up to 100 items in a batch to a cart enhances operational efficiency and scalability.
To enhance the shopping experience further, developers can easily manage coupons associated with a cart, applying or removing them as needed. Similarly, they can gain insights into promotions and apply them at either the cart or individual item level.
To streamline order management and enhance customer satisfaction, developers can organize cart items into delivery groups, simplifying the process of shipping items to multiple addresses. Lastly, a cart can be preserved so that when a guest user logs in as an authenticated customer they retain their guest cart items.
Let's consider a basic scenario for building the cart management flow using Cart APIs. This example covers just a few Cart APIs and doesn't include the entire Cart APIs functionality.
In a typical shopping journey, users add products from the Product Listing Page (PLP) or Product Details Page (PDP) to their cart using a POST call on the Cart Item API. Then, they view their cart by clicking the cart icon. If no cart exists for the user, the system creates one using a POST call on the Create Cart API. Next, it retrieves the selected products using a GET call on the Cart Item API.
On the cart page, users can adjust quantities, remove items, or move them to wishlists, which trigger PATCH or DELETE calls on the Cart Item API, or a POST call on the Wishlist API. Promotions can be viewed using GET calls on the Cart Promotions API and Cart Items Promotions API. Valid coupons can be applied with a POST call on the Cart Coupon API. Subsequently, make a POST call on the Cart, Arrange Items API to arrange cart items into delivery groups to split your shipment order. Splitting refers to dividing an order into multiple shipments, and it is often implemented due to products being housed in different locations or specific delivery preferences. After finalizing the cart, users can proceed to checkout.
Here’s a list of Commerce Cart resources:
See Also