Skip to main content

Update Cart Settings

PUT 

https://useast.api.elasticpath.com/v2/settings/cart

You can modify the cart expiry settings to set it to any number of days up to 365. Any existing carts default to the expiry of 7 days. To update cart settings in Commerce Manager, see Updating Cart setting.

With update cart settings endpoint, you can:

  • Enable or disable custom discounts by setting the custom_discounts_enabled field to true. This allows you to activate your custom discounts from external services. By default, this setting is determined by the cart settings configured for the store.
  • Enable or disable the use of rule promotions within the cart. You can apply this setting either at the store level using the update cart setting endpoint or individually to a specific cart using the update a cart endpoint.
  • Enable or disable deferred inventory checks by setting defer_inventory_check to true. When set, stock levels are not verified for products in a cart until checkout.
note

You cannot use both custom discounts and rule promotions at the same time.

Errors

The following error is received if you enable a cart to use both custom discounts and rule promotions:

{
"status": 422,
"title": "Cannot use both discounts together",
"detail": "Only one discount setting can be set to true at a time."
}

Request

Responses

OK

Authorization: http

name: BearerTokentype: httpscheme: bearer

Request Collapse all
Base URL
https://useast.api.elasticpath.com
Auth
Body
{
  "data": {
    "type": "settings",
    "cart_expiry_days": 25,
    "discounts": {
      "custom_discounts_enabled": false,
      "use_rule_promotions": false
    },
    "inventories": {
      "defer_inventory_check": false
    }
  }
}
ResponseClear

Click the Send API Request button above and see the response here!

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.