Skip to content
ToolsOnDuty - free online tools
Browse documentation

Reference / Inventory

Inventory API

4 endpoints for inventory workflows. Every call requires bearer authentication and uses the standard ToolsOnDuty response envelope.

Try it

Runs a real request from your browser to your own ToolsOnDuty account. Your key is only kept in this page and is never stored.

POST/v1/inventory/reorder-point1 credit / call

Reorder point and quantity

Calculate daily demand, lead-time demand, reorder point, inventory position and a target-cover order quantity.

ParameterTypeRequiredDescription
unitsSoldnumberYesUnits sold during the demand period.
demandPeriodDaysnumberYesNumber of days represented by unitsSold.
leadTimeDaysnumberYesSupplier lead time in days.
safetyStockUnitsnumberNoSafety-stock units. Default: 0.
onHandUnitsnumberNoCurrent on-hand units. Default: 0.
onOrderUnitsnumberNoUnits already on order. Default: 0.
backorderedUnitsnumberNoBackordered units. Default: 0.
targetCoverDaysnumberYesTarget days of stock after replenishment.

Request

curl -X POST https://toolsonduty.com/api/v1/inventory/reorder-point \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"unitsSold":900,"demandPeriodDays":30,"leadTimeDays":14,"safetyStockUnits":180,"onHandUnits":520,"onOrderUnits":200,"backorderedUnits":20,"targetCoverDays":45}'

Response

{
  "ok": true,
  "data": {
    "reorderPoint": 600,
    "inventoryPosition": 700,
    "suggestedOrderQuantity": 650
  }
}
POST/v1/inventory/safety-stock1 credit / call

Statistical safety stock

Calculate demand-only and combined demand-and-lead-time safety stock from an explicit service factor.

ParameterTypeRequiredDescription
averageDailyDemandnumberYesAverage units demanded per day.
demandStandardDeviationnumberYesStandard deviation of daily demand.
averageLeadTimeDaysnumberYesAverage supplier lead time in days.
leadTimeStandardDeviationnumberNoStandard deviation of lead time in days. Default: 0.
serviceFactornumberYesOne-sided service factor, such as 1.65.

Request

curl -X POST https://toolsonduty.com/api/v1/inventory/safety-stock \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"averageDailyDemand":30,"demandStandardDeviation":8,"averageLeadTimeDays":14,"leadTimeStandardDeviation":2,"serviceFactor":1.65}'

Response

{
  "ok": true,
  "data": {
    "recommendedSafetyStock": 111,
    "reorderPoint": 531
  }
}
POST/v1/inventory/runway1 credit / call

Inventory runway

Calculate sellable stock coverage and whether an entered inbound shipment arrives before modeled stockout.

ParameterTypeRequiredDescription
onHandUnitsnumberYesPhysical on-hand units.
reservedUnitsnumberNoReserved units. Default: 0.
damagedUnitsnumberNoDamaged or unsellable units. Default: 0.
averageDailySalesnumberYesAverage units sold per day.
inboundUnitsnumberNoInbound shipment units. Default: 0.
inboundArrivalDaysnumberNoDays until inbound receipt. Default: 0.

Request

curl -X POST https://toolsonduty.com/api/v1/inventory/runway \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"onHandUnits":950,"reservedUnits":80,"damagedUnits":10,"averageDailySales":35,"inboundUnits":600,"inboundArrivalDays":18}'

Response

{
  "ok": true,
  "data": {
    "sellableNow": 860,
    "runwayDays": 24.57,
    "stockoutBeforeInbound": false
  }
}
POST/v1/inventory/purchase-order1 credit / call

Purchase order quantity

Calculate target stock, net requirement and a minimum-order and case-pack-rounded purchase quantity.

ParameterTypeRequiredDescription
forecastUnitsnumberYesForecast units over forecastPeriodDays.
forecastPeriodDaysnumberYesNumber of days represented by forecastUnits.
leadTimeDaysnumberYesSupplier lead time in days.
reviewCoverDaysnumberYesDesired review-period cover days.
safetyDaysnumberNoAdditional safety days. Default: 0.
onHandUnitsnumberNoCurrent on-hand units. Default: 0.
onOrderUnitsnumberNoUnits already on order. Default: 0.
backorderedUnitsnumberNoBackordered units. Default: 0.
minimumOrderQuantitynumberNoSupplier minimum order quantity. Default: 0.
casePackSizenumberNoUnits per case pack. Default: 1.
unitCostnumberNoPurchase cost per unit. Default: 0.

Request

curl -X POST https://toolsonduty.com/api/v1/inventory/purchase-order \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"forecastUnits":1200,"forecastPeriodDays":30,"leadTimeDays":21,"reviewCoverDays":30,"safetyDays":7,"onHandUnits":700,"onOrderUnits":300,"backorderedUnits":25,"minimumOrderQuantity":250,"casePackSize":24,"unitCost":8.5}'

Response

{
  "ok": true,
  "data": {
    "netRequirement": 1345,
    "suggestedOrderQuantity": 1368,
    "caseCount": 57
  }
}