SmartSupplyPro API (1.0.0)

Download OpenAPI specification:

License: MIT

Source OpenAPI spec (manually maintained). The CI bundles this file into openapi.yaml and builds api.html (ReDoc).

Analytics

Read-only analytics and KPIs

Get stock value over time

Returns daily stock value between two dates (inclusive), optionally filtered by supplier.

Authorizations:
sessionCookieoidc
query Parameters
start
required
string <date>

Inclusive start date (yyyy-MM-dd).

end
required
string <date>

Inclusive end date (yyyy-MM-dd).

supplierId
string

Optional supplier filter.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Current total stock per supplier

Aggregated current stock quantity per supplier for dashboards.

Authorizations:
sessionCookieoidc

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Financial summary (WAC)

Purchases, COGS, returns, write-offs, opening and ending inventory for a date range (inclusive). The server calculates using the configured costing method.

Authorizations:
sessionCookieoidc
query Parameters
from
required
string <date>

Inclusive start date (yyyy-MM-dd).

to
required
string <date>

Inclusive end date (yyyy-MM-dd).

supplierId
string

Optional supplier filter.

Responses

Response samples

Content type
application/json
{
  • "method": "WAC",
  • "fromDate": "2025-07-01",
  • "toDate": "2025-07-31",
  • "openingQty": 12000,
  • "openingValue": "345678.90",
  • "purchasesQty": 4200,
  • "purchasesCost": "83500.00",
  • "returnsInQty": 150,
  • "returnsInCost": "1200.00",
  • "cogsQty": 3900,
  • "cogsCost": "76000.00",
  • "writeOffQty": 35,
  • "writeOffCost": "550.00",
  • "endingQty": 12415,
  • "endingValue": "352828.90"
}

Item price trend

Historical unit purchase price for an item between two dates (inclusive).

Authorizations:
sessionCookieoidc
query Parameters
itemId
required
string

Inventory item id.

supplierId
string

Optional supplier filter.

start
required
string <date>

Inclusive start date (yyyy-MM-dd).

end
required
string <date>

Inclusive end date (yyyy-MM-dd).

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Monthly net stock movement

Returns monthly stock movement (stockIn and stockOut) between two dates. Optionally filter by supplier.

Authorizations:
sessionCookieoidc
query Parameters
start
required
string <date>

Inclusive start date (yyyy-MM-dd).

end
required
string <date>

Inclusive end date (yyyy-MM-dd).

supplierId
string

Optional supplier filter.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Dashboard summary

Returns a dashboard-ready summary for the specified period and/or supplier. If dates are omitted, the service defaults to the last 30 days ending "now".

Authorizations:
sessionCookieoidc
query Parameters
supplierId
string

Optional supplier filter.

startDate
string <date-time>

Inclusive start timestamp (ISO-8601). Defaults to now-30 days if omitted.

endDate
string <date-time>

Inclusive end timestamp (ISO-8601). Defaults to now if omitted.

Responses

Response samples

Content type
application/json
{
  • "stockPerSupplier": [
    ],
  • "lowStockItems": [
    ],
  • "monthlyStockMovement": [
    ],
  • "topUpdatedItems": [
    ]
}

Item update frequency (by supplier)

Returns update counts for items belonging to the specified supplier.

Authorizations:
sessionCookieoidc
query Parameters
supplierId
required
string

Supplier identifier.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Low stock items (by supplier)

Items below their configured minimum threshold for the specified supplier.

Authorizations:
sessionCookieoidc
query Parameters
supplierId
required
string

Supplier identifier.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Inventory

CRUD and mutations for inventory items

List all items (non-paginated)

For large datasets, prefer /api/inventory/search.

Authorizations:
sessionCookieoidc

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create item (ADMIN)

Authorizations:
sessionCookieoidc
Request Body schema: application/json
required
name
required
string non-empty

Display name of the item.

quantity
required
integer <int32> >= 0

Quantity currently in stock (>= 0).

price
required
number <double> >= 0.01

Unit price (> 0).

supplierId
required
string

Foreign key of supplier.

createdBy
string or null

Username/ID of creator (audit).

minimumQuantity
integer <int32>

Business-defined minimum threshold for low-stock checks.

Responses

Request samples

Content type
application/json
{
  • "name": "Steel Wrench",
  • "quantity": 25,
  • "price": 19.99,
  • "supplierId": "sup-001",
  • "createdBy": "carlos.k",
  • "minimumQuantity": 5
}

Response samples

Content type
application/json
{
  • "id": "a7b6c4a0-12ef-4e3a-98d0-8c6a22f5c111",
  • "name": "Steel Wrench",
  • "quantity": 25,
  • "price": 19.99,
  • "totalValue": 499.75,
  • "supplierId": "sup-001",
  • "createdBy": "carlos.k",
  • "createdAt": "2025-08-20T14:25:00Z",
  • "supplierName": "ACME Tools GmbH",
  • "minimumQuantity": 5
}

Get item by ID

Authorizations:
sessionCookieoidc
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "a7b6c4a0-12ef-4e3a-98d0-8c6a22f5c111",
  • "name": "Steel Wrench",
  • "quantity": 25,
  • "price": 19.99,
  • "totalValue": 499.75,
  • "supplierId": "sup-001",
  • "createdBy": "carlos.k",
  • "createdAt": "2025-08-20T14:25:00Z",
  • "supplierName": "ACME Tools GmbH",
  • "minimumQuantity": 5
}

Update item

Full update. Server ignores any body.id to avoid mismatches (controller sets body.id = null).

Authorizations:
sessionCookieoidc
path Parameters
id
required
string
Request Body schema: application/json
required
name
required
string non-empty

Display name of the item.

quantity
required
integer <int32> >= 0

Quantity currently in stock (>= 0).

price
required
number <double> >= 0.01

Unit price (> 0).

supplierId
required
string

Foreign key of supplier.

createdBy
string or null

Username/ID of creator (audit).

minimumQuantity
integer <int32>

Business-defined minimum threshold for low-stock checks.

Responses

Request samples

Content type
application/json
{
  • "name": "Steel Wrench",
  • "quantity": 25,
  • "price": 19.99,
  • "supplierId": "sup-001",
  • "createdBy": "carlos.k",
  • "minimumQuantity": 5
}

Response samples

Content type
application/json
{
  • "id": "a7b6c4a0-12ef-4e3a-98d0-8c6a22f5c111",
  • "name": "Steel Wrench",
  • "quantity": 25,
  • "price": 19.99,
  • "totalValue": 499.75,
  • "supplierId": "sup-001",
  • "createdBy": "carlos.k",
  • "createdAt": "2025-08-20T14:25:00Z",
  • "supplierName": "ACME Tools GmbH",
  • "minimumQuantity": 5
}

Delete item (ADMIN)

Authorizations:
sessionCookieoidc
path Parameters
id
required
string
query Parameters
reason
required
string (StockChangeReason)
Enum Description
INITIAL_STOCK

Initial quantity entered when item is first added to inventory.

MANUAL_UPDATE

Manual correction performed by a user (e.g., discrepancy fix).

PRICE_CHANGE

Manual correction performed by a user (e.g., new prices).

SOLD

Stock was sold to a customer (outbound).

SCRAPPED

Item was scrapped due to damage, policy, or internal decision.

DESTROYED

Item was destroyed beyond use (e.g., fire or critical damage).

DAMAGED

Item is damaged but not yet scrapped or returned.

EXPIRED

Item has passed its expiration date and is no longer sellable.

LOST

Item is missing or lost during handling, shipping, or storage.

RETURNED_TO_SUPPLIER

Stock was returned to the supplier (e.g., defective goods).

RETURNED_BY_CUSTOMER

Stock was returned by the customer (e.g., refund or exchange).

Example: reason=SOLD

Audit reason for deletion.

Responses

Search items by name (paged)

Case-insensitive substring match. Default size 20; default sort by price.

Authorizations:
sessionCookieoidc
query Parameters
name
required
string non-empty

Case-insensitive substring to search.

page
integer >= 0
Default: 0

Zero-based page index.

size
integer >= 1
Default: 20

Page size.

sort
string
Example: sort=price,asc

Sort criteria, e.g. price,asc or name,desc. Defaults to price,asc.

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "totalElements": 0,
  • "totalPages": 0,
  • "size": 0,
  • "number": 0,
  • "sort": { },
  • "first": true,
  • "last": true,
  • "numberOfElements": 0
}

Adjust quantity (±delta)

Authorizations:
sessionCookieoidc
path Parameters
id
required
string
query Parameters
delta
required
integer
Example: delta=-3

Positive to add stock; negative to remove.

reason
required
string (StockChangeReason)
Enum Description
INITIAL_STOCK

Initial quantity entered when item is first added to inventory.

MANUAL_UPDATE

Manual correction performed by a user (e.g., discrepancy fix).

PRICE_CHANGE

Manual correction performed by a user (e.g., new prices).

SOLD

Stock was sold to a customer (outbound).

SCRAPPED

Item was scrapped due to damage, policy, or internal decision.

DESTROYED

Item was destroyed beyond use (e.g., fire or critical damage).

DAMAGED

Item is damaged but not yet scrapped or returned.

EXPIRED

Item has passed its expiration date and is no longer sellable.

LOST

Item is missing or lost during handling, shipping, or storage.

RETURNED_TO_SUPPLIER

Stock was returned to the supplier (e.g., defective goods).

RETURNED_BY_CUSTOMER

Stock was returned by the customer (e.g., refund or exchange).

Example: reason=SOLD

Business reason for stock changes.

Responses

Response samples

Content type
application/json
{
  • "id": "a7b6c4a0-12ef-4e3a-98d0-8c6a22f5c111",
  • "name": "Steel Wrench",
  • "quantity": 25,
  • "price": 19.99,
  • "totalValue": 499.75,
  • "supplierId": "sup-001",
  • "createdBy": "carlos.k",
  • "createdAt": "2025-08-20T14:25:00Z",
  • "supplierName": "ACME Tools GmbH",
  • "minimumQuantity": 5
}

Update unit price

Authorizations:
sessionCookieoidc
path Parameters
id
required
string
query Parameters
price
required
number <double> >= 0.01
Example: price=24.5

New unit price (> 0)

Responses

Response samples

Content type
application/json
{
  • "id": "a7b6c4a0-12ef-4e3a-98d0-8c6a22f5c111",
  • "name": "Steel Wrench",
  • "quantity": 25,
  • "price": 19.99,
  • "totalValue": 499.75,
  • "supplierId": "sup-001",
  • "createdBy": "carlos.k",
  • "createdAt": "2025-08-20T14:25:00Z",
  • "supplierName": "ACME Tools GmbH",
  • "minimumQuantity": 5
}