Shopping Cart REST APIs
Overview
Oracle CPQ 22B introduced v14 stateless REST API to support the Oracle CPQ Shopping Cart features. The Shopping Cart feature is based on user session, therefore, the Shopping Cart REST APIs cannot be used in headless mode.
To use the stateless Shopping Cart REST APIs, users must provide their JSESSIONID
cookie to maintain data retention for the shopping cart and their X-Cpq-Csrf-Token
header for authentication. These parameters are available within the "Request Headers" area of the request in the network tab of the browser that initiated their session. These values must be entered every time a new user session is used to initiate shopping cart REST API calls.
Administration
Get List of All Shopping Carts
https://sitename.oracle.com/rest/v17/shoppingCarts
{ "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts" } ], "items": [{ "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction" } ], "priceBookApplicable": true, "showAddToQuoteButton": false, "showCheckoutButton": true, "processVarName": "transaction", "processName": "Quotes" }, { "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/oraclecpqo" } ], "priceBookApplicable": true, "showAddToQuoteButton": false, "showCheckoutButton": true, "processVarName": "oraclecpqo", "processName": "Oracle Quote to Order", } ] }
https://sitename.oracle.com/rest/v17/shoppingCarts/quotes/actions/_getMostRecentShoppingCart
This sample includes optional pagination parameters.
{ "offset": 0, "limit": 2, "expandNodes": true, "totalResults": true }
This sample includes optional pagination parameters.
{ "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts" } ], "priceBookApplicable": true, "showAddToQuoteButton": false, "showCheckoutButton": true, "processVarName": "transaction", "processName": "Quotes", "limit": 2, "offset": 0, "count": 2, "totalResults": 4, "hasMore": true, "items": [{ "id": 3022707088, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems/3022707088" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems" } ], "parentId": -1, "name": "part100", "quantity": 1, "price": { "value": -1.0, "currency": "USD", "priceComment": "US Dollar price not defined." }, "mandatory": false, "enabled": true, "priceBookName": "", "description": "", "hasChildren": true }, { "id": 3022707090, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems/3022707090" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems" } ], "parentId": 3022707088, "name": "part1", "quantity": 1, "price": { "value": 1.33, "currency": "USD" }, "mandatory": false, "enabled": true, "priceBookName": "Base Price", "description": "", "hasChildren": false } ] }
https://sitename.oracle.com/rest/v17/shoppingCarts/transaction
{ "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts" } ], "priceBookApplicable": true, "showAddToQuoteButton": false, "showCheckoutButton": true, "processVarName": "transaction", "processName": "Quotes", "shoppingCartItems": { "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction" } ] } }
https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/actions/_getShoppingCart
This sample includes optional pagination parameters.
{ "offset": 0, "limit": 2, "expandNodes": true, "totalResults": true }
This sample includes optional pagination parameters.
{ "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts" } ], "priceBookApplicable": true, "showAddToQuoteButton": false, "showCheckoutButton": true, "processVarName": "transaction", "processName": "Quotes", "limit": 2, "offset": 0, "count": 2, "totalResults": 4, "hasMore": true, "items": [{ "id": 3022707088, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems/3022707088" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems" } ], "parentId": -1, "name": "part100", "quantity": 1, "price": { "value": -1.0, "currency": "USD", "priceComment": "US Dollar price not defined." }, "mandatory": false, "enabled": true, "priceBookName": "", "description": "", "hasChildren": true }, { "id": 3022707090, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems/3022707090" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems" } ], "parentId": 3022707088, "name": "part1", "quantity": 1, "price": { "value": 1.33, "currency": "USD" }, "mandatory": false, "enabled": true, "priceBookName": "Base Price", "description": "", "hasChildren": false } ] }
https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems
{ "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction" } ], "items": [{ "id": 3022707088, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems/3022707088" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems" } ], "parentId": -1, "name": "part100", "quantity": 1, "price": { "value": -1.0, "currency": "USD", "priceComment": "US Dollar price not defined." }, "mandatory": false, "enabled": true, "priceBookName": "", "description": "", "hasChildren": true }, { "id": 3022707090, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems/3022707090" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems" } ], "parentId": 3022707088, "name": "part1", "quantity": 1, "price": { "value": 1.33, "currency": "USD" }, "mandatory": false, "enabled": true, "priceBookName": "Base Price", "description": "", "hasChildren": false }, { "id": 3022707091, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems/3022707091" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems" } ], "parentId": 3022707088, "name": "part2", "quantity": 2, "price": { "value": 2.33, "currency": "USD" }, "mandatory": false, "enabled": true, "priceBookName": "Base Price", "description": "", "hasChildren": false }, { "id": 3022707092, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems/3022707092" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems" } ], "parentId": 3022707088, "name": "part3", "quantity": 3, "price": { "value": 3.33, "currency": "USD" }, "mandatory": false, "enabled": true, "priceBookName": "Base Price", "description": "", "hasChildren": false } ] }
https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems/3022707088
{ "id": 3022707088, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems/3022707088" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems" } ], "parentId": -1, "name": "part100", "quantity": 1, "price": { "value": -1.0, "currency": "USD", "priceComment": "US Dollar price not defined." }, "mandatory": false, "enabled": true, "priceBookName": "", "description": "", "hasChildren": true }
https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/actions/_addToQuote
Example 1: All items are selected in the shopping cart
{ "selections": [], "selectionMode": "ResultSetExceptSelected" }
Example 2: Specific items are selected in the shopping cart
{ "selections": [3022564637, 3022564638], "selectionMode": "" }
{ "destinationUrl": "https://sitename.oracle.com/commerce/buyside/document.jsp?id=3022564562&document_id=4356178&bm_cm_process_id=4356122&formaction=openTransaction" }
https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/actions/_checkout
Example 1: All items are selected in the shopping cart
{ "selections": [], "selectionMode": "ResultSetExceptSelected" }
Example 2: Specific items are selected in the shopping cart
{ "selections": [3022564637, 3022564638], "selectionMode": "" }
{ "destinationUrl": "https://sitename.oracle.com/commerce/buyside/document.jsp?id=3022564562&document_id=4356178&bm_cm_process_id=4356122&formaction=openTransaction" }
Clear All Items from a Shopping Cart
https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/actions/_clearItems
https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/shoppingCartItems/3022564638
https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/actions/_returnToQuote
{ "destinationUrl": "https://sitename.oracle.com/commerce/buyside/document.jsp?id=3022564716&document_id=4356178&bm_cm_process_id=4356122&formaction=openTransaction" }
https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/layouts
{ "items": [{ "id": 6966063, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/layouts/desktopLayout" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/layouts" } ], "varName": "desktopLayout", "processName": "Quotes", "enabled": true, "displayTotalType": "TOP", "checkoutButtonLabel": "Proceed To Checkout", "hideButtonLabel": "Hide", "clearButtonLabel": "Clear Cart", "showClearButton": true, "itemsSelectedByDefault": true, "showTranslationsButton": false, "removeItemsOnCheckout": false, "columns": { "items": [{ "id": 6966066, "columnLabel": "Item Added", "columnDesc": "", "orderNumber": 0, "columnType": "ITEM", "valueAlignment": "LEFT_ALIGN", "editable": false, "editableApplicable": false, "visible": false }, { "id": 6966065, "columnLabel": "Quantity", "columnDesc": "", "orderNumber": 1, "columnType": "QUANTITY", "valueAlignment": "LEFT_ALIGN", "editable": true, "editableApplicable": true, "visible": false }, { "id": 6966067, "columnLabel": "Unit Price", "columnDesc": "", "orderNumber": 2, "columnType": "PRICE", "valueAlignment": "LEFT_ALIGN", "editable": false, "editableApplicable": false, "visible": false }, { "id": 6966068, "columnLabel": "Subtotal", "columnDesc": "", "orderNumber": 3, "columnType": "SUBTOTAL", "valueAlignment": "LEFT_ALIGN", "editable": false, "editableApplicable": false, "visible": false }, { "id": 6966069, "columnLabel": "Price Book", "columnDesc": "", "orderNumber": 4, "columnType": "PRICEBOOK", "valueAlignment": "LEFT_ALIGN", "editable": false, "editableApplicable": false, "visible": false }, { "id": 7277423, "columnLabel": "Description", "columnDesc": "", "orderNumber": 5, "columnType": "DESCRIPTION", "valueAlignment": "LEFT_ALIGN", "editable": false, "editableApplicable": false, "visible": false } ] } } ], "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/layouts" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction" } ] }
https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/layouts/desktopLayout
{ "id": 6966063, "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/layouts/desktopLayout" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v17/shoppingCarts/transaction/layouts" } ], "varName": "desktopLayout", "processName": "Quotes", "enabled": true, "displayTotalType": "TOP", "checkoutButtonLabel": "Proceed To Checkout", "hideButtonLabel": "Hide", "clearButtonLabel": "Clear Cart", "showClearButton": true, "itemsSelectedByDefault": true, "showTranslationsButton": false, "removeItemsOnCheckout": false, "columns": { "items": [{ "id": 6966066, "columnLabel": "Item Added", "columnDesc": "", "orderNumber": 0, "columnType": "ITEM", "valueAlignment": "LEFT_ALIGN", "editable": false, "editableApplicable": false, "visible": false }, { "id": 6966065, "columnLabel": "Quantity", "columnDesc": "", "orderNumber": 1, "columnType": "QUANTITY", "valueAlignment": "LEFT_ALIGN", "editable": true, "editableApplicable": true, "visible": false }, { "id": 6966067, "columnLabel": "Unit Price", "columnDesc": "", "orderNumber": 2, "columnType": "PRICE", "valueAlignment": "LEFT_ALIGN", "editable": false, "editableApplicable": false, "visible": false }, { "id": 6966068, "columnLabel": "Subtotal", "columnDesc": "", "orderNumber": 3, "columnType": "SUBTOTAL", "valueAlignment": "LEFT_ALIGN", "editable": false, "editableApplicable": false, "visible": false }, { "id": 6966069, "columnLabel": "Price Book", "columnDesc": "", "orderNumber": 4, "columnType": "PRICEBOOK", "valueAlignment": "LEFT_ALIGN", "editable": false, "editableApplicable": false, "visible": false }, { "id": 7277423, "columnLabel": "Description", "columnDesc": "", "orderNumber": 5, "columnType": "DESCRIPTION", "valueAlignment": "LEFT_ALIGN", "editable": false, "editableApplicable": false, "visible": false } ] } }
Notes
For more information on the Interface Catalogs, see the topic Interface Catalog.