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

getIncompleteOrder

Returns incomplete order of the logged- in user

GET /ccstore/v1/orders/current

removeCurrentProfileIncompleteOrder

Removes the persisted order for the logged in user

DELETE /ccstore/ v1/orders/current

submitCurrentOrder

Submits current order; captures and authorizes payment before submitting order

POST /ccstore/ v1/orders/current/submit

updateCurrentProfileOrder

Updates the persisted order for the logged in user

POST /ccstore/ v1/orders/current

updateIncompleteOrder

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

addCartItems

Add one or more items to the cart

POST /ccstore/v1/orders/current/items/add

deleteCartItem

Delete the item in the cart for the given id

DELETE /ccstore/v1/orders/current/items/{id}

getCartItems

Get all the items in the cart

GET /ccstore/v1/orders/current/items

makeGiftWithPurchaseSelection

Enables selection of a gift item, based on qualified Gift with Purchase promotion

POST /ccstore/v1/orders/current/items/makeGWPSelection

removeAllSelectableQuantity

Remove all selectable gift quantity.

POST /ccstore/v1/orders/current/items/removeAllSelectableQuantity

removeSelectableQuantity

Remove selectable gift quantity

POST /ccstore/v1/orders/current/items/removeSelectableQuantity

updateCartItem

Update the item in the cart specified by the item's ID.

PATCH /ccstore/v1/orders/current/items/{id}