Cert++
Close

OCAPI HTTP methods and resource state handling

Key Takeaway

The HTTP method decides what OCAPI does to a resource. Sending a resource state turns a silent overwrite into an HTTP 409 fault.

The Open Commerce API (OCAPI) is a RESTful API, so the HTTP method you choose decides what happens to a resource such as a basket or a customer. Each method has its own rules about changing server state, being safe to repeat, and which status code comes back. Resource states add an optional check that stops one client from silently overwriting another client's changes.

OCAPI Shop and Data APIs

OCAPI includes the Shop API and the Data API. The Shop API acts as a shop customer, or as an agent shopping for a customer. The Data API gives create, read, update, and delete access to merchant resources such as coupons and customer lists.

Each resource has a unique URL that includes the API version, for example /dw/shop/v24_5/baskets. You call that URL with an HTTP method, and the method decides what happens to the resource.

B2C Commerce Developer Study Guide

Checklist progress

0/237Learned

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

0/10

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other B2C Commerce Developer studiers. 796 members and growing.