Inventory fifo periodic value

inventory-fifo-periodic-value · version 1.0.0 · Financial calculations · free, no key needed

Value ending inventory and cost of goods sold under periodic FIFO with exact, reproducible layer retention.

Use when you need to: periodic FIFO inventory valuation · calculate FIFO COGS · value physical ending inventory.

Decide before calling

Read the versioned contract and the supported scope below. Reuse inventory-fifo-periodic-value@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use inventory-fifo-periodic-value@1.0.0 for periodic FIFO inventory valuation. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "beginning_layers": [
    {
      "layer_id": "B1",
      "acquired_on": "2026-01-01",
      "quantity": "10",
      "unit_cost": "2.00"
    }
  ],
  "purchases": [
    {
      "layer_id": "P1",
      "acquired_on": "2026-01-10",
      "quantity": "5",
      "unit_cost": "3.00"
    }
  ],
  "physical_ending_quantity": "6",
  "output_scale": 2,
  "rounding_mode": "half-up"
}

Response:

{
  "result": {
    "reference_version": "IAS-2-2024-25-27+periodic-FIFO-v1",
    "available_quantity": "15",
    "ending_quantity": "6",
    "sold_quantity": "9",
    "goods_available_cost": "35.00",
    "ending_inventory": "17.00",
    "cogs": "18.00",
    "ending_layers": [
      {
        "layer_id": "B1",
        "source": "beginning",
        "input_index": 0,
        "acquired_on": "2026-01-01",
        "quantity": "1",
        "unit_cost": "2",
        "extended_cost": "2.00"
      },
      {
        "layer_id": "P1",
        "source": "purchase",
        "input_index": 0,
        "acquired_on": "2026-01-10",
        "quantity": "5",
        "unit_cost": "3",
        "extended_cost": "15.00"
      }
    ]
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "inventory-fifo-periodic-value",
  "version": "1.0.0",
  "input": {
    "beginning_layers": [
      {
        "layer_id": "B1",
        "acquired_on": "2026-01-01",
        "quantity": "10",
        "unit_cost": "2.00"
      }
    ],
    "purchases": [
      {
        "layer_id": "P1",
        "acquired_on": "2026-01-10",
        "quantity": "5",
        "unit_cost": "3.00"
      }
    ],
    "physical_ending_quantity": "6",
    "output_scale": 2,
    "rounding_mode": "half-up"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/inventory-fifo-periodic-value/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"beginning_layers":[{"layer_id":"B1","acquired_on":"2026-01-01","quantity":"10","unit_cost":"2.00"}],"purchases":[{"layer_id":"P1","acquired_on":"2026-01-10","quantity":"5","unit_cost":"3.00"}],"physical_ending_quantity":"6","output_scale":2,"rounding_mode":"half-up"}'

The machine-readable contract is at /v1/tools/inventory-fifo-periodic-value/versions/1.0.0.

CLI

node cli.mjs run inventory-fifo-periodic-value 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.