Salesforce Commerce Cloud’s platform surfaces a full set of RESTful Open Commerce API’s (OCAPI). Open Commerce API allows external web applications to interface with core e-commerce functionality like cart, checkout, and search, as well as provides data object access to entities like product and catalog. An API, or Application Programming Interface, is the preferred method for two applications to communicate in real-time. OCAPI enables you to access resources using HTTP requests and HTTP responses. Each resource is addressed by its unique URL, which includes the API version. Data is transported using request or header parameters, or within the request body as a JSON document with a defined structure. Two applications “talking” through an API can be a very powerful combination as it allows our clients to integrate Salesforce Commerce Cloud solutions with their internal systems such as inventory or supply chain management. Furthermore, retailers may want to use OCAPI with a different mobile app or in conjunction with services like loyalty programs.

The Salesforce Commerce Cloud API, OCAPI consists of three component APIs

Shop APIProvides access to Commerce Cloud Digital storefront functionality. It allows a client to interact with the system as a shop customer or as an agent shopping on behalf of a customer
Data APIProvides access to Digital application configuration and integration functionality on a per object basis. It permits create/read/update/delete access to system resources
Meta APIProvides access to a formal description of the resources and documents available in the Open Commerce API including the custom attributes

Why migrate to latest version of OCAPI 19.10?

Salesforce Commerce Cloud has shifted its focus onto development on the latest API version to improve security and performance, which led to the decision to retire the legacy API versions 16.x and below on July 1, 2020. Current OCAPI versioning and deprecation policy 19.10 adds value to its customers by allowing change to its design without affecting existing client applications, made easy for customers and developers to understand, also the policy talks about deleting outdated or unsupported features, ones not meeting the security and performance criteria.

  • OCAPI version 19.10 adds a limit to the Shop API Products resource to enhance performance. It also fixes bugs that affected payment method validation, custom objects of type Date, and empty baskets. The Shop API Products resource now limits the number of products retrieved per request to 24. This limit prevents performance issues caused by large responses.
  • A bug affected Shop API Baskets and Orders calls that validate a payment method, including calls that submit a basket or order. The bug caused the payment method validation logic to use the order subtotal instead of the order total. The subtotal doesn’t include promotions, shipping charges, gift certificates, or other amounts besides the gross product line totals. These calls now correctly use the order total.
  • A bug caused BasketMgr.getCurrentBasket() to handle empty baskets by deleting them and returning null. This behavior affected implementations that use the session bridge to combine OCAPI with controllers or pipelines, because retrieving a deleted basket via OCAPI throws an exception. The bug has been fixed so that getCurrentBasket() no longer deletes empty baskets.
  • The SHOP API Checks the Correct timezone when returning active promotions- When the storefront calls the GET/products/{product ID} (expanded promotions) API, the SHOP API now checks the site’s timezone and returns only currently active promotions. Previously, the API always checked against the GMT timezone.
  • You can now make changes to your promotional callout message as well by using the Promotion Data OCAPI API to Retrieve, Edit, and Add the Promotional Callout Message.
  • You will be able to see master product variant information in Business Manager Visual Merchandising. You can use the new master product variant view to review variant product inventory levels, attributes, and pricing, then strategically place and promote variant products on the product page without switching between visual merchandising and your product list.

Retailers leveraging OCAPI

Many of the Salesforce Commerce Cloud clients are currently utilizing the robust functionality of OCAPI. E.l.f. Cosmetics leverages the API to send customer data to Smile.io, a third party service for managing loyalty points.  The company, through their internal system, sends a request through the API to retrieve customer loyalty account information and order data, which is then passed along to Smile.io to update customer accounts.

Conclusion

Adopting every version as it is released is not practical, but at the same time using versions that are multiple years old is also a concern. To prevent any disruption to applications that are currently using the legacy versions and to achieve the benefits of continual cloud software delivery such as better security, performance, and features, you will need to upgrade your applications to use the latest OCAPI version available.

 

Shifali Dumpala

Shifali is a content writer and has a passion for exploring technologies that impact everyday life. She majorly focuses on retail domain and handles various kinds of marketing content including white papers.

Latest posts by Shifali Dumpala (see all)