---
schema_version: "1"
id: 2e9f71bc270322d305e218933635eee3f9c595d9b2e69f633f18568ab6c974a4
title: Add to Cart
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/salesforce-commerce/guides/d2c-commerce/b2b-comm-checkout-add-to-cart.md
canonical_url: https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/b2b-comm-checkout-add-to-cart.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ae8837eeba615401e9caf1bb0bf92d5e2b53aceef10453902b9cb81024226456
products:
  - B2B Commerce Developer Guide
  - Salesforce APIs
---
# Add to Cart

The workflow begins when a user adds items to the cart from either the Product Detail Page (PDP) or the Product List Page (PLP). The system then determines whether the user is initiating a new checkout or resuming an existing one and triggers the appropriate logic.

**Endpoint:** POST [`/commerce/carts/{activeCartOrId}/cart-items`](https://developer.salesforce.com/docs/commerce/salesforce-commerce/references/comm-cart-ref?meta=postCartItemCollection)
