Application Development53% of the exam

OCAPI requests: authentication, methods, caching and state

How an existing OCAPI integration picks the Shop or Data API and its authentication, builds valid request URLs, chooses PUT, PATCH, POST or a method override, prevents lost updates with resource states, and keeps Shop API responses cacheable.

Official exam objective
Given a business requirement, use OCAPI Shop and Data APIs to enable interoperability with an external system.

~7 min read · 13 practice questions ·

What the exam expects

  • Choose the Shop API or the Data API for an external system's requirement, and the matching authentication (none for guest browsing, a customer JWT, or an OAuth token).
  • Build request URLs: version segment, multiple identifiers, URL-encoded case-sensitive IDs.
  • Pick PUT, PATCH or POST, and override the method where PUT is blocked.
  • Use _resource_state for optimistic locking and not_exists for safe creation.
  • Keep Shop API responses cacheable and explain what is never cached, when hooks run, and why stateless clients flood controllers with sessions.

Key terms: Shop API (interacts as a shop customer or an agent shopping on behalf of one); Data API (create, read, update and delete access to system resources); JWT (the customer token passed in each Shop API request); resource state (a server-side token for one resource's current state); composite cache entry (one document plus its expansion documents, cached together).

Key facts

Client ID
Detail
Mandatory for all requests
Data API authentication
Detail
OAuth token for the client ID or a Business Manager user
Version segment
Detail
Lowercase v, underscore, such as v24_5
Identifiers
Detail
URL encoded and case-sensitive
PUT on staging and production
Detail
Blocked; use POST with a method override
Override precedence
Detail
method parameter beats the header
Resource state mismatch
Detail
HTTP 409
Create-only write
Detail
Pass not_exists
Shop API cache_time
Detail
Default 60; 0 to 86,400 seconds
Composite entry TTL
Detail
Shortest TTL of the included documents
Cache hit
Detail
Custom hooks don't run
OCAPI status
Detail
Deprecated as of April 2026; maintenance-only
Sources for this section (6)
  • When is the entire OCAPI cache cleared without anyone invalidating it?
  • Why can't a team clear only the OCAPI cache?
  • What does a PUT return when it creates a resource?
  • Which Data API hook runs after PUT /libraries/{library_id}/content/{content_id}?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the B2C Commerce Developer pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 28 lessons of the B2C Commerce Developer guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Practice exams purchase adds inline bank questions and topic practice (13 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Choose guide-only, practice-only, or save $4 with both

Practice for the B2C Commerce Developer exam