This table describes the REST calls made from the CartViewModel and provides details on the context objects that are used to locate a response filter for each type of REST call the view model makes.

Context Object

Description

{endpoint:"getIncompleteOrder",
identifier:"loadCartForProfile"}

This context object is used for calls made to the getIncompleteOrder endpoint. The CartViewModel makes this call to retrieve the current incomplete order and load it in the UserViewModel and the CartViewModel. This may happen when an anonymous shopper logs in or creates an account. Also, when a shopper accepts a quoted order and moves to another page (other than the checkout page), the quoted order is removed and the incomplete order is loaded. Similarly, if a shopper is viewing an order that is pending payment and then moves to a page other than the checkout page, the pending payment order is removed and the incomplete order is loaded.

{endpoint:"getIncompleteOrder",
identifier:"refreshCart"}

This context object is used for calls made to the getIncompleteOrder endpoint. The CartViewModel makes this call when the shopper changes pages or the system reloads the cart. The call retrieves any incomplete order data for the logged-in shopper and then populates the CartViewModel and UserViewModel properties with the data it has retrieved.

{endpoint:"getMetadata",
identifier:"dynamicProperties"}

This context object is used for calls made to the getMetadata endpoint. The CartViewModel makes this call to retrieve metadata for dynamic order properties.

{endpoint:"getOrder",
identifier:"templateOrder"}

This context object is used for calls made to the getOrder endpoint. The Scheduled Order widget triggers the CartViewModel to make this call when the shopper clicks the Place Order button. Clicking this button places the contents of the scheduled order into the shopping cart, allowing the shopper to place a one-time order based on a scheduled order. See Extending Oracle Commerce Cloud for more details.

{endpoint:"getStockStatus",
identifier:"stockStatusForProdValidation"}

This context object is used for calls made to the getStockStatus endpoint. The CartViewModel makes this call to retrieve stock status information when the quantity of a product on the cart page is updated.

{endpoint:"getStockStatuses",
identifier:"stockStatusesForCart"}

This context object is used for calls made to the getStockStatuses endpoint. The CartViewModel makes this call to get stock status information when it is refreshing product data for items in the cart. This call is also triggered to get stock status information when a configurable product is reconfigured.

This call does not get made for orders in the PENDING_PAYMENT or PENDING_PAYMENT_TEMPLATE state because these orders cannot be edited; in other words, since the items in the order cannot be edited, stock status for those items is irrelevant.

{endpoint:"getStockStatuses",
identifier:"stockStatsToValidateCart"}

This context object is used for calls made to the getStockStatuses endpoint. The CartViewModel makes this call to retrieve stock status information for the products in the cart during the checkout process. The call is made when the shopper has clicked the checkout link on the Checkout page and the prices of the products in the cart have not changed.

Note: If the prices have changed, the shopper is redirected to the cart page and this call is not made.

{endpoint:"getStockStatuses",
identifier:"stockStatsForItem"}

This context object is used for calls made to the getStockStatuses endpoint. The CartViewModel makes this call to get stock status information for all the SKUs (base product and child SKUs) of a configurable product when that product is added to the cart. (Note that the view model method that makes this call is generic enough that it can be used for adding a product to the cart that is not configurable.)

{endpoint:"listProducts",
identifier:"getProductData"}

This context object is used for calls made to the listProducts endpoint. The CartViewModel makes this call when it needs to check whether the order has stale product data, for example, when the shopper moves from one page to another. Using this call, the CartViewModel retrieves product data from the server and then uses it to update the products in the cart on the client side. By comparing the new product data with the existing product data, Commerce Cloud can determine if the cart has become stale (for example, prices have changed or a product has been marked inactive) and whether repricing should be triggered.

{endpoint:"listProducts",
identifier:"getProductDataAndRedirect"}

This context object is used for calls made to the listProducts endpoint. The CartViewModel makes this call when the shopper has clicked the checkout link and the view model needs to check whether the order has stale product data. Using this call, the CartViewModel retrieves product data from the server and then uses it to update the products in the cart on the client side. By comparing the new product data with the existing product data, Commerce Cloud can determine if the cart has become stale (for example, prices have changed or a product has been marked inactive) and whether repricing should be triggered or the shopper should be redirected to the cart page.

{endpoint:"listSkus",
identifier:"skuListing"}

This context object is used for calls made to the listSkus endpoint. The CartViewModel makes this call to get product data for all the SKUs (base product and child SKUs) of a configurable product when that product is added to the cart. (Note that the view model method that makes this call is generic enough that it can be used for adding a product to the cart that is not configurable.)


Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices