API Availability Calculation

This topic describes how the following APIs calculate >availability. There are some release-specific considerations for updating stock levels.

isOrderable()

Simple product

Returns true if

Product bundle

Returns true if

Base product

Returns true if all of the following conditions are true:

Product set

Returns true if all of the following conditions are true:

isOrderable(Quantity)

Note: isOrderable(quantity) doesn't depend on minOrderQuantity of product
Simple product

Identical to isOrderable(), except that the quantity must be greater than or equal to the specified quantity.

Product bundle

Identical to isOrderable(), except that the quantity must be greater than or equal to the specified quantity.

Base product

Identical to isOrderable(), except that the sum of orderable variation products must be greater than or equal to the quantity.

Product set

Identical to isOrderable(), except that the sum of orderable products in the set must be greater than or equal to the quantity.

isInStock()

Simple product

Returns true if

Product bundle

Returns true if

Base product

Returns true if

Product set

Returns true if

isInStock(Quantity)

Note: isInStock(quantity) doesn't depend on minOrderQuantity of product
Simple product

As above, but stock-level must be greater than or equal to the quantity, and the quantity must be greater than or equal to one.

Product bundle

As above, but stock-level must be greater than or equal to the quantity, and the quantity must be greater than or equal to one.

Base product

As above, but sum of variation product stock-levels must be greater than or equal to the quantity, and the quantity must be greater than or equal to one.

Product set

As above, but sum of set product stock-levels must be greater than or equal to the quantity, and the quantity must be greater than or equal to one.

GetAvailabilityStatus()

Simple product

Returns availability status for quantity one. Possible statuses are:

Product bundle

Returns availability status for quantity one. See "Simple Product" column for possible statuses.

Returned status is computed based on the records of the bundled products and the record of the bundle if it exists, and represents the lowest availability status of the involved products.

For example, if all bundled products are IN_STOCK, but the bundle has a record and is NOT_AVAILABLE, method returns NOT_AVAILABLE.

Base product

Returns availability status for the variation product with the best availability for quantity one. For example, if all variation products are BACKORDER, but only one is IN_STOCK, method returns IN_STOCK.

Product set

Returns availability status for the set product with the best availability.

GetAvailabilityLevels(Quantity)

Simple product

Returns availability statuses for quantity. For example, if requested quantity is 10, and stock level is two, and product can be backordered, and backorder quantity is five, the method returns the following: IN_STOCK-2, BACKORDER-5, NOT_AVAILABLE-3

Product bundle

Returns availability statuses for quantity. Based on the rules described previously, but computation combines the availability levels of all bundled products and the bundle itself (if it has a record).

Base product

Returns availability status for quantity based on the variation products with the best availability.

Product set

Returns availability statuses for quantity based on the set products with the best availability

ReserveInventoryForOrder(Basket)

Simple product

Decrement product stock-level. Fails if ATS is less than the productLineItem.quantity.

Product bundle

If bundle has record, decrement stock-level of bundle. Decrement stock-levels of bundled product line items recursively. Fails if the available to sell (ATS) value is less than the productLineItem.quantity.

Base product

Fails if product line item is base product. A base product can't be ordered.

Product set

Fails if product line item is product set. A product set can't be ordered.

GetAvailability()

Uses the preorder/backorder allocation and the inventory list default-in-stock flag to calculate availability.

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.