Available to Sell (ATS) Calculation
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.
Standard Product ATS Calculation
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:
- The product must have a product inventory record
- The product's Perpetual field is
not checked (
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.
Base Product and Variation ATS Calculation
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.
Product Bundle ATS Calculation
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.
- The availability of a product bundle is calculated based on the availability of the bundled products.
- Placing an order that contains a bundle decrements the stock level of all bundled products
- When one bundled product becomes unavailable, the bundle becomes unavailable.
- The bundle availability isn't calculated. Instead, the inventory list Default in-stock option defines whether the bundle is available or not. If this option is set, the bundle is always available, otherwise is it never available.
- The availability of a product bundle is calculated based on the availability of the bundled products and the availability of the bundle itself.
- Placing an order that contains a bundle decrements the stock level of the bundle (only if the bundle has an inventory record) and all bundled products.
- When one bundled product becomes unavailable, the bundle becomes unavailable.
If the bundle itself has an inventory record, and the Use Bundle Inventory Only option is set:
- The availability of a product bundle is calculated based on the availability of the inventory record of the bundle only. The inventory records of the products in the bundle don't affect the availability calculation.
- Placing an order that contains a bundle decrements the stock level of the bundle, but not the bundled products.
- Only when the inventory record for the bundle itself becomes unavailable does the bundle become unavailable. If the bundled products are not available, the bundle is available.
Product Set ATS Calculation
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.