Salesforce Commerce Cart API

POST Set the visibility for cart messages.

POST /commerce/webstores/{webstoreId}/carts/{activeCartOrId}/messages/actions/set-visibility

Operation ID: postCartMessagesVisibility.

Updates the visibility for cart level messages associated a single WebCart.

The visibility settings for cart messages enable real-time updates and notifications, ensuring customers stay informed about changes to their carts, such as item availability, price adjustments, or promotional offers.

Parameters

  • activeCartOrId (path, string, required) The valid value is—cartId (ID of the cart), active (this value is only to be used for authenticated users), or current (cart that isn’t closed or pending deletion). Use active only for B2B Aura stores; all other stores must use current.
  • webstoreId (path, string (Id), required) The ID of the web store.
  • effectiveAccountId (query, string (Id)) The ID of the buyer account or guest buyer profile for which the request is made. If unspecified, the default value is determined from context.

Request body

Media type: application/json. Schema: sfdc.commerce.cart.connect.api.input.CartMessagesVisibilityInputRepresentation.

Example: Example Set the visibility for cart messages.

{
  "visibility": true
}

Responses

  • 200 Success

    Media type: application/json. Schema: sfdc.commerce.cart.connect.api.output.CartMessagesVisibilityResultRepresentation.