Inventory fifo period close

inventory-fifo-period-close · version 1.0.0 · Financial calculations · free, no key needed

Close a periodic FIFO inventory period with exact valuation and a balanced caller-mapped closing entry.

Use when you need to: close periodic FIFO inventory · prepare FIFO closing entry · post periodic inventory adjustment.

Decide before calling

Read the versioned contract and the supported scope below. Reuse inventory-fifo-period-close@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-period-close@1.0.0 for close periodic FIFO inventory. 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",
  "accounts": {
    "inventory": "Inventory",
    "cogs": "COGS",
    "purchases": "Purchases"
  }
}

Response:

{
  "result": {
    "reference_version": "IAS-2-2024-25-27+periodic-FIFO-v1",
    "valuation": {
      "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"
        }
      ]
    },
    "postings": [
      {
        "line": 1,
        "account": "Inventory",
        "debit": "17.00",
        "credit": "0.00"
      },
      {
        "line": 2,
        "account": "COGS",
        "debit": "18.00",
        "credit": "0.00"
      },
      {
        "line": 3,
        "account": "Purchases",
        "debit": "0.00",
        "credit": "15.00"
      },
      {
        "line": 4,
        "account": "Inventory",
        "debit": "0.00",
        "credit": "20.00"
      }
    ],
    "debits": "35.00",
    "credits": "35.00"
  }
}

How to call it

MCP

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

{
  "id": "inventory-fifo-period-close",
  "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",
    "accounts": {
      "inventory": "Inventory",
      "cogs": "COGS",
      "purchases": "Purchases"
    }
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/inventory-fifo-period-close/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","accounts":{"inventory":"Inventory","cogs":"COGS","purchases":"Purchases"}}'

The machine-readable contract is at /v1/tools/inventory-fifo-period-close/versions/1.0.0.

CLI

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

Get the client at /clients/cli/.