***

title: "DefaultStockLocationStrategy"
generated: true
---------------

<GenerationInfo sourceFile="packages/core/src/config/catalog/default-stock-location-strategy.ts" sourceLine="105" packageName="@vendure/core" since="2.0.0" />

The DefaultStockLocationStrategy was the default implementation of the [StockLocationStrategy](/current/core/reference/typescript-api/products-stock/stock-location-strategy#stocklocationstrategy)
prior to the introduction of the [MultiChannelStockLocationStrategy](/current/core/reference/typescript-api/products-stock/multi-channel-stock-location-strategy#multichannelstocklocationstrategy).
It assumes only a single StockLocation and that all stock is allocated from that location. When
more than one StockLocation or Channel is used, it will not behave as expected.

```ts title="Signature"
class DefaultStockLocationStrategy extends BaseStockLocationStrategy {
    init(injector: Injector) => ;
    getAvailableStock(ctx: RequestContext, productVariantId: ID, stockLevels: StockLevel[]) => AvailableStock;
    forAllocation(ctx: RequestContext, stockLocations: StockLocation[], orderLine: OrderLine, quantity: number) => LocationWithQuantity[] | Promise<LocationWithQuantity[]>;
}
```

* Extends: BaseStockLocationStrategy

<div className="members-wrapper">

### init

\<MemberInfo kind="method" type={`(injector: <a href='/current/core/reference/typescript-api/common/injector#injector'>Injector</a>) => `}   />

### getAvailableStock

\<MemberInfo kind="method" type={`(ctx: <a href='/current/core/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, productVariantId: <a href='/current/core/reference/typescript-api/common/id#id'>ID</a>, stockLevels: <a href='/current/core/reference/typescript-api/entities/stock-level#stocklevel'>StockLevel</a>[]) => <a href='/current/core/reference/typescript-api/products-stock/stock-location-strategy#availablestock'>AvailableStock</a>`}   />

### forAllocation

\<MemberInfo kind="method" type={`(ctx: <a href='/current/core/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, stockLocations: <a href='/current/core/reference/typescript-api/entities/stock-location#stocklocation'>StockLocation</a>[], orderLine: <a href='/current/core/reference/typescript-api/entities/order-line#orderline'>OrderLine</a>, quantity: number) => <a href='/current/core/reference/typescript-api/products-stock/stock-location-strategy#locationwithquantity'>LocationWithQuantity</a>[] | Promise<<a href='/current/core/reference/typescript-api/products-stock/stock-location-strategy#locationwithquantity'>LocationWithQuantity</a>[]>`}   />

</div>
