Stock available until and expiry

availableUntil defines the end date of stock availability. It is automatically calculated from either the expiry or creation dates, with optional modifiers defined in listings. For expected stock, the calculation is based on the purchase order creation date. When a receipt is created, the stock's availableUntil is updated accordingly. If both expiry and availableUntil (with calculationBase = CREATION) are set, only availableUntil applies. By default, availableUntil equals the expiry date if expiry properties are configured.

More information can be found under: Stock properties and available until

Listing configuration

Tracking the expiry date can be made mandatory in a listing by configuring stockProperties.

  • By default, a stock's availableUntil equals its expiry date.

  • If the stock should be removed from availability before its expiry, configure a modifier in stockAvailableUntil.

Example request:

PATCH https://{YOUR-TENANT-NAME}.api.fulfillmenttools.com/api/facilities/{facilityId}/listings/{tenantArticleId}
{
    "version": 1,
    "actions": [
        {
            "stockAvailableUntil": {
                "calculationBase": "EXPIRY",
                "modifier": "-P10D"
            },
            "stockProperties": {
                "expiry": {
                    "inputType": "DATE",
                    "required": true
                }
            }
        }
    ]
}

Response: Returns 200 OK with the updated listing.

Stock creation or update with expiry date

When creating or updating stock, an expiry date can be added.

Example request:

PUT https://{YOUR-TENANT-NAME}.api.fulfillmenttools.com/api/stocks
{
  "stocks": [
    {
      "id": "00af1571-2890-4e14-8591-9ecf12863220",
      "value": 100,
      "version": 1,
      "properties": {
        "expiry": "2026-11-06T13:11:35.738Z"
      },
    }
  ]
}

Response: Returns 200 OK with the updated stock.

Expected stock creation or update with expiry date

Expiry dates for expected stock can be defined in the requestedItems of a purchase order.

  • If calculationBase = CREATION, the purchase order’s creation date is used.

  • When a receipt is created, availableUntil in the stock is updated based on the creation date.

Example request:

POST https://{YOUR-TENANT-NAME}.api.fulfillmenttools.com/api/purchaseorders
{
    "facilityRef": "ddf1a015-33ae-4f9d-a81d-8ab712d81ea5",
    "orderDate": "2025-10-21T08:16:07.000Z",
    "supplier": {
        "name": "OC fulfillment GmbH"
    },
    "requestedDate": {
        "type": "TIME_POINT",
        "value": "2025-11-21T08:16:07.000Z"
    },
    "requestedItems": [
        {
            "quantity": {
                "value": 10
            },
            "tenantArticleId": "4711",
            "stockProperties": {
                "expiry": "2026-11-06T13:11:35.738Z"
            }
        }
    ]
}

Response: Returns 201 CREATED with the created purchase order.

Receipt creation with stock expiry

When a receipt is created, properties are transferred to the stock.

  • The expiry date for the stock is set.

  • If stockAvailableUntil is defined in the listing, availableUntil is automatically set upon stock creation.

Example request:

POST https://{YOUR-TENANT-NAME}.api.fulfillmenttools.com/api/inboundprocesses/:inboundProcessId/receipts
{
    "receivedDate": "2025-11-21T08:16:07.000Z",
    "receivedItems": [
        {
            "tenantArticleId": "4711",
            "acceptedQuantity": {
                "value": 100
            },
            "rejectedQuantity": {
                "value": 0
            },
            "stockProperties": {
                "expiry": "2026-11-06T13:11:35.738Z"
      }
            "comments": []
        }
    ],
    "comments": []
}

Response: Returns 201 CREATED with the created receipt.

Last updated