Inventory FIFO Valuation
Replay stock receipts and issues for one SKU, costing issues from the oldest available receipt layers and flagging issues that exceed stock.
Custom requests cost 0.04 USDC on Base.
Download example JSON · OpenAPI · Source and usage
Pay with a browser wallet · Open example in checkout
POST a JSON request to /inventory-fifo-valuation/v1/check with an x402 V2 client.
Worked example
Request
{
"events": [
{
"type": "receipt",
"id": "r1",
"units": 3,
"unit_cents": 100
},
{
"type": "receipt",
"id": "r2",
"units": 5,
"unit_cents": 120
},
{
"type": "issue",
"id": "out",
"units": 4
},
{
"type": "issue",
"id": "fail",
"units": 7
}
]
}Result
{
"issued_cost_cents": 420,
"closing_value_cents": 480,
"closing_units": 4,
"layers": [
{
"id": "r2",
"units": 4,
"unit_cents": 120
}
],
"issues": [
{
"id": "out",
"cost_cents": 420
},
{
"id": "fail",
"cost_cents": null,
"short_units": 3
}
]
}Support catalog maintenance through GitHub Sponsors. Sponsor gptenv · Sponsor Jeremy Carter