Warning: Undefined array key "SECRET_KEY" in /home/u179110326/domains/api.flowareapps.com/public_html/app/Middleware/JWTMiddleware.php on line 15

Warning: Undefined array key "PROD" in /home/u179110326/domains/api.flowareapps.com/public_html/app/Router.php on line 40
Inventory API

Floware Inventory API

Introduction

Welcome to our API documentation. This API will allow you to access our inventory management system, feel free to contact us if you need assistance!


Authentication

To use this API, you must login using the credentials provided by the admin. You will receive a Jason Web Token that you must include in the header of each request.

token: Bearer {YOUR_API_KEY} 


Endpoints

POSTfloware.studio/api/login

Allows the user to log on & obtain a authentication token.

JSON Body:

  • username (required)
  • password (required)

{
    "username": "JohnDoe",
    "password": "password"

}

Response:


{

    "message": "User authenticated",
    "token": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9eyJ0eXAiOi
        JKV1QiLCJhbGciOiJIUzI1NiJ9eyJ0eXAiOiJKV1QiLCJhbGciOiJNiJ9",

}

POST floware.studio/api/createuser

Create a new user

JSON Body:

  • username (required)
  • password (required)
  • email (required)
  • role (staff, manager, admin) (required)

{
        "username": "TestUser",
        "password": "TestPassword"
        "email": "test@email.com"
        "role": "staff"

}

Response:

{
        "message": "User created"
        "id": 42,

}

GET floware.studio/api/getproduct

Returns a specific product or the whole list

Request Body:

  • id (optional)
  • floware.studio/api/getproduct?id=1

Response:

{
        "id": 1,
        "name": "Product 1",
        "description": "this is a description"
        "barcode": "A182373A"
        "sku": "GA-KAJ81"
        "price": "2499"
        "cost": "1999"
        "quantity": "5"
        "created_at": "2024-08-24 22:54:25"
        "updated_at": "2024-08-25 00:00:58"

}

POST floware.studio/api/addproduct

Add a product to the inventory

JSON Body:

  • name (required)
  • description (required)
  • sku (optional)
  • barcode (optional)
  • price (required)
  • cost (optional)
  • quantity (required)

{
        "name": "Product 2",
        "description": "this is a description"
        "sku": "XXXXXXX"
        "barcode": "A182373A"
        "price": "2499"
        "cost": "1999"
        "quantity": "5"

}

Response:

{
        "message": "Product created"
        "id": 10,

}

PATCH floware.studio/api/updateproduct

Update product info

Request Body:

  • id (required)
  • floware.studio/api/updateproduct?id=1

Response:

{
        "id": 1,
        "name": "test product",
        "sku": "test description"
        "barcode": "A182373A"
        "price": "2499"
        "cost": "1999"
        "quantity": "5"
        "created_at": "2024-08-24 22:54:25"
        "updated_at": "2024-08-25 00:00:58"

}

DELETE floware.studio/api/deleteproduct

Returns a specific product or the whole list

Request Body:

  • id (required)
  • floware.studio/api/deleteproduct?id=1

Response:

{
        "message": "Product removed"
        "id": 1,

}