Work with Cart REST API Endpoints
The Store REST API endpoints for cart tasks have been enhanced to optimize cart and checkout flows for OSF widgets.
Cart REST API endpoints have been enhanced for use with OSF widgets. allow for more granular cart functions. The core business logic has been shifted to the server-side, and they support server-side shopping carts for anonymous shoppers. Note that with the exception of these Cart API updates, all Commerce REST APIs are backward-compatible and support both Storefront Classic and OSF storefronts.
Granular control is possible because the endpoints break an order down into individual, parts. Each part can be updated separately with the HTTP PATCH
method. PATCH
requests modify the specified resource by importing new or modified attributes into it. This allows for changes to individual parts of the order.
Order endpoints
This section describes the endpoints you can use to individually manage parts of an order. All requests for these endpoints require the X-CCVisitorId
header parameter. This parameter specifies the ID provided by the Oracle Commerce Visit Service to uniquely identify the current visitor. It is required for every request to enable full endpoint capabilities for all shopper types.
The following endpoints manage the current order for both logged-in shoppers and guests.
Endpoint | HTTP Method | Path |
Returns incomplete order of the logged- in user |
GET | /ccstore/v1/orders/current |
Removes the persisted order for the logged in user |
DELETE | /ccstore/ v1/orders/current |
Submits current order; captures and authorizes payment before submitting order |
POST | /ccstore/ v1/orders/current/submit |
Updates the persisted order for the logged in user |
POST | /ccstore/ v1/orders/current |
Update the current incomplete order |
PATCH | /ccstore/ v1/orders/current |
The following endpoints manage commerce items within the context of the current order.
Endpoint | HTTP Method | Path |
Add one or more items to the cart |
POST | /ccstore/v1/orders/current/items/add |
Delete the item in the cart for the given id |
DELETE | /ccstore/v1/orders/current/items/{id} |
Get all the items in the cart |
GET | /ccstore/v1/orders/current/items |
Enables selection of a gift item, based on qualified Gift with Purchase promotion |
POST | /ccstore/v1/orders/current/items/makeGWPSelection |
Remove all selectable gift quantity. |
POST | /ccstore/v1/orders/current/items/removeAllSelectableQuantity |
Remove selectable gift quantity |
POST | /ccstore/v1/orders/current/items/removeSelectableQuantity |
Update the item in the cart specified by the item's ID. |
PATCH | /ccstore/v1/orders/current/items/{id} |