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.