In Salesforce B2C Commerce, the product availability presented to storefront customers is defined as the available to sell (ATS) quantity.
The ATS calculation depends on the product type: standard, variation, base product, product set, or product bundle.
ATS represents the quantity of a product allocated for sale that hasn’t shipped and that
isn’t being held for pending orders, plus its quantity available for backorders and
preorders. In general, the ATS is the sum of the allocation and
preorderBackorderAllocation, reduced by the turnover and the (optional) on order
quantity. By default, it's equal to the number of units of a product that are allocated
to sell (the allocation
value).
The following are some key formulas:
Value | Formula |
---|---|
ATS | ATS = max(0, allocation + preorderBackorderAllocation - turnover – on-order) |
Stock level | StockLevel = max(0, allocation - turnover – on-order) |
Available for shipping | Available for shipping = max(0, allocation - turnover ) |
Turnover represents a running count of a product's unit sales since the last inventory update. The optional On Order quantity represents the quantity that’s ordered but isn't yet exported for shipping. The turnover doesn't include the On Order quantity.
When products are added to the shopping cart, they are not subtracted from ATS. Adjustments to ATS only occur at final checkout. Adding a product to the shopping cart doesn't reserve the product or guarantee its availability at checkout.
If a merchant chooses to use B2C Commerce to calculate the ATS value between inventory updates, the following conditions must apply:
perpetual = false
).If the customer supports backorders or
pre-orders, the product's Pre-Order/Backorder Handling field is set
to Pre-Order
or Backorder
(backorderable =
true
or preorderable = true
)
A change to a product's turnover
,
allocation
, or
preorderBackorderAllocation
values result in a
recalculation of ATS. When the allocation level is reset, the turnover
value is set to zero, but the on-order value isn't changed.
A base product doesn't have its own product record. Instead, the availability of a base product is calculated based on the availability of all variations. As long as a single variation is available, the base product is still considered available. In previous versions of B2C Commerce, a single product record was used to calculate ATS for base product and is still included for legacy applications.
A product bundle can have its own product record in addition to the inventory records for the bundled products. This approach lets the merchant control the availability of bundles independent from the availability of the bundled products. The availability of the bundle is calculated differently. How ATS is calculated depends on whether the bundle itself has an inventory record and whether the Use Bundle Inventory Only option is selected on the Inventory List page.
If the bundle itself has an inventory record, and the Use Bundle Inventory Only option is set:
A product set does not have its own product record. Instead, the availability of a product set is calculated based on the availability of all set products. As long as a single set product is available, the product set is still considered available. In previous versions of B2C Commerce, a single product record was used to calculate ATS for product sets and is still included for legacy applications.