ERPClimb logoERPClimb
OCC APIs and integration
SAP Commerce Cloudintermediate 6 min read

OCC APIs and integration — SAP Guided Tutorial

Free sample lesson · open to everyone

Key takeaway

Using and extending OCC REST APIs, securing them with OAuth clients, controlling response size with fields parameters, and integrating SAP Commerce with ERP and other systems through Integration Suite and integration APIs.

In this lessonShow sections

Visual overview

OCC APIs and integration — learning sheetFlow: OAuth client → OCC endpoint → fields: BASIC / DEFAULT / FULL → Integration flows. Key ideas: USING OCC; SECURITY; EXTENDING; BACK-END INTEGRATION. Watch out: Requesting FULL everywhere makes APIs slow and leaks data that clients don't need.ERPClimb.com / COMMERCE / LESSON 7/12 / LEARNING SHEETOCC APIs and integration1 · HOW IT FLOWS1OAuth client2OCC endpoint3fieldsBASIC / DEFAULT / FULL4Integrationflows2 · KEY IDEAS EXPLAINEDUsing OccResources for products, search, carts, checkout,orders, users.Base site in the path sets catalog, currency andlanguage context.SecurityOAuth2 clients with appropriate grant types andscopes.Rate limiting and WAF/CDN protection for publicendpoints.ExtendingAdd attributes via populators to existing DTOs andWsDTOs.Create new controllers in custom extensions fornew resources.Back-End IntegrationOrders, customers, products, prices and stock withERP.SAP Integration Suite or the platform'sintegration API modules for inbound/outboundflows.3 · REMEMBER · WATCH OUTRememberOCC endpoints follow patterns like/occ/v2/{baseSiteId}/products/{code} and /users/{userId}/carts.Clients authenticate with OAuth2; separate client IDs for storefront,apps and integrations.The fields parameter (BASIC, DEFAULT, FULL or explicit lists) controlsresponse size.!Watch outRequesting FULL everywhere makesAPIs slow and leaks data thatclients don't need.4 · IN A REAL PROJECTA mobile app requested product lists with fields=FULL, downloading classification, all images and stock for 50items per page. Response times exceeded 3 seconds. Switching to explicit fields cut payload by 85% andresponse times below 400 ms.Original ERPClimb learning sheet • Verify against your SAP release and edition

The situation: a real project scenario

A mobile app requested product lists with fields=FULL, downloading classification, all images and stock for 50 items per page. Response times exceeded 3 seconds. Switching to explicit fields cut payload by 85% and response times below 400 ms.

Explanation

OCC (Omni Commerce Connect) is the REST API layer that storefronts, mobile apps and external integrations use to talk to SAP Commerce, and getting it right is as much about discipline as it is about the endpoints themselves.

Endpoints follow a consistent resource pattern like /occ/v2/{baseSiteId}/products/{code} or /occ/v2/{baseSiteId}/users/{userId}/carts — the base site in the path sets the catalog, currency and language context for that call, which is why the same product code can return different prices depending on which base site it's requested through.

Clients authenticate using OAuth2, and a key practice is giving each consuming application its own OAuth client ID and scope rather than sharing one client across the storefront, mobile apps and integrations — a shared client means you can't tell which caller is responsible for a spike in traffic or a security incident, and you can't revoke one client's access without breaking everyone else.

The fields parameter is the main performance lever on every OCC call: requesting BASIC, DEFAULT or FULL controls how much of the response is populated, and explicit field lists (fields=code,name,price(formattedValue)) let a client ask for exactly what it needs. Defaulting to FULL on every call — especially list endpoints returning many items — pulls back classification data, every image variant, and other payload a client may not even render, which directly shows up as slower responses and wasted bandwidth, particularly painful on mobile networks.

OCC is extended, not modified: new attributes get added to existing DTOs through populators (so a new field appears on an existing resource without changing its meaning for other consumers), and genuinely new resources get their own controllers in custom extensions. Both should be documented and treated as additive — removing or repurposing an existing field in a DTO that other clients already depend on breaks them silently.

On the back-end integration side, orders, customers, products, prices and stock typically flow to and from the ERP through SAP Integration Suite or the platform's own integration API modules, and because any integration can fail transiently, production-grade integrations need monitoring and the ability to safely replay a failed message — which means the receiving side needs to handle the same message arriving twice without creating duplicates (idempotency).

Code example

ABAP Code
GET /occ/v2/electronics/products/CAM-1001?fields=code,name,price(formattedValue),stock(stockLevelStatus)Authorization: Bearer <access_token>

Watch out

Common mistakes

Requesting fields=FULL for every call, including list endpoints returning dozens of items, when only a handful of fields are actually used: this is one of the most common and easiest to fix causes of slow OCC responses — switching to explicit field lists routinely cuts payload size dramatically.

Sharing a single OAuth client across the storefront, mobile app and backend integrations: this removes the ability to tell which client is responsible for abnormal traffic or to revoke one consumer's access without taking down the others.

Changing the meaning of an existing standard DTO field instead of adding a new one via a populator: this silently breaks every other consumer of that endpoint who was relying on the original meaning.

Building integrations without monitoring or replay capability: a transient ERP outage then becomes a permanently lost order or price update instead of a message that gets safely retried.

Do this

Best practices

Use explicit field lists tuned to what each client actually renders, rather than defaulting to FULL, especially on high-traffic and mobile-facing endpoints — this is usually the single biggest, cheapest performance win available on OCC. Give each consuming application (storefront, mobile app, each integration) its own OAuth client with least-privilege scopes, so access can be audited and revoked per consumer.

Extend DTOs additively through populators and keep new resources in custom extensions with versioned, documented contracts, so existing consumers are never broken by a change meant for one new client. Build integration monitoring and idempotent replay into any ERP integration from the start, since transient failures are a certainty over the life of a production system, not an edge case.

In the interview

Interview angle

A practical OCC question is 'A mobile team complains the product list API is slow — what do you check first?' A weak answer guesses at database tuning.

A strong answer checks the fields parameter the client is requesting first, since fields=FULL on a list endpoint is by far the most common cause of this exact complaint, and can usually be confirmed and fixed in minutes by comparing response size and latency between FULL and an explicit field list.

A candidate who immediately reaches for the fields parameter, and who can also explain why separate OAuth clients per consumer matter for more than just security (traffic attribution, independent revocation), shows hands-on OCC experience rather than textbook knowledge.

Practice this lesson

Original educational case studies for SAP consultants, not official SAP certification exam questions. Verify product edition and implementation details against the current SAP documentation.

Quick check

0 of 4 questions attempted

Question 1 of 4

What does the OCC fields parameter control?

Practise this in an interview

Answer in your own words and get instant feedback, the way an interviewer would judge it.

1How do you design and secure OCC usage for multiple channels?

2How do you integrate SAP Commerce Cloud with S/4HANA?

Was this lesson helpful?

Keep exploring

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.