This is a simple inventory management system REST API, that allow managing Items, Customers, Orders, Suppliers, and supplies, and provide consistent and easy to use API.
Note
Maybe there is some missing information or bugs in the code or the documentation, i will update it as soon as possible, if you find any issue please open an issue or contact me.
- π§° Resources
- β ERD's and Diagrams
- π API Endpoints and Documentation
- OpenAPI Documentation
- Postman Collection
- π¦ Running the project
the following are the resources in the inventory management system API
-
Items : the products in the inventory
-
Suppliers : the people who supply the items to the inventory
-
Customers : are the people who buy the items
-
Orders : the transactions of the items between the customers and the inventory
-
Supplies : the transaction of the items between the suppliers and the inventory
- The following are the API endpoints and their documentation
Base URL : example.com/api/v1
HTTP Request | Operation | Description | HTTP Status Code | Request Body Sample | Response Body Sample |
|
Read | Get all items | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 429(Too Many Requests) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Items fetched successfully",
"data": [
{
"id": 4,
"name": "kjdslkjfklds",
"description": "1234",
"price": 22.0,
"quantity": 20
}
]
} |
|
Read | Get item by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Item fetched successfully",
"data": {
"id": 4,
"name": "kjdslkjfklds",
"description": "1234",
"price": 22.0,
"quantity": 20
}
} |
|
Create | Create new item the quantity initiale zero | 201 (Created) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"name": "item1",
"description": "item1 description",
"price": 100
} |
{
"status": "success",
"httpStatus": 201,
"message": "Item created successfully",
"data": {
"id": 5,
"name": "mfmo",
"description": "1234",
"price": 22.0,
"quantity": 0
}
} |
|
Update | Update item by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"name": "item1",
"description": "item1 description",
"price": 100
} |
{
"status": "success",
"httpStatus": 200,
"message": "Item updated successfully",
"data": {
"id": 4,
"name": "m",
"description": "14",
"price": 22.0,
"quantity": 20
}
} |
|
Delete | Delete item by id | 204 (No Content) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 410 (Gone) 429(Too Many Requests) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Item deleted successfully",
"data": {
"id": 6,
"name": "mfo",
"description": "1234",
"price": 22.0,
"quantity": 0
}
}
|
|
Partial Update | Partial Update item by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"name": "item1"
} |
{
"status": "success",
"httpStatus": 200,
"message": "Item Updated successfully",
"data": {
"id": 6,
"name": "mfo",
"description": "1234",
"price": 22.0,
"quantity": 0
}
} |
HTTP Request | Operation | Description | HTTP Status Code | Request Body Sample | Response Body Sample |
|
Read | Get all suppliers | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 429(Too Many Requests) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Suppliers fetched successfully",
"data": [
{
"id": 2,
"name": "sdfgh",
"address": "ramallah",
"email": "dsfdsfdsf",
"phone": "0568347131"
}
]
} |
|
Read | Get supplier by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Suppliers fetched successfully",
"data": {
"id": 2,
"name": "sdfgh",
"address": "ramallah",
"email": "dsfdsfdsf",
"phone": "0568347131"
}
} |
|
Create | Create new supplier | 201 (Created) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"name":"omar",
"address":"ramallah",
"phone":"0568347131",
"email":"dsfdsfdsf"
} |
{
"status": "success",
"httpStatus": 201,
"message": "Supplier created successfully",
"data": {
"id": 3,
"name": "omar",
"address": "ramallah",
"email": "dsffdsf",
"phone": "8347131"
}
} |
|
Update | Update supplier by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"name":"omar",
"address":"ramallah",
"phone":"8347131",
"email":"dsffdsf"
} |
{
"status": "success",
"httpStatus": 200,
"message": "Supplier updated successfully",
"data": {
"id": 3,
"name": "omar",
"address": "rallah",
"email": "dsfdsfdsf",
"phone": "0568347131"
}
} |
|
Delete | Delete supplier by id | 204 (No Content) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 410 (Gone) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Supplier deleted successfully",
"data": {
"id": 3,
"name": "omar",
"address": "rallah",
"email": "dsfdsfdsf",
"phone": "0568347131"
}
} |
|
Partial Update | Partial Update supplier by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"name": "supplier1"
} |
{
"status": "success",
"httpStatus": 200,
"message": "Supplier updated successfully",
"data": {
"id": 3,
"name": "omar",
"address": "rallah",
"email": "dsfdsfdsf",
"phone": "0568347131"
}
} |
HTTP Request | Operation | Description | HTTP Status Code | Request Body Sample | Response Body Sample |
|
Read | Get all customers | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 429(Too Many Requests) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Customers fetched successfully",
"data": [
{
"id": 12,
"name": "omsdjlsjdlkdsjlkar",
"email": "dsfdsfdsf",
"phone": "0568347131",
"address": "ramallah"
}
]
}
|
|
Read | Get customer by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Customer fetched successfully",
"data": {
"id": 12,
"name": "omsdjlsjdlkdsjlkar",
"email": "dsfdsfdsf",
"phone": "0568347131",
"address": "ramallah"
}
} |
|
Create | Create new customer | 201 (Created) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"name":"omar",
"address":"ramallah",
"phone":"056131",
"email":"dsffdsf"
} |
{
"status": "success",
"httpStatus": 201,
"message": "Customer created successfully",
"data": {
"id": 14,
"name": "omar",
"email": "dsffdsf",
"phone": "056131",
"address": "ramallah"
}
} |
|
Update | Update customer by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"name":"omar",
"address":"ramallah",
"phone":"056131",
"email":"dsffdsf"
} |
{
"status": "success",
"httpStatus": 200,
"message": "Customer updated successfully",
"data": {
"id": 12,
"name": "omjlkjlklkar",
"email": "dsfdsfdsf",
"phone": "0568347131",
"address": "ramallah"
}
} |
|
Delete | Delete customer by id | 204 (No Content) 400 (Bad Request) 401 (Unauthorized) (Forbidden) (Not Found) (Too Many Requests) 410 (Gone) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Customer deleted successfully",
"data": {
"id": 14,
"name": "omar",
"email": "dsffdsf",
"phone": "056131",
"address": "ramallah"
}
} |
|
Partial Update | Partial Update customer by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"name": "customer1"
} |
{
"status": "success",
"httpStatus": 200,
"message": "Customer updated successfully",
"data": {
"id": 12,
"name": "omjlkjlklkar",
"email": "dsfdsfdsf",
"phone": "0568347131",
"address": "ramallah"
}
} |
HTTP Request | Operation | Description | HTTP Status Code | Request Body Sample | Response Body Sample |
|
Read | Get all orders | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 429(Too Many Requests) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Orders fetched successfully",
"data": [
{
"id": 8,
"date": "2024-04-17T20:02:43.376+00:00",
"customerId": 12,
"orderItemsDTOS": [
{
"id": 12,
"quantity": 2,
"itemId": 4
}
]
}
]
} |
|
Read | Get order by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Order fetched successfully",
"data": {
"id": 8,
"date": "2024-04-17T20:02:43.376+00:00",
"customerId": 12,
"orderItemsDTOS": [
{
"id": 12,
"quantity": 2,
"itemId": 4
}
]
}
} |
|
Create | Create new order | 201 (Created) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"customerId": 12,
"orderItems": [
{
"itemId": 4,
"quantity": 2
}
]
} |
{
"status": "success",
"httpStatus": 201,
"message": "Order created successfully",
"data": {
"id": 9,
"date": "2024-04-17T20:33:45.529+00:00",
"customerId": 12,
"orderItemsDTOS": [
{
"id": 13,
"quantity": 2,
"itemId": 4
}
]
}
} |
|
Update | Update order by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"customerId": 12,
"orderItems": [
{
"itemId": 4,
"quantity": 2
}
]
} |
{
"status": "success",
"httpStatus": 200,
"message": "Order updated successfully",
"data": {
"id": 8,
"date": "2024-04-17T20:02:43.376+00:00",
"customerId": 12,
"orderItemsDTOS": [
{
"id": 14,
"quantity": 11,
"itemId": 4
}
]
}
}
|
|
Delete | Delete order by id | 204 (No Content) 400 (Bad Request) 401 (Unauthorized) (Forbidden) (Not Found) (Too Many Requests) 410 (Gone) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Order deleted successfully",
"data": null
} |
|
Partial Update | Partial Update order by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"quantity": 10
} |
{
"status": "success",
"httpStatus": 200,
"message": "Order updated successfully",
"data": {
"id": 8,
"date": "2024-04-17T20:02:43.376+00:00",
"customerId": 12,
"orderItemsDTOS": [
{
"id": 14,
"quantity": 11,
"itemId": 4
}
]
}
} |
HTTP Request | Operation | Description | HTTP Status Code | Request Body Sample | Response Body Sample |
|
Read | Get all supplies | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 429(Too Many Requests) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Supplies fetched successfully",
"data": [
{
"id": 2,
"itemId": 4,
"supplierId": 2,
"quantity": 22,
"ppu": 220.0,
"date": "2024-04-17T20:06:09.834+00:00"
}
]
} |
|
Read | Get supply by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Supply fetched successfully",
"data": {
"id": 2,
"itemId": 4,
"supplierId": 2,
"quantity": 22,
"ppu": 220.0,
"date": "2024-04-17T20:06:09.834+00:00"
}
} |
|
Create | Create new supply | 201 (Created) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"itemId": 4,
"quantity": 3,
"supplierId":2,
"ppu":220
} |
{
"status": "success",
"httpStatus": 201,
"message": "Supply created successfully",
"data": {
"id": 3,
"itemId": 4,
"supplierId": 2,
"quantity": 3,
"ppu": 220.0,
"date": "2024-04-17T20:36:57.956+00:00"
}
} |
|
Update | Update supply by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found) 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"itemId": 4,
"quantity": 100,
"supplierId":2,
"ppu":220
} |
{
"status": "success",
"httpStatus": 200,
"message": "Supply updated successfully",
"data": {
"id": 2,
"itemId": 4,
"supplierId": 2,
"quantity": 100,
"ppu": 220.0,
"date": "2024-04-17T20:06:09.834+00:00"
}
} |
|
Delete | Delete supply by id | 204 (No Content) 400 (Bad Request) 401 (Unauthorized) (Forbidden) (Not Found) (Too Many Requests) 410 (Gone) 500(Internal Server Error) |
N/A |
{
"status": "success",
"httpStatus": 200,
"message": "Supply deleted successfully",
"data": null
} |
|
Partial Update | Partial Update supply by id | 200 (OK) 400 (Bad Request) 401 (Unauthorized) 403 (Forbidden) 404 (Not Found), 429(Too Many Requests) 415 (Unsupported Media Type) 500(Internal Server Error) |
{
"quantity": 10
} |
{
"status": "success",
"httpStatus": 200,
"message": "Supply updated successfully",
"data": {
"id": 2,
"itemId": 4,
"supplierId": 2,
"quantity": 10,
"ppu": 220.0,
"date": "2024-04-17T20:06:09.834+00:00"
}
} |
- The OpenAPI v3.1.0 is available in the following link SwaggerHub
- The Postman collection is in the following file Postman Collection
- Clone the repository
git clone https://github.com/0xJ1NX/inventory-management-system.git
- Change the directory to the project directory
cd inventory-management-system
- Run the project
gradle bootRun
- The project will run on the default port
8080