Skip to content
HALOWERK

Calculators and Rule Checks

inventory planning expiry exposure

Inventory expiry projection estimates units lost by lot under earliest-expiry-first allocation. Use it when an agent needs planning markdowns or transfers before expiry.

POST https://rechen.halowerk.com/v1/inventory-planning-expiry-exposure

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
lotsarrayYes
demandarrayYes
Show full input schema
{
  "type": "object",
  "properties": {
    "lots": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "units": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000000
          },
          "last_usable_day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          }
        },
        "required": [
          "id",
          "units",
          "last_usable_day"
        ],
        "additionalProperties": false
      },
      "maxItems": 100,
      "minItems": 1
    },
    "demand": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 0,
        "maximum": 10000000
      },
      "maxItems": 366,
      "minItems": 1
    }
  },
  "required": [
    "lots",
    "demand"
  ],
  "additionalProperties": false
}

Open original schema

Published input example

{
  "demand": [
    4,
    8,
    5,
    9,
    7,
    2
  ],
  "lots": [
    {
      "id": "June-A",
      "units": 9,
      "last_usable_day": 1
    },
    {
      "id": "June-B",
      "units": 30,
      "last_usable_day": 4
    }
  ]
}

Result & documentation

Show published result schema
{
  "type": "object",
  "required": [
    "measured_at",
    "source",
    "data",
    "limitations"
  ],
  "properties": {
    "measured_at": {
      "type": "string"
    },
    "source": {
      "type": "object",
      "required": [
        "reference",
        "retrieved_at"
      ],
      "properties": {
        "reference": {
          "type": "string"
        },
        "retrieved_at": {
          "type": "string"
        }
      }
    },
    "data": {
      "type": "object",
      "properties": {
        "expired_units": {
          "type": "integer"
        },
        "unfilled_units": {
          "type": "integer"
        },
        "surviving_units": {
          "type": "integer"
        },
        "expired_lots": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "expired_units",
        "unfilled_units",
        "surviving_units",
        "expired_lots"
      ]
    },
    "limitations": {
      "type": "string"
    }
  }
}

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-12-05 UTC.

More endpoints in this hub

All endpoints in this hub →