Configuring stocks

Creating stock

To create stock, send a POST request to the /api/stocks endpoint. The request body specifies the amount of stock for a given tenantArticleId at a specific facility.

In a productive environment, stock levels should be synchronized with an Enterprise Resource Planning (ERP) system. The following example call creates a quantity of 100 for one article:

POST https://{YOUR-TENANT-NAME}.api.fulfillmenttools.com/api/stocks
{
    "facilityRef": "d286e108-698b-4f6c-97b7-21f090f17e46",
    "tenantArticleId": "BLAZER-G-6354",
    "value": 100
}

Upon successful creation, the system returns a 201 CREATED response:

201 CREATED response
{
    "created": "2024-02-02T10:27:55.154Z",
    "facilityRef": "d286e108-698b-4f6c-97b7-21f090f17e46",
    "id": "33fb7ef6-47b5-4fd7-ac07-584293d84af3",
    "lastModified": "2024-02-02T10:27:55.154Z",
    "tenantArticleId": "BLAZER-G-6354",
    "value": 100,
    "scannableCodes": [],
    "scores": [
        {
            "type": "RATING",
            "name": "RECEIPT_DATE",
            "value": 3255
        }
    ],
    "reserved": 0,
    "facilityWideReserved": 0,
    "available": 100,
    "traits": [
        "PICKABLE",
        "ACCESSIBLE"
    ],
    "properties": {},
    "serializedProperties": "{}",
    "receiptDate": "2024-02-02T10:27:55.136Z",
    "version": 1
}

The response body includes fields such as reserved and facilityWideReserved. If a pick job within the facility requires this stock, the system reserves it. This reservation prevents other orders from claiming the same stock. Once the item is picked, the reservation is removed and the stock quantity is decreased.

Safety stock

In some scenarios, it is necessary to maintain safety stock, an amount of inventory that is not available for online orders. For example, in a retail store, items that a customer is currently trying on cannot be picked for an online order. Creating safety stock ensures a specified quantity is excluded from routing decisions and is therefore not available to be picked.

Safety stock is configured in bulk by sending a PUT request to the /api/safetystocks endpoint.

PUT https://{YOUR-TENANT-NAME}.api.fulfillmenttools.com/api/safetystocks
{
    "operations": [
        {
            "tenantArticleId": "SNEAK-W-4891",
            "facilityRef": "d286e108-698b-4f6c-97b7-21f090f17e46",
            "value": 10
        }
    ]
}
207 MULTI-STATUS response
[
    {
        "tenantArticleId": "SNEAK-W-4891",
        "value": 10,
        "status": "CREATED",
        "facilityRef": "d286e108-698b-4f6c-97b7-21f090f17e46"
    }
]

Integration layer

It is recommended to use events on the integration layer to manage stock changes dynamically. For example, an event from a Point of Sale (POS) terminal can trigger a stock update in fulfillmenttools. An event is also published by the platform whenever a stock change occurs.

Last updated