Omni Commerce Connect (OCC) is a set of RESTful APIs provided by SAP Commerce Cloud. It is used to expose set of commerce and data services API to integrate SAP Commerce functionality in your application or third party system using Rest Webservices. OCC is designed to support a range of e-commerce functionalities and enable seamless interaction with the commerce backend.
RESTful API: OCC provides a REST-based interface, which means it uses standard HTTP methods (GET, POST, PUT, DELETE) and typically returns data in JSON or XML format. This makes it accessible and easy to use with a wide variety of client applications.
Core Capabilities: The OCC APIs cover a range of e-commerce functionalities, including:
Product Information: Retrieve product details, categories, and search results.
Shopping Carts: Manage cart contents, update quantities, and handle checkout processes.
Orders: Create, view, and manage customer orders.
User Accounts: Handle customer login, registration, and profile management.
Search: Perform searches and retrieve search results for products and other entities.
Endpoints: Common endpoints in OCC v1 might include:
/products: For retrieving product details.
/carts: For managing shopping carts.
/orders: For processing and retrieving order information.
/users: For managing customer profiles and authentication.
SAP Commerce OCC API has 2 version v1 and v2. v1 is stateful implementation and v2 is newer and default stateless REST API. it is supporting for headless commerce environment. OCC v1 might be outdated depending on your SAP Commerce Cloud version. SAP regularly updates its API versions, so you might want to consider upgrading to a newer version if you need additional features or improvements.
Endpoints: OCC v1 APIs follow REST principles, using standard HTTP methods (GET, POST, PUT, DELETE). OCC v1 exposes several endpoints for different functionalities, such as /products, /carts, /orders, /users, etc.
Controller Layer: Rest Controllers layer in OCC handle incoming HTTP requests and route them to the appropriate service layer methods.
Service Layer: This layer in SAP Commerce interacts with the OCC APIs. It handles the business logic and processes incoming requests.
Data Access Layer: This layer interacts with the SAP Commerce Cloud database to performs CRUD Create, Read, Update, Delete) operations on the data models.
Security Layer: This security mechanisms manage authentication and authorization. APIs may require API keys, OAuth tokens, or other forms of authentication to ensure secure access.
Example :
It is sample example to understand flow of occ. it provides a high-level view of how OCC v1 operates:
Hybris API Endpoint: /products/{productCode}
Request: GET /products/12345
Controller: Receives the request, extracts the 12345 product code.
Service: Calls the appropriate service method to get product details.
Data Access: Fetches product data from the database.
Response: Formats product data into JSON and sends it back.
This architecture allows for scalable, secure, and efficient interactions between SAP Commerce Cloud and external systems.
For accessing the Swagger documentation for OCC v1 (Omni Commerce Connect v1) APIs, you'll need the correct URL endpoint for your SAP Commerce Cloud instance
http://<your-commerce-instance-url>/occ/v1/swagger-ui.html
Basic Functionality: OCC v1 provides essential e-commerce features but lacks advanced capabilities and flexibility available in newer versions.
Performance: It may struggle with high-traffic scenarios and complex queries, impacting scalability and response times.
Security: OCC v1 has more rudimentary security mechanisms compared to the enhanced security features of newer versions.
Support: Documentation and community support for OCC v1 are limited, making troubleshooting and integration with modern technologies more challenging.
Upgrading from OCC v1 to OCC v2 offers several advantages and improvements that address the limitations of the older version.