Business Unit context on the Cart
as-associate endpoint you met in Configure associate access, scoped to a Business Unit. The platform records the Business Unit on the Cart's businessUnit field and enforces the acting Associate's permissions server-side through the same Permission Gate.POST /{projectKey}/as-associate/{associateId}/in-business-unit/key=atlas-apac/carts HTTP/1.1
Content-Type: application/json
{
"currency": "AUD",
"store": { "typeId": "store", "key": "atlas-apac-store" },
"purchaseOrderNumber": "PO-2026-04-1180",
"lineItems": [
{
"sku": "ZET-MON-27",
"quantity": 40,
"distributionChannel": { "typeId": "channel", "key": "atlas-apac-pricing" }
}
]
}
Two fields connect this Cart back to earlier modules:
storesets the commercial context (assortment and Channel) you designed in Design B2B catalogs.distributionChannelon each Line Item is the link to Configure B2B pricing: it makes each item resolve the buyer's negotiated, Channel-scoped Price rather than an unscoped one.
businessUnit is taken from the URL path, not the request body, so the Cart always belongs to the Business Unit you addressed.Native purchase order tracking
purchaseOrderNumber field. It exists on Cart, Quote Request, Staged Quote, Quote, and Order, and a value set on the Cart is inherited by the Order or Quote Request created from it, so you set it once at the start of the flow.purchaseOrderNumber field rather than a Custom Field for the PO. Custom Fields remain the right tool for other B2B context that has no native field, such as a cost-center reference on a Line Item or an internal requisition label.Payment by invoice
purchaseOrderNumber ties the Order to the buyer's procurement record, and a downstream financial system issues the invoice and reconciles payment on those terms. Model the settlement with the Payments resource, and treat card authorization at checkout as the exception for B2B rather than the default.Modeling B2B-specific data
purchaseOrderNumber shows the first rule of B2B data modeling: prefer a native field whenever one exists. When a requirement has no native field, commercetools offers two extension tools, Custom Fields and Custom Objects, and choosing between them is a recurring decision.- Custom Fields attach typed data to an existing resource. Use them when the data belongs to a Cart, Order, Line Item, Customer, Business Unit, or Quote, such as payment terms on a Cart, a cost-center reference on a Line Item, or an internal requisition label on an Order.
- Custom Objects are standalone key-value records with no host resource. Use them for data that does not belong to a single resource instance, such as a buyer's credit limit, organization-wide configuration, or lookup tables that several resources reference.
Shipping one Cart to many destinations
shippingMode controls this.Single ShippingMode when the whole Cart ships to one destination. Use Multiple when one order must deliver quantities to several registered itemShippingAddresses.Multiple, register the destinations in itemShippingAddresses and then allocate each Line Item's quantity across those addresses through shippingDetails. Until every Line Item is fully allocated, the platform does not calculate taxedPrice, so an unallocated quantity is a common cause of a Cart that "won't show tax".Freezing a Cart for committee review
freezeStrategy field chooses how strict that hold is.SoftFreeze FreezeStrategy when the committee only needs Line Item prices to hold. Use HardFreeze when the final total must stay unchanged because Cart Discounts, Discount Codes, and Shipping Methods must also remain fixed.POST /{projectKey}/as-associate/{associateId}/in-business-unit/key=atlas-apac/carts/{cartId} HTTP/1.1
Content-Type: application/json
{
"version": 7,
"actions": [
{ "action": "freezeCart", "freezeStrategy": "HardFreeze" }
]
}
unlockCart.Reordering with Cart replication
High-frequency buyers resubmit a standing basket. Two mechanisms serve this, and they are different tools:
- Reorder is buyer-driven and one-off. To repeat a past purchase, replicate an existing Cart or Order into a fresh, active Cart, then adjust quantities before checkout. A saved Shopping List serves the same goal from a curated template.
- Recurring Order is scheduled and automated. For a fixed cadence, model the basket as a Recurring Order instead, which you design later in this module.
Reach for a reorder when a person decides to buy again, and for a Recurring Order when the schedule should decide.
Supporting punch-out procurement
- Product Selections expose only the buyer's contracted catalog and negotiated prices through their Store, so the punch-out session shows the right assortment.
as-associateCarts assemble the basket in the buyer's Business Unit context, carrying the Store and distribution Channel so prices resolve correctly.- Approval Flows enforce the buyer's internal spending thresholds before an order is committed.
The integration work sits in the middleware that bridges the buyer's procurement protocol to these resources; the platform supplies the scoped catalog, the contextual Cart, and the governance a punch-out workflow needs.
Direct Order or Quote: the decision point
A filled B2B Cart leads to one of two paths, and choosing between them is the architectural decision this module turns on:
- Direct Order: the buyer is entitled to a price they accept as-is, so the Cart becomes an Order directly. This fits self-service reordering.
- Quote: the basket needs negotiation, such as volume pricing or custom terms, before it becomes an Order. A supported Cart becomes a Quote Request. This fits large or bespoke purchases.
shippingMode: Multiple. It also cannot be created from an anonymous Cart or a Cart with Discount Codes, and the source Cart must have a shippingAddress. If a buyer needs both negotiated terms and delivery to several sites, design separate single-shipping Quote Requests per destination, or negotiate the terms first and then use Direct Orders for the multi-site purchasing pattern.Worked example: choosing the right Atlas Cart path
Atlas Corporate's APAC division has two related purchasing needs: one order must ship to several sites, and another large basket needs negotiation. Keep those paths separate:
- For a multi-site Direct Order, create the Cart with context.
POSTto theas-associate/in-business-unit/key=atlas-apacCarts endpoint, inAUD, against theatlas-apac-store, settingpurchaseOrderNumberto the buyer's PO. Each Line Item carries theatlas-apac-pricingdistribution Channel so prices resolve to Atlas's negotiated rates. - Distribute the shipment for the Direct Order. Set
shippingMode: Multiple, register the four hotel addresses initemShippingAddresses, and allocate each Line Item's quantity across them withshippingDetails. ConfirmtaxedPricenow appears, proving every quantity is allocated. - Freeze for the committee. Apply
freezeCartwithHardFreezeso neither the catalog price nor any discount or shipping cost can move while the committee reviews the agreed total. When the committee approves, create the Order from this Cart. - For negotiated terms, create a supported Quote Request Cart. Use a separate Cart with
shippingMode: Single, ashippingAddress, and no Discount Codes. Keep the Business Unit context, purchase order number, Store, and distribution Channel, then create the Quote Request from that Cart.
This design uses multi-shipping where the platform supports it, and uses the Quote flow only from a Cart shape that Quote Requests support.
Key takeaways
- A B2B Cart is created through the
as-associateandin-business-unitpath; the Business Unit comes from the URL, and Line ItemdistributionChannelresolves the buyer's negotiated Price. - Use the native
purchaseOrderNumberfor PO tracking; it propagates from Cart to the Order or Quote Request created from it. Reserve Custom Fields for context with no native field. - For B2B data with no native field, use a Custom Field for data that belongs to a resource and a Custom Object for standalone data referenced from elsewhere.
shippingMode: Multipleships one Cart to manyitemShippingAddresses; unallocated quantities suppresstaxedPrice.SoftFreezelocks prices;HardFreezealso locks discounts and shipping. A freeze allows price-neutral edits, while a lock blocks all edits.- Reorder a past purchase by replicating a Cart or Order; use a Recurring Order for a fixed, scheduled cadence instead.
- Most B2B orders settle by invoice on account against net terms; the
purchaseOrderNumberlinks the Order to the buyer's procurement record. - Support punch-out procurement by combining Product Selections,
as-associateCarts, and Approval Flows through middleware, not a built-in connector. - A filled Cart becomes either a Direct Order (price accepted) or, when the Cart uses a supported single-shipping shape, a Quote Request (price negotiated).