Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

Overwiew 

Purpose of Buffers: Buffers are used to protect reserve a certain number of stock units. The most common use case is to protect a few units (2-3) of stock from the overall saleable stock, in order to mitigate desynchronisation between in-store Their primary role is to prevent issues like stock desynchronization across various sales channels. This is particularly useful in scenarios where there are both physical store sales and online sales.

...

Application

...

by Stock Type: Buffers can be applied in different ways, either globally or by

...

specific endpoints (like a particular store or warehouse). The key aspect of buffer application is that it is always open by stock type.

...

Example: If there is a global buffer of 2 for the on_hand stock type and another of 3 for the ASN stock type, when the buffers are applied globally, their application corresponds to the sum of the global application for on_hand + the global application for ASN.

Buffer groups

Any buffer to a buffer_group to which it belongs and that allows it to be referred to from a stock request

Buffer groups in stock requests
Code Block
languagejs
{
    "aggregates": {
        "0": {
            "deduction": {
                "endpoint_buffer": [
                    "FR",
					"IT"
                ],
                "global_buffer": [
					"stores_FR"
                ]
            }
        }
    }
}

This means each type of stock, like on_hand or ASN (Advanced Shipping Notice), is considered separately, and buffers for different stock types are not unified.

Types of Buffers

There are two types of buffers, endpoint detailed buffers and global buffers. The first will be assigned and deducted at endpoint level, the second will be assigned without a notion of endpoint and will be deducted once the endpoints stock locations have been aggregated. As a result, the global buffers are only taken into account in the stock query with unification by endpointstock llocation.

Detailed Buffer

...

Declaration by item,

...

stock location ID pair

The simplest buffers, corresponding to a number of buffered units for a couple item_id , endpoint_id.

endpoint_id

item_id

qty

buffer_Stock Location ID

Item ID

Quantity

Buffer group

store_1

i1

2

FR

store_1

i1

3

US

Declaration

...

by key requests

Very similar Similar to hard buffersprevious, but more flexible. They allow you to specify filters to take into account the dynamic handling of endpoints and items.

...

endpoint_id

...

item_id

...

qty

...

buffer_group

...

endpoint_type = store AND address.region.country.code = FR

...

*

...

9

...

FR

...

endpoint_type = warehouse 

...

*

...

12

...

WORLD

...

Allows to apply the buffer based on an existing Item and Stock Location Key Request. Key requests are prefilled Item queries, which allow for example retrieveing items from Spring Season, or Stock Locations from London

Stock Locations

Items

Quantity

Buffer group

London stores

Spring 25

3

UK

Paris stores

Spring 25

2

FR

Global Buffer

Allows a buffer to be allocated globally, i.e. without filtering the endpoints stock locations affected. If an endpoint filter is declared, it will be ignored. Allows a number of units to be buffered globally.

...

item_id

...

qty

...

buffer_group

...

category = "bebe"

...

9

...

FR

...

*

...

12

...

WORLD

Buffer structure

API signature

Routes BIP - Buffer Inventory Processor

  • item_filter: If nil, applies to all items

    • id (string): item_id on which the buffer will be applied (hard buffer)

    • request_name (string): Used to apply the buffer to a request item (all items with a certain category). Must be empty if id is set

  • endpoint_filter: If nil, applies to all endpoints

    • id (string): endpoint_id to which the buffer will be applied (hard buffer)

    • request_name (string): Used to apply the buffer to a request endpoint (all endpoints of type store). Must be empty if id is set

  • stock_type (string): required type of stock on which the buffer is applied.

  • global (bool): true in the case of a global buffer, false otherwise.

  • buffer_group (string): required buffer group to which the buffer belongs, allows it to be referenced in a stock request..

  • qty (int): required number of buffered units. 

Stock Locations

Items

Quantity

Buffer group

Global

London stores

Spring 25

15

UK

true

Paris stores

Spring 25

10

FR

true

Creating buffers

Buffers can be created by API. Refere to our API documentation portal for more information : https://developers.onestock-retail.com/paths/buffers/patch

Impact of buffers on stock calculations

Taken into account in stock requests

The global buffers/endpoints that are applied depend on the configuration of the stock requests. The stock request lists the buffer groups - the groups into which the buffers are distributed - that need to be taken into account. If there are 3 global buffers configured for the same stock key, and the aim is to apply arbitrarily 1 of these 3, all you have to do is distribute them in 3 different buffers groups, and indicate ONLY 1 in the stock request.Buffers are categorized into buffer groups. This categorization allows for efficient referencing from a stock query, making the management of buffers more structured and organized.

Bufferes are taken into account in Stock Queries when their groups are referenced in the query.

Global buffers will only take effect when the Stock Query is unified by stock location, otherwise it will not be taken into account.

Learn more about stock queries herer Configuration of stock queries

Calculation

When buffers are taken into account in a stock request, available stock is calculated as follows: 

...

Detailed stock query : Without stock location unification

Infocode

Detaille

Stock
per endpoint => MAX( RawStock - ResEndpoint - Dispositions - MAX ( BufDur, BufEndpoint ) , 0 )
 per stock location : 

MAX( 
    RawStock - ResStockLocation - Dispositions - MAX(BufPairs, BufKeyRequest) ,
    0 
    )

With endpoint unification

Code Block
MIN(
    SUM(
        MAX_per_parstock_endpointlocation(
            RawStock - ResEndpoint  ResStockLocation - Dispositions - MAX(BufDurBufPairs, BufEndpointBufKeyRequest),
            0
        )
    ),
    SUM(RawStock - ResEndpoint  ResStockLocation- Dispositions) - BufGlob
)

...