Non-stationary (s, S) Policy Calculator API Documentation

Base URL

https://inventory-api-9uz7.onrender.com/ss_dp

Endpoint

POST /

Description

This endpoint calculates the re-order and order-up-to levels of the optimal (s, S) inventory control policy for the inventory control problem in a finite-horizon periodic-review system.

Request

Method: POST

Content-Type: application/json

Body:

{
    "K": 50,
    "h": 1,
    "p": 10,
    "d": [30, 40, 30, 40, 30]
}

Parameters

Example Request

curl -X POST https://inventory-api-9uz7.onrender.com/ss_dp \
-H "Content-Type: application/json" \
-d '{
  "K": 50,
  "h": 1,
  "p": 10,
  "d": [30, 40, 30, 40, 30]
}'

Response

Status Code: 200 OK

Body: JSON object containing the calculated metrics (example structure below)

{
    "optCost":287.7,
    "S":[37,78,78,49,37],
    "s":[19,29,19,28,19],
    "solTime":0.63
}

Error Handling

Status Code: 400 Bad Request

Body: JSON object with error details

{
    "error": "Invalid input data"
}

Notes