MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

This API is not authenticated.

Endpoints

GET api/test

Example request:
curl --request GET \
    --get "http://localhost/api/test" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/test"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
content-type: text/html; charset=UTF-8
cache-control: no-cache, private
access-control-allow-origin: *
 

PGIMS API working
 

Request      

GET api/test

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Register new user and issue API token.

Registers a new user with the given name, email, and password. Returns the created user data and auth token.

Example request:
curl --request POST \
    "http://localhost/api/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"John Doe\",
    \"email\": \"john@example.com\",
    \"password\": \"password123\",
    \"password_confirmation\": \"password123\"
}"
const url = new URL(
    "http://localhost/api/register"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "John Doe",
    "email": "john@example.com",
    "password": "password123",
    "password_confirmation": "password123"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "user": {
        "id": 1,
        "name": "John Doe",
        "email": "john@example.com",
        "role": "user",
        "created_at": "2025-09-17T14:00:00Z",
        "updated_at": "2025-09-17T14:00:00Z"
    },
    "token": "encrypted_api_token_here"
}
 

Request      

POST api/register

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

User's name. Example: John Doe

email   string   

Unique user email address. Example: john@example.com

password   string   

Password (min 8 chars). Example: password123

password_confirmation   string   

Password confirmation. Example: password123

Login existing user and issue API token.

Authenticates user by email and password. Returns user data and an authentication token.

Example request:
curl --request POST \
    "http://localhost/api/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"john@example.com\",
    \"password\": \"password123\"
}"
const url = new URL(
    "http://localhost/api/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "john@example.com",
    "password": "password123"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "user": {
        "id": 1,
        "name": "John Doe",
        "email": "john@example.com",
        "role": "user",
        "created_at": "2025-09-17T14:00:00Z",
        "updated_at": "2025-09-17T14:00:00Z"
    },
    "token": "encrypted_api_token_here"
}
 

Request      

POST api/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

User email address. Example: john@example.com

password   string   

User password. Example: password123

Logout authenticated user by revoking current access token.

Requires authentication.

Example request:
curl --request POST \
    "http://localhost/api/logout" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/logout"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Logged out successfully"
}
 

Request      

POST api/logout

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/user

Example request:
curl --request GET \
    --get "http://localhost/api/user" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/user"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/user

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Display a listing of users.

Example request:
curl --request GET \
    --get "http://localhost/api/users" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/users"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Jane Doe",
        "email": "jane@example.com",
        "role": "admin",
        "created_at": "2025-09-19T19:29:00Z",
        "updated_at": "2025-09-19T19:29:00Z"
    }
]
 

Request      

GET api/users

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created user.

Example request:
curl --request POST \
    "http://localhost/api/users" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Jane Doe\",
    \"email\": \"jane@example.com\",
    \"password\": \"password123\",
    \"role\": \"admin\",
    \"password_confirmation\": \"password123\"
}"
const url = new URL(
    "http://localhost/api/users"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Jane Doe",
    "email": "jane@example.com",
    "password": "password123",
    "role": "admin",
    "password_confirmation": "password123"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "name": "Jane Doe",
    "email": "jane@example.com",
    "role": "admin",
    "created_at": "2025-09-19T19:29:00Z",
    "updated_at": "2025-09-19T19:29:00Z"
}
 

Request      

POST api/users

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

User's full name. Example: Jane Doe

email   string   

Unique email address. Example: jane@example.com

password   string   

Password, minimum 8 characters, must be confirmed. Example: password123

role   string  optional  

Nullable User role. Example: admin

password_confirmation   string   

Password confirmation. Example: password123

Display the specified user.

Example request:
curl --request GET \
    --get "http://localhost/api/users/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/users/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Jane Doe",
    "email": "jane@example.com",
    "role": "admin",
    "created_at": "2025-09-19T19:29:00Z",
    "updated_at": "2025-09-19T19:29:00Z"
}
 

Request      

GET api/users/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the user. Example: 1

user   integer   

The ID of the user. Example: 17

Update the specified user.

Example request:
curl --request PUT \
    "http://localhost/api/users/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"consequatur\",
    \"email\": \"qkunze@example.com\",
    \"password\": \"O[2UZ5ij-e\\/dl4m{o,\",
    \"role\": \"consequatur\",
    \"password_confirmation\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/users/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "consequatur",
    "email": "qkunze@example.com",
    "password": "O[2UZ5ij-e\/dl4m{o,",
    "role": "consequatur",
    "password_confirmation": "consequatur"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Jane Doe Updated",
    "email": "jane.updated@example.com",
    "role": "user",
    "created_at": "2025-09-19T19:29:00Z",
    "updated_at": "2025-09-19T19:45:00Z"
}
 

Request      

PUT api/users/{id}

PATCH api/users/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the user. Example: 1

user   integer   

The ID of the user. Example: 17

Body Parameters

name   string  optional  

Nullable Updated user name. Example: consequatur

email   string  optional  

Nullable Updated unique email address. Example: qkunze@example.com

password   string  optional  

Nullable Updated password, minimum 8 characters, must be confirmed. Example: O[2UZ5ij-e/dl4m{o,

role   string  optional  

Nullable Updated user role. Example: consequatur

password_confirmation   string  optional  

Nullable Password confirmation. Example: consequatur

Remove the specified user.

Example request:
curl --request DELETE \
    "http://localhost/api/users/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/users/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/users/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the user. Example: 1

user   integer   

The ID of the user. Example: 17

Display a listing of suppliers.

Example request:
curl --request GET \
    --get "http://localhost/api/suppliers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/suppliers"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Supplier A",
        "contact_name": "John Doe",
        "email": "contact@example.com",
        "phone": "123-456-7890",
        "address": "123 Supplier St.",
        "description": "Preferred vendor",
        "created_at": "2025-09-19T18:06:00Z",
        "updated_at": "2025-09-19T18:06:00Z"
    }
]
 

Request      

GET api/suppliers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created supplier.

Example request:
curl --request POST \
    "http://localhost/api/suppliers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Supplier A\",
    \"contact_name\": \"John Doe\",
    \"email\": \"contact@example.com\",
    \"phone\": \"123-456-7890\",
    \"address\": \"consequatur\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\"
}"
const url = new URL(
    "http://localhost/api/suppliers"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Supplier A",
    "contact_name": "John Doe",
    "email": "contact@example.com",
    "phone": "123-456-7890",
    "address": "consequatur",
    "description": "Dolores dolorum amet iste laborum eius est dolor."
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "name": "Supplier A",
    "contact_name": "John Doe",
    "email": "contact@example.com",
    "phone": "123-456-7890",
    "address": "123 Supplier St.",
    "description": "Preferred vendor",
    "created_at": "2025-09-19T18:06:00Z",
    "updated_at": "2025-09-19T18:06:00Z"
}
 

Request      

POST api/suppliers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Supplier name. Example: Supplier A

contact_name   string  optional  

Nullable Contact person's name. Example: John Doe

email   string  optional  

Nullable Unique contact email. Example: contact@example.com

phone   string  optional  

Nullable Contact phone number. Example: 123-456-7890

address   string  optional  

Nullable Supplier address. Example: consequatur

description   string  optional  

Nullable Additional info about the supplier. Example: Dolores dolorum amet iste laborum eius est dolor.

Display the specified supplier.

Example request:
curl --request GET \
    --get "http://localhost/api/suppliers/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/suppliers/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Supplier A",
    "contact_name": "John Doe",
    "email": "contact@example.com",
    "phone": "123-456-7890",
    "address": "123 Supplier St.",
    "description": "Preferred vendor",
    "created_at": "2025-09-19T18:06:00Z",
    "updated_at": "2025-09-19T18:06:00Z"
}
 

Request      

GET api/suppliers/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the supplier. Example: 1

supplier   integer   

The ID of the supplier. Example: 17

Update the specified supplier.

Example request:
curl --request PUT \
    "http://localhost/api/suppliers/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"consequatur\",
    \"contact_name\": \"consequatur\",
    \"email\": \"qkunze@example.com\",
    \"phone\": \"consequatur\",
    \"address\": \"consequatur\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\"
}"
const url = new URL(
    "http://localhost/api/suppliers/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "consequatur",
    "contact_name": "consequatur",
    "email": "qkunze@example.com",
    "phone": "consequatur",
    "address": "consequatur",
    "description": "Dolores dolorum amet iste laborum eius est dolor."
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Supplier A Updated",
    "contact_name": "Jane Smith",
    "email": "contactnew@example.com",
    "phone": "987-654-3210",
    "address": "456 New Supplier St.",
    "description": "Updated vendor info",
    "created_at": "2025-09-19T18:06:00Z",
    "updated_at": "2025-09-19T18:45:00Z"
}
 

Request      

PUT api/suppliers/{id}

PATCH api/suppliers/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the supplier. Example: 1

supplier   integer   

The ID of the supplier. Example: 17

Body Parameters

name   string  optional  

Nullable Updated supplier name. Example: consequatur

contact_name   string  optional  

Nullable Updated contact name. Example: consequatur

email   string  optional  

Nullable Updated email. Example: qkunze@example.com

phone   string  optional  

Nullable Updated phone. Example: consequatur

address   string  optional  

Nullable Updated address. Example: consequatur

description   string  optional  

Nullable Updated description. Example: Dolores dolorum amet iste laborum eius est dolor.

Remove the specified supplier.

Example request:
curl --request DELETE \
    "http://localhost/api/suppliers/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/suppliers/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/suppliers/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the supplier. Example: 1

supplier   integer   

The ID of the supplier. Example: 17

Display a listing of products.

Example request:
curl --request GET \
    --get "http://localhost/api/products" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/products"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "sku": "SKU001",
        "name": "Product A",
        "description": "A sample product.",
        "price": 100,
        "stock": 50,
        "created_at": "2025-09-19T09:35:00Z",
        "updated_at": "2025-09-19T09:35:00Z"
    }
]
 

Request      

GET api/products

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a new product.

Example request:
curl --request POST \
    "http://localhost/api/products" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sku\": \"SKU001\",
    \"name\": \"Product A\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\",
    \"price\": \"100.00\",
    \"stock\": 50
}"
const url = new URL(
    "http://localhost/api/products"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sku": "SKU001",
    "name": "Product A",
    "description": "Dolores dolorum amet iste laborum eius est dolor.",
    "price": "100.00",
    "stock": 50
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "sku": "SKU001",
    "name": "Product A",
    "description": "A sample product.",
    "price": 100,
    "stock": 50,
    "created_at": "2025-09-19T09:35:00Z",
    "updated_at": "2025-09-19T09:35:00Z"
}
 

Request      

POST api/products

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

sku   string  optional  

Nullable product SKU. Example: SKU001

name   string   

Product name. Example: Product A

description   string  optional  

Nullable product description. Example: Dolores dolorum amet iste laborum eius est dolor.

price   numeric   

Product price (min 0). Example: 100.00

stock   integer   

Stock quantity (min 0). Example: 50

Update an existing product.

Example request:
curl --request PUT \
    "http://localhost/api/products/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sku\": \"SKU001\",
    \"name\": \"consequatur\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\",
    \"price\": \"consequatur\",
    \"stock\": 17
}"
const url = new URL(
    "http://localhost/api/products/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sku": "SKU001",
    "name": "consequatur",
    "description": "Dolores dolorum amet iste laborum eius est dolor.",
    "price": "consequatur",
    "stock": 17
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "sku": "SKU001",
    "name": "Product A Updated",
    "description": "Updated description.",
    "price": 120,
    "stock": 30,
    "created_at": "2025-09-19T09:35:00Z",
    "updated_at": "2025-09-19T09:50:00Z"
}
 

Request      

PUT api/products/{id}

PATCH api/products/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the product. Example: 1

Body Parameters

sku   string  optional  

Nullable product SKU. Example: SKU001

name   string  optional  

Nullable product name. Example: consequatur

description   string  optional  

Nullable product description. Example: Dolores dolorum amet iste laborum eius est dolor.

price   numeric  optional  

Nullable product price (min 0). Example: consequatur

stock   integer  optional  

Nullable stock quantity (min 0). Example: 17

Remove the specified product.

Example request:
curl --request DELETE \
    "http://localhost/api/products/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/products/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/products/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the product. Example: 1

product   integer   

The ID of the product. Example: 17

Display a listing of product categories.

Example request:
curl --request GET \
    --get "http://localhost/api/product-categories" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/product-categories"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Beverages",
        "description": "Drinks and refreshments",
        "created_at": "2025-09-19T09:35:00Z",
        "updated_at": "2025-09-19T09:35:00Z"
    }
]
 

Request      

GET api/product-categories

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a new product category.

Example request:
curl --request POST \
    "http://localhost/api/product-categories" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Beverages\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\"
}"
const url = new URL(
    "http://localhost/api/product-categories"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Beverages",
    "description": "Dolores dolorum amet iste laborum eius est dolor."
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "name": "Beverages",
    "description": "Drinks and refreshments",
    "created_at": "2025-09-19T09:35:00Z",
    "updated_at": "2025-09-19T09:35:00Z"
}
 

Request      

POST api/product-categories

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Product category name. Example: Beverages

description   string  optional  

Nullable Product category description. Example: Dolores dolorum amet iste laborum eius est dolor.

Display the specified product category.

Example request:
curl --request GET \
    --get "http://localhost/api/product-categories/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/product-categories/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Beverages",
    "description": "Drinks and refreshments",
    "created_at": "2025-09-19T09:35:00Z",
    "updated_at": "2025-09-19T09:35:00Z"
}
 

Request      

GET api/product-categories/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the product category. Example: 1

productCategory   integer   

The ID of the product category. Example: 17

Update an existing product category.

Example request:
curl --request PUT \
    "http://localhost/api/product-categories/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"consequatur\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\"
}"
const url = new URL(
    "http://localhost/api/product-categories/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "consequatur",
    "description": "Dolores dolorum amet iste laborum eius est dolor."
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Beverages Updated",
    "description": "Updated description",
    "created_at": "2025-09-19T09:35:00Z",
    "updated_at": "2025-09-19T10:00:00Z"
}
 

Request      

PUT api/product-categories/{id}

PATCH api/product-categories/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the product category. Example: 1

Body Parameters

name   string  optional  

Nullable Product category name. Example: consequatur

description   string  optional  

Nullable Product category description. Example: Dolores dolorum amet iste laborum eius est dolor.

Remove the specified product category.

Example request:
curl --request DELETE \
    "http://localhost/api/product-categories/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/product-categories/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/product-categories/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the product category. Example: 1

productCategory   integer   

The ID of the product category. Example: 17

Display a listing of inventory items with related store and product.

Example request:
curl --request GET \
    --get "http://localhost/api/inventory" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/inventory"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
  {
    "id": 1,
    "store_id": 2,
    "product_id": 5,
    "quantity": 100,
    "created_at": "2025-09-19T09:00:00Z",
    "updated_at": "2025-09-19T09:00:00Z",
    "store": {
      "id": 2,
      "name": "Main Store",
      // other store fields
    },
    "product": {
      "id": 5,
      "name": "Product A",
      // other product fields
    }
  }
]
 

Request      

GET api/inventory

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created inventory record.

Example request:
curl --request POST \
    "http://localhost/api/inventory" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"store_id\": 2,
    \"product_id\": 5,
    \"quantity\": 100
}"
const url = new URL(
    "http://localhost/api/inventory"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "store_id": 2,
    "product_id": 5,
    "quantity": 100
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "store_id": 2,
    "product_id": 5,
    "quantity": 100,
    "created_at": "2025-09-19T09:00:00Z",
    "updated_at": "2025-09-19T09:00:00Z"
}
 

Request      

POST api/inventory

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

store_id   integer   

Store ID reference. Example: 2

product_id   integer   

Product ID reference. Example: 5

quantity   integer   

Quantity in stock (min 0). Example: 100

Display the specified inventory record with related store and product.

Example request:
curl --request GET \
    --get "http://localhost/api/inventory/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/inventory/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "store_id": 2,
    "product_id": 5,
    "quantity": 100,
    "created_at": "2025-09-19T09:00:00Z",
    "updated_at": "2025-09-19T09:00:00Z",
    "store": {
        "id": 2,
        "name": "Main Store"
    },
    "product": {
        "id": 5,
        "name": "Product A"
    }
}
 

Request      

GET api/inventory/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the inventory. Example: 1

inventory   integer   

Inventory record ID. Example: 17

Update the specified inventory record.

Example request:
curl --request PUT \
    "http://localhost/api/inventory/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"store_id\": 17,
    \"product_id\": 17,
    \"quantity\": 17
}"
const url = new URL(
    "http://localhost/api/inventory/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "store_id": 17,
    "product_id": 17,
    "quantity": 17
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "store_id": 2,
    "product_id": 5,
    "quantity": 150,
    "created_at": "2025-09-19T09:00:00Z",
    "updated_at": "2025-09-19T10:00:00Z"
}
 

Request      

PUT api/inventory/{id}

PATCH api/inventory/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the inventory. Example: 1

inventory   integer   

Inventory record ID. Example: 17

Body Parameters

store_id   integer  optional  

Nullable Store ID. Example: 17

product_id   integer  optional  

Nullable Product ID. Example: 17

quantity   integer  optional  

Nullable Quantity in stock (min 0). Example: 17

Remove the specified inventory record.

Example request:
curl --request DELETE \
    "http://localhost/api/inventory/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/inventory/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/inventory/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the inventory. Example: 1

inventory   integer   

Inventory record ID. Example: 17

Display a listing of orders with related items and customer.

Example request:
curl --request GET \
    --get "http://localhost/api/orders" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/orders"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "customer_id": 1,
        "total_amount": 250,
        "status": "completed",
        "created_at": "2025-09-19T09:00:00Z",
        "updated_at": "2025-09-19T09:00:00Z",
        "items": [
            {
                "product_id": 5,
                "quantity": 2,
                "unit_price": 50,
                "line_total": 100,
                "product": {
                    "id": 5,
                    "name": "Product A"
                }
            }
        ],
        "customer": {
            "id": 1,
            "name": "Jane Doe"
        }
    }
]
 

Request      

GET api/orders

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a new order including order items and stock adjustments.

Example request:
curl --request POST \
    "http://localhost/api/orders" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer_id\": 1,
    \"items\": [
        \"consequatur\"
    ],
    \"payment_method\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/orders"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer_id": 1,
    "items": [
        "consequatur"
    ],
    "payment_method": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
  "id": 1,
  "customer_id": 1,
  "payment_method": "credit_card",
  "total_amount": 250.00,
  "status": "completed",
  "created_at": "2025-09-19T09:00:00Z",
  "updated_at": "2025-09-19T09:00:00Z",
  "items": [...],
  "customer": {...}
}
 

Request      

POST api/orders

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

customer_id   integer  optional  

Nullable ID of the customer placing the order. Example: 1

items   string[]   

Array of order items.

product_id   string   

The id of an existing record in the products table. Example: consequatur

quantity   integer   

Must be at least 1. Example: 45

*   object  optional  
product_id   integer   

Product ID. Example: 5

quantity   integer   

Quantity ordered. Minimum 1. Example: 2

payment_method   string   

Example: consequatur

Display the specified order with items and customer.

Example request:
curl --request GET \
    --get "http://localhost/api/orders/2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/orders/2"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "customer_id": 1,
    "total_amount": 250,
    "status": "completed",
    "created_at": "2025-09-19T09:00:00Z",
    "updated_at": "2025-09-19T09:00:00Z",
    "items": [
        {
            "product_id": 5,
            "quantity": 2,
            "unit_price": 50,
            "line_total": 100,
            "product": {
                "id": 5,
                "name": "Product A"
            }
        }
    ],
    "customer": {
        "id": 1,
        "name": "Jane Doe"
    }
}
 

Request      

GET api/orders/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the order. Example: 2

order   integer   

The ID of the order. Example: 17

Update the specified order and manage items and stock.

Example request:
curl --request PUT \
    "http://localhost/api/orders/2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer_id\": 17,
    \"status\": \"consequatur\",
    \"notes\": \"consequatur\",
    \"items\": [
        \"consequatur\"
    ]
}"
const url = new URL(
    "http://localhost/api/orders/2"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer_id": 17,
    "status": "consequatur",
    "notes": "consequatur",
    "items": [
        "consequatur"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
  "id": 1,
  "customer_id": 1,
  "total_amount": 300.00,
  "status": "completed",
  "notes": "Updated notes",
  "created_at": "2025-09-19T09:00:00Z",
  "updated_at": "2025-09-19T10:00:00Z",
  "items": [...],
  "customer": {...}
}
 

Request      

PUT api/orders/{id}

PATCH api/orders/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the order. Example: 2

order   integer   

The ID of the order. Example: 17

Body Parameters

customer_id   integer  optional  

Nullable Updated customer ID. Example: 17

status   string  optional  

Nullable Updated order status. One of: pending, processing, completed, cancelled. Example: consequatur

notes   string  optional  

Nullable Additional notes. Example: consequatur

items   string[]  optional  

Nullable Updated list of order items.

product_id   string  optional  

This field is required when items is present. The id of an existing record in the products table.

quantity   integer  optional  

This field is required when items is present. Must be at least 1. Example: 45

*   object  optional  
product_id   integer  optional  

required_with:items Product ID. Example: 17

quantity   integer  optional  

required_with:items Quantity ordered. Example: 17

Remove the specified order and restore stock quantities.

Example request:
curl --request DELETE \
    "http://localhost/api/orders/2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/orders/2"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/orders/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the order. Example: 2

order   integer   

The ID of the order. Example: 17

Display a listing of order items with related products and orders.

Example request:
curl --request GET \
    --get "http://localhost/api/order-items" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/order-items"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "order_id": 10,
        "product_id": 5,
        "quantity": 3,
        "unit_price": 50,
        "line_total": 150,
        "created_at": "2025-09-19T09:30:00Z",
        "updated_at": "2025-09-19T09:30:00Z",
        "product": {
            "id": 5,
            "name": "Product A"
        },
        "order": {
            "id": 10,
            "customer_id": 1,
            "total_amount": 500,
            "status": "completed"
        }
    }
]
 

Request      

GET api/order-items

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a new order item.

Example request:
curl --request POST \
    "http://localhost/api/order-items" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"order_id\": 10,
    \"product_id\": 5,
    \"quantity\": 3,
    \"unit_price\": \"50.00\",
    \"line_total\": \"150.00\"
}"
const url = new URL(
    "http://localhost/api/order-items"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "order_id": 10,
    "product_id": 5,
    "quantity": 3,
    "unit_price": "50.00",
    "line_total": "150.00"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "order_id": 10,
    "product_id": 5,
    "quantity": 3,
    "unit_price": 50,
    "line_total": 150,
    "created_at": "2025-09-19T09:30:00Z",
    "updated_at": "2025-09-19T09:30:00Z"
}
 

Request      

POST api/order-items

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

order_id   integer   

ID of the order. Example: 10

product_id   integer   

ID of the product. Example: 5

quantity   integer   

Quantity ordered. Minimum 1. Example: 3

unit_price   numeric   

Unit price of the product. Example: 50.00

line_total   numeric   

Total line amount. Example: 150.00

Display the specified order item with product and order.

Example request:
curl --request GET \
    --get "http://localhost/api/order-items/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/order-items/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "order_id": 10,
    "product_id": 5,
    "quantity": 3,
    "unit_price": 50,
    "line_total": 150,
    "created_at": "2025-09-19T09:30:00Z",
    "updated_at": "2025-09-19T09:30:00Z",
    "product": {
        "id": 5,
        "name": "Product A"
    },
    "order": {
        "id": 10,
        "customer_id": 1,
        "total_amount": 500,
        "status": "completed"
    }
}
 

Request      

GET api/order-items/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the order item. Example: 1

orderItem   integer   

The ID of the order item. Example: 17

Update an existing order item.

Example request:
curl --request PUT \
    "http://localhost/api/order-items/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"order_id\": 17,
    \"product_id\": 17,
    \"quantity\": 17,
    \"unit_price\": \"consequatur\",
    \"line_total\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/order-items/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "order_id": 17,
    "product_id": 17,
    "quantity": 17,
    "unit_price": "consequatur",
    "line_total": "consequatur"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "order_id": 10,
    "product_id": 5,
    "quantity": 4,
    "unit_price": 45,
    "line_total": 180,
    "created_at": "2025-09-19T09:30:00Z",
    "updated_at": "2025-09-19T10:00:00Z"
}
 

Request      

PUT api/order-items/{id}

PATCH api/order-items/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the order item. Example: 1

orderItem   integer   

The ID of the order item. Example: 17

Body Parameters

order_id   integer  optional  

Nullable Updated order ID. Example: 17

product_id   integer  optional  

Nullable Updated product ID. Example: 17

quantity   integer  optional  

Nullable Updated quantity. Example: 17

unit_price   numeric  optional  

Nullable Updated unit price. Example: consequatur

line_total   numeric  optional  

Nullable Updated line total. Example: consequatur

Delete the specified order item.

Example request:
curl --request DELETE \
    "http://localhost/api/order-items/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/order-items/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/order-items/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the order item. Example: 1

orderItem   integer   

The ID of the order item. Example: 17

Display a listing of purchase orders with associated supplier.

Example request:
curl --request GET \
    --get "http://localhost/api/purchase-orders" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/purchase-orders"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "supplier_id": 3,
        "order_number": "PO-12345",
        "status": "pending",
        "total_amount": 1000,
        "order_date": "2025-09-20",
        "expected_date": "2025-09-30",
        "notes": "Urgent order",
        "created_at": "2025-09-19T16:40:00Z",
        "updated_at": "2025-09-19T16:40:00Z",
        "supplier": {
            "id": 3,
            "name": "Supplier Name"
        }
    }
]
 

Request      

GET api/purchase-orders

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created purchase order.

Example request:
curl --request POST \
    "http://localhost/api/purchase-orders" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"supplier_id\": 3,
    \"order_number\": \"PO-12345\",
    \"status\": \"consequatur\",
    \"payment_method\": \"consequatur\",
    \"total_amount\": \"1000.00\",
    \"order_date\": \"2025-09-20\",
    \"expected_date\": \"2025-09-30\",
    \"notes\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/purchase-orders"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "supplier_id": 3,
    "order_number": "PO-12345",
    "status": "consequatur",
    "payment_method": "consequatur",
    "total_amount": "1000.00",
    "order_date": "2025-09-20",
    "expected_date": "2025-09-30",
    "notes": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "supplier_id": 3,
    "order_number": "PO-12345",
    "status": "pending",
    "payment_method": "cash",
    "total_amount": 1000,
    "order_date": "2025-09-20",
    "expected_date": "2025-09-30",
    "notes": "Urgent order",
    "created_at": "2025-09-19T16:40:00Z",
    "updated_at": "2025-09-19T16:40:00Z"
}
 

Request      

POST api/purchase-orders

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

supplier_id   integer   

Supplier ID. Example: 3

order_number   string   

Unique order number. Example: PO-12345

status   string  optional  

Nullable Order status. One of: pending, approved, received, cancelled. Example: consequatur

payment_method   string   

Example: consequatur

total_amount   numeric  optional  

Nullable Total amount. Example: 1000.00

order_date   date  optional  

Nullable Order date. Example: 2025-09-20

expected_date   date  optional  

Nullable Expected delivery date. Example: 2025-09-30

notes   string  optional  

Nullable Additional notes. Example: consequatur

Display the specified purchase order with supplier details.

Example request:
curl --request GET \
    --get "http://localhost/api/purchase-orders/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/purchase-orders/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "supplier_id": 3,
    "order_number": "PO-12345",
    "status": "pending",
    "total_amount": 1000,
    "order_date": "2025-09-20",
    "expected_date": "2025-09-30",
    "notes": "Urgent order",
    "created_at": "2025-09-19T16:40:00Z",
    "updated_at": "2025-09-19T16:40:00Z",
    "supplier": {
        "id": 3,
        "name": "Supplier Name"
    }
}
 

Request      

GET api/purchase-orders/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the purchase order. Example: 1

purchaseOrder   integer   

The ID of the purchase order. Example: 17

Update the specified purchase order.

Example request:
curl --request PUT \
    "http://localhost/api/purchase-orders/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"supplier_id\": 17,
    \"order_number\": \"consequatur\",
    \"status\": \"consequatur\",
    \"total_amount\": \"consequatur\",
    \"order_date\": \"consequatur\",
    \"expected_date\": \"consequatur\",
    \"notes\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/purchase-orders/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "supplier_id": 17,
    "order_number": "consequatur",
    "status": "consequatur",
    "total_amount": "consequatur",
    "order_date": "consequatur",
    "expected_date": "consequatur",
    "notes": "consequatur"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "supplier_id": 3,
    "order_number": "PO-12346",
    "status": "approved",
    "total_amount": 1100,
    "order_date": "2025-09-20",
    "expected_date": "2025-10-01",
    "notes": "Approved order",
    "created_at": "2025-09-19T16:40:00Z",
    "updated_at": "2025-09-19T17:00:00Z"
}
 

Request      

PUT api/purchase-orders/{id}

PATCH api/purchase-orders/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the purchase order. Example: 1

purchaseOrder   integer   

The ID of the purchase order. Example: 17

Body Parameters

supplier_id   integer  optional  

Nullable Supplier ID. Example: 17

order_number   string  optional  

Nullable Unique order number. Example: consequatur

status   string  optional  

Nullable Order status. Example: consequatur

total_amount   numeric  optional  

Nullable Total amount. Example: consequatur

order_date   date  optional  

Nullable Order date. Example: consequatur

expected_date   date  optional  

Nullable Expected delivery date. Example: consequatur

notes   string  optional  

Nullable Additional notes. Example: consequatur

Remove the specified purchase order.

Example request:
curl --request DELETE \
    "http://localhost/api/purchase-orders/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/purchase-orders/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/purchase-orders/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the purchase order. Example: 1

purchaseOrder   integer   

The ID of the purchase order. Example: 17

Display a listing of stock requisitions with related stores, approver, and items.

Example request:
curl --request GET \
    --get "http://localhost/api/stock-requisitions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/stock-requisitions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
  {
    "id": 1,
    "from_store_id": 2,
    "to_store_id": 3,
    "status": "pending",
    "approved_by": 5,
    "created_at": "2025-09-19T16:44:00Z",
    "updated_at": "2025-09-19T16:44:00Z",
    "fromStore": { "id": 2, "name": "Store A" },
    "toStore": { "id": 3, "name": "Store B" },
    "approvedBy": { "id": 5, "name": "Manager" },
    "items": [
      / Array of requisition items /
    ]
  }
]
 

Request      

GET api/stock-requisitions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created stock requisition.

Example request:
curl --request POST \
    "http://localhost/api/stock-requisitions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"from_store_id\": 17,
    \"to_store_id\": 17,
    \"status\": \"pending\",
    \"approved_by\": 17
}"
const url = new URL(
    "http://localhost/api/stock-requisitions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "from_store_id": 17,
    "to_store_id": 17,
    "status": "pending",
    "approved_by": 17
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "from_store_id": 2,
    "to_store_id": 3,
    "status": "pending",
    "approved_by": 5,
    "created_at": "2025-09-19T16:44:00Z",
    "updated_at": "2025-09-19T16:44:00Z"
}
 

Request      

POST api/stock-requisitions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

from_store_id   integer   

ID of the source store. Example: 17

to_store_id   integer   

ID of the destination store (different from from_store_id). Example: 17

status   string   

Status of the requisition. Example: pending

approved_by   integer  optional  

Nullable User ID who approved the requisition. Example: 17

Display a specific stock requisition with details.

Example request:
curl --request GET \
    --get "http://localhost/api/stock-requisitions/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/stock-requisitions/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "id": 1,
  "from_store_id": 2,
  "to_store_id": 3,
  "status": "pending",
  "approved_by": 5,
  "created_at": "2025-09-19T16:44:00Z",
  "updated_at": "2025-09-19T16:44:00Z",
  "fromStore": { "id": 2, "name": "Store A" },
  "toStore": { "id": 3, "name": "Store B" },
  "approvedBy": { "id": 5, "name": "Manager" },
  "items": [
    / Array of requisition items /
  ]
}
 

Request      

GET api/stock-requisitions/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the stock requisition. Example: 17

stockRequisition   integer   

The ID of the stock requisition. Example: 17

Update the specified stock requisition.

Example request:
curl --request PUT \
    "http://localhost/api/stock-requisitions/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"from_store_id\": 17,
    \"to_store_id\": 17,
    \"status\": \"consequatur\",
    \"approved_by\": 17
}"
const url = new URL(
    "http://localhost/api/stock-requisitions/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "from_store_id": 17,
    "to_store_id": 17,
    "status": "consequatur",
    "approved_by": 17
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "from_store_id": 2,
    "to_store_id": 3,
    "status": "approved",
    "approved_by": 5,
    "created_at": "2025-09-19T16:44:00Z",
    "updated_at": "2025-09-19T17:00:00Z"
}
 

Request      

PUT api/stock-requisitions/{id}

PATCH api/stock-requisitions/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the stock requisition. Example: 17

stockRequisition   integer   

The ID of the stock requisition. Example: 17

Body Parameters

from_store_id   integer  optional  

Nullable ID of the source store. Example: 17

to_store_id   integer  optional  

Nullable ID of the destination store (must be different from from_store_id). Example: 17

status   string  optional  

Nullable Status of the requisition. Example: consequatur

approved_by   integer  optional  

Nullable User ID who approved the requisition. Example: 17

Remove the specified stock requisition.

Example request:
curl --request DELETE \
    "http://localhost/api/stock-requisitions/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/stock-requisitions/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/stock-requisitions/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the stock requisition. Example: 17

stockRequisition   integer   

The ID of the stock requisition. Example: 17

Display a listing of stock requisition items with related stock requisition and product.

Example request:
curl --request GET \
    --get "http://localhost/api/stock-requisition-items" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/stock-requisition-items"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
  {
    "id": 1,
    "stock_requisition_id": 2,
    "product_id": 5,
    "quantity": 10,
    "created_at": "2025-09-19T17:00:00Z",
    "updated_at": "2025-09-19T17:00:00Z",
    "stockRequisition": {
      "id": 2,
      "status": "pending",
      // other stock requisition fields
    },
    "product": {
      "id": 5,
      "name": "Product A"
    }
  }
]
 

Request      

GET api/stock-requisition-items

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created stock requisition item.

Example request:
curl --request POST \
    "http://localhost/api/stock-requisition-items" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"stock_requisition_id\": 2,
    \"product_id\": 5,
    \"quantity\": 10
}"
const url = new URL(
    "http://localhost/api/stock-requisition-items"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "stock_requisition_id": 2,
    "product_id": 5,
    "quantity": 10
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "stock_requisition_id": 2,
    "product_id": 5,
    "quantity": 10,
    "created_at": "2025-09-19T17:00:00Z",
    "updated_at": "2025-09-19T17:00:00Z"
}
 

Request      

POST api/stock-requisition-items

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

stock_requisition_id   integer   

ID of the stock requisition. Example: 2

product_id   integer   

ID of the product. Example: 5

quantity   integer   

Quantity requested. Minimum 1. Example: 10

Display the specified stock requisition item with related data.

Example request:
curl --request GET \
    --get "http://localhost/api/stock-requisition-items/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/stock-requisition-items/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "stock_requisition_id": 2,
    "product_id": 5,
    "quantity": 10,
    "created_at": "2025-09-19T17:00:00Z",
    "updated_at": "2025-09-19T17:00:00Z",
    "stockRequisition": {
        "id": 2,
        "status": "pending"
    },
    "product": {
        "id": 5,
        "name": "Product A"
    }
}
 

Request      

GET api/stock-requisition-items/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the stock requisition item. Example: 17

stockRequisitionItem   integer   

The ID of the stock requisition item. Example: 17

Update the specified stock requisition item.

Example request:
curl --request PUT \
    "http://localhost/api/stock-requisition-items/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"stock_requisition_id\": 17,
    \"product_id\": 17,
    \"quantity\": 17
}"
const url = new URL(
    "http://localhost/api/stock-requisition-items/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "stock_requisition_id": 17,
    "product_id": 17,
    "quantity": 17
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "stock_requisition_id": 2,
    "product_id": 5,
    "quantity": 15,
    "created_at": "2025-09-19T17:00:00Z",
    "updated_at": "2025-09-19T18:00:00Z"
}
 

Request      

PUT api/stock-requisition-items/{id}

PATCH api/stock-requisition-items/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the stock requisition item. Example: 17

stockRequisitionItem   integer   

The ID of the stock requisition item. Example: 17

Body Parameters

stock_requisition_id   integer  optional  

Nullable ID of the stock requisition. Example: 17

product_id   integer  optional  

Nullable ID of the product. Example: 17

quantity   integer  optional  

Nullable Updated quantity. Example: 17

Remove the specified stock requisition item.

Example request:
curl --request DELETE \
    "http://localhost/api/stock-requisition-items/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/stock-requisition-items/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/stock-requisition-items/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the stock requisition item. Example: 17

stockRequisitionItem   integer   

The ID of the stock requisition item. Example: 17

Display a listing of stores.

Example request:
curl --request GET \
    --get "http://localhost/api/stores" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/stores"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Main Store",
        "address": "123 Main Street",
        "phone": "123-456-7890",
        "created_at": "2025-09-19T17:03:00Z",
        "updated_at": "2025-09-19T17:03:00Z"
    }
]
 

Request      

GET api/stores

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a newly created store.

Example request:
curl --request POST \
    "http://localhost/api/stores" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Main Store\",
    \"address\": \"123 Main Street\",
    \"phone\": \"123-456-7890\"
}"
const url = new URL(
    "http://localhost/api/stores"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Main Store",
    "address": "123 Main Street",
    "phone": "123-456-7890"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "name": "Main Store",
    "address": "123 Main Street",
    "phone": "123-456-7890",
    "created_at": "2025-09-19T17:03:00Z",
    "updated_at": "2025-09-19T17:03:00Z"
}
 

Request      

POST api/stores

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Name of the store. Example: Main Store

address   string  optional  

Nullable Store address. Example: 123 Main Street

phone   string  optional  

Nullable Store phone number. Example: 123-456-7890

Display the specified store.

Example request:
curl --request GET \
    --get "http://localhost/api/stores/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/stores/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Main Store",
    "address": "123 Main Street",
    "phone": "123-456-7890",
    "created_at": "2025-09-19T17:03:00Z",
    "updated_at": "2025-09-19T17:03:00Z"
}
 

Request      

GET api/stores/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the store. Example: 1

store   integer   

The ID of the store. Example: 17

Update the specified store.

Example request:
curl --request PUT \
    "http://localhost/api/stores/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"consequatur\",
    \"address\": \"consequatur\",
    \"phone\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/stores/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "consequatur",
    "address": "consequatur",
    "phone": "consequatur"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Updated Store",
    "address": "456 New Street",
    "phone": "987-654-3210",
    "created_at": "2025-09-19T17:03:00Z",
    "updated_at": "2025-09-19T17:15:00Z"
}
 

Request      

PUT api/stores/{id}

PATCH api/stores/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the store. Example: 1

store   integer   

The ID of the store. Example: 17

Body Parameters

name   string  optional  

Nullable Updated name. Example: consequatur

address   string  optional  

Nullable Updated address. Example: consequatur

phone   string  optional  

Nullable Updated phone. Example: consequatur

Remove the specified store.

Example request:
curl --request DELETE \
    "http://localhost/api/stores/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/stores/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/stores/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the store. Example: 1

store   integer   

The ID of the store. Example: 17

Get daily sales summary report.

Example request:
curl --request GET \
    --get "http://localhost/api/reports/daily-sales?date=consequatur&store_id[]=17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date\": \"2025-10-20T17:16:12\",
    \"store_id\": [
        17
    ]
}"
const url = new URL(
    "http://localhost/api/reports/daily-sales"
);

const params = {
    "date": "consequatur",
    "store_id[0]": "17",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "date": "2025-10-20T17:16:12",
    "store_id": [
        17
    ]
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "date": "2025-09-17",
    "total_orders": 100,
    "total_sales": 50000.45
}
 

Request      

GET api/reports/daily-sales

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

date   string  optional  

Date to get sales for (Y-m-d format). Defaults to today. Example: consequatur

store_id   integer[]  optional  

Optional array of store IDs to filter by.

Body Parameters

date   string  optional  

Must be a valid date. Example: 2025-10-20T17:16:12

store_id   integer[]  optional  

The id of an existing record in the stores table.

Get payment breakdown by payment method over a date range.

Example request:
curl --request GET \
    --get "http://localhost/api/reports/payment-breakdown?start=consequatur&end=consequatur&store_id[]=17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"start\": \"2025-10-20T17:16:12\",
    \"end\": \"2106-11-19\",
    \"store_id\": [
        17
    ]
}"
const url = new URL(
    "http://localhost/api/reports/payment-breakdown"
);

const params = {
    "start": "consequatur",
    "end": "consequatur",
    "store_id[0]": "17",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "start": "2025-10-20T17:16:12",
    "end": "2106-11-19",
    "store_id": [
        17
    ]
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "start_date": "2025-08-17",
    "end_date": "2025-09-17",
    "payment_methods": [
        {
            "payment_method": "cash",
            "total": 20000
        },
        {
            "payment_method": "card",
            "total": 30000
        }
    ]
}
 

Request      

GET api/reports/payment-breakdown

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

start   string  optional  

Start date (Y-m-d). Defaults to one month ago. Example: consequatur

end   string  optional  

End date (Y-m-d). Defaults to today. Example: consequatur

store_id   integer[]  optional  

Optional array of store IDs to filter by.

Body Parameters

start   string  optional  

Must be a valid date. Example: 2025-10-20T17:16:12

end   string  optional  

Must be a valid date. Must be a date after or equal to start. Example: 2106-11-19

store_id   integer[]  optional  

The id of an existing record in the stores table.

Generate profit report for a date range.

Example request:
curl --request GET \
    --get "http://localhost/api/reports/profit?start=consequatur&end=consequatur&store_id[]=17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"start\": \"2025-10-20T17:16:12\",
    \"end\": \"2106-11-19\",
    \"store_id\": [
        17
    ]
}"
const url = new URL(
    "http://localhost/api/reports/profit"
);

const params = {
    "start": "consequatur",
    "end": "consequatur",
    "store_id[0]": "17",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "start": "2025-10-20T17:16:12",
    "end": "2106-11-19",
    "store_id": [
        17
    ]
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "start_date": "2025-08-17",
    "end_date": "2025-09-17",
    "profit": 15000.5
}
 

Request      

GET api/reports/profit

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

start   string  optional  

Start date (Y-m-d). Defaults to one month ago. Example: consequatur

end   string  optional  

End date (Y-m-d). Defaults to today. Example: consequatur

store_id   integer[]  optional  

Optional array of store IDs to filter by.

Body Parameters

start   string  optional  

Must be a valid date. Example: 2025-10-20T17:16:12

end   string  optional  

Must be a valid date. Must be a date after or equal to start. Example: 2106-11-19

store_id   integer[]  optional  

The id of an existing record in the stores table.

Get inventory stock status by product and store.

Example request:
curl --request GET \
    --get "http://localhost/api/reports/inventory-status?store_id=17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"store_id\": 17
}"
const url = new URL(
    "http://localhost/api/reports/inventory-status"
);

const params = {
    "store_id": "17",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "store_id": 17
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Product A",
        "quantity": 100,
        "store_id": 2
    },
    {
        "id": 2,
        "name": "Product B",
        "quantity": 50,
        "store_id": 2
    }
]
 

Request      

GET api/reports/inventory-status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

store_id   integer  optional  

Optional store ID to filter by. Example: 17

Body Parameters

store_id   integer  optional  

The id of an existing record in the stores table. Example: 17

Get customer credit and balance report.

Example request:
curl --request GET \
    --get "http://localhost/api/reports/customer-credit?customer_id=17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer_id\": 17
}"
const url = new URL(
    "http://localhost/api/reports/customer-credit"
);

const params = {
    "customer_id": "17",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer_id": 17
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "John Doe",
        "balance": 1200,
        "credit_limit": 5000
    }
]
 

Request      

GET api/reports/customer-credit

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

customer_id   integer  optional  

Optional customer ID to filter by. Example: 17

Body Parameters

customer_id   integer  optional  

The id of an existing record in the customers table. Example: 17

Generate expense report for a date range.

Example request:
curl --request GET \
    --get "http://localhost/api/reports/expense?start=consequatur&end=consequatur&store_id[]=17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"start\": \"2025-10-20T17:16:12\",
    \"end\": \"2106-11-19\",
    \"store_id\": [
        17
    ]
}"
const url = new URL(
    "http://localhost/api/reports/expense"
);

const params = {
    "start": "consequatur",
    "end": "consequatur",
    "store_id[0]": "17",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "start": "2025-10-20T17:16:12",
    "end": "2106-11-19",
    "store_id": [
        17
    ]
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "start_date": "2025-08-17",
    "end_date": "2025-09-17",
    "total_expenses": 8000
}
 

Request      

GET api/reports/expense

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

start   string  optional  

Start date (Y-m-d). Defaults to one month ago. Example: consequatur

end   string  optional  

End date (Y-m-d). Defaults to today. Example: consequatur

store_id   integer[]  optional  

Optional array of store IDs to filter by.

Body Parameters

start   string  optional  

Must be a valid date. Example: 2025-10-20T17:16:12

end   string  optional  

Must be a valid date. Must be a date after or equal to start. Example: 2106-11-19

store_id   integer[]  optional  

The id of an existing record in the stores table.

Display a listing of customers.

Example request:
curl --request GET \
    --get "http://localhost/api/customers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/customers"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Jane Doe",
        "gender": "female",
        "phone": "1234567890",
        "email": "jane@example.com",
        "address": "123 Main St",
        "birthday": "1990-05-10",
        "balance": 2000,
        "credit_limit": 5000,
        "notes": "Loyal customer",
        "created_at": "2025-09-17T12:00:00Z",
        "updated_at": "2025-09-17T12:00:00Z"
    }
]
 

Request      

GET api/customers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a new customer.

Example request:
curl --request POST \
    "http://localhost/api/customers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Jane Doe\",
    \"gender\": \"female\",
    \"phone\": \"1234567890\",
    \"email\": \"jane@example.com\",
    \"address\": \"consequatur\",
    \"birthday\": \"1990-05-10\",
    \"balance\": \"2000.00\",
    \"credit_limit\": \"5000.00\",
    \"notes\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/customers"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Jane Doe",
    "gender": "female",
    "phone": "1234567890",
    "email": "jane@example.com",
    "address": "consequatur",
    "birthday": "1990-05-10",
    "balance": "2000.00",
    "credit_limit": "5000.00",
    "notes": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "name": "Jane Doe",
    "gender": "female",
    "phone": "1234567890",
    "email": "jane@example.com",
    "address": "123 Main St",
    "birthday": "1990-05-10",
    "balance": 2000,
    "credit_limit": 5000,
    "notes": "Loyal customer",
    "created_at": "2025-09-17T12:00:00Z",
    "updated_at": "2025-09-17T12:00:00Z"
}
 

Request      

POST api/customers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Customer's name. Example: Jane Doe

gender   string  optional  

Nullable gender. Example: female

phone   string  optional  

Nullable phone number. Example: 1234567890

email   string  optional  

Nullable unique email. Example: jane@example.com

address   string  optional  

Nullable address. Example: consequatur

birthday   date  optional  

Nullable date of birth. Example: 1990-05-10

balance   numeric  optional  

Nullable initial balance. Example: 2000.00

credit_limit   numeric  optional  

Nullable credit limit. Example: 5000.00

notes   string  optional  

Nullable additional notes. Example: consequatur

Display the specified customer.

Example request:
curl --request GET \
    --get "http://localhost/api/customers/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/customers/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Jane Doe",
    "gender": "female",
    "phone": "1234567890",
    "email": "jane@example.com",
    "address": "123 Main St",
    "birthday": "1990-05-10",
    "balance": 2000,
    "credit_limit": 5000,
    "notes": "Loyal customer",
    "created_at": "2025-09-17T12:00:00Z",
    "updated_at": "2025-09-17T12:00:00Z"
}
 

Request      

GET api/customers/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the customer. Example: 1

customer   integer   

The ID of the customer. Example: 17

Update the specified customer.

Example request:
curl --request PUT \
    "http://localhost/api/customers/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"consequatur\",
    \"gender\": \"consequatur\",
    \"phone\": \"consequatur\",
    \"email\": \"qkunze@example.com\",
    \"address\": \"consequatur\",
    \"birthday\": \"consequatur\",
    \"balance\": \"consequatur\",
    \"credit_limit\": \"consequatur\",
    \"notes\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/customers/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "consequatur",
    "gender": "consequatur",
    "phone": "consequatur",
    "email": "qkunze@example.com",
    "address": "consequatur",
    "birthday": "consequatur",
    "balance": "consequatur",
    "credit_limit": "consequatur",
    "notes": "consequatur"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Jane Doe Updated",
    "gender": "female",
    "phone": "0987654321",
    "email": "janeupdated@example.com",
    "address": "456 Another St",
    "birthday": "1990-05-10",
    "balance": 2500,
    "credit_limit": 5500,
    "notes": "Updated notes",
    "created_at": "2025-09-17T12:00:00Z",
    "updated_at": "2025-09-18T15:00:00Z"
}
 

Request      

PUT api/customers/{id}

PATCH api/customers/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the customer. Example: 1

customer   integer   

The ID of the customer. Example: 17

Body Parameters

name   string  optional  

Nullable updated name. Example: consequatur

gender   string  optional  

Nullable updated gender. Example: consequatur

phone   string  optional  

Nullable updated phone. Example: consequatur

email   string  optional  

Nullable updated email. Example: qkunze@example.com

address   string  optional  

Nullable updated address. Example: consequatur

birthday   date  optional  

Nullable updated birthday. Example: consequatur

balance   numeric  optional  

Nullable updated balance. Example: consequatur

credit_limit   numeric  optional  

Nullable updated credit limit. Example: consequatur

notes   string  optional  

Nullable updated notes. Example: consequatur

Remove the specified customer.

Example request:
curl --request DELETE \
    "http://localhost/api/customers/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/customers/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/customers/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the customer. Example: 1

customer   integer   

The ID of the customer. Example: 17

Display a listing of transactions with related bank accounts.

Example request:
curl --request GET \
    --get "http://localhost/api/transactions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/transactions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "bank_account_id": 2,
        "type": "credit",
        "amount": 1000,
        "reference": "INV-12345",
        "description": "Payment received",
        "transaction_date": "2025-09-19",
        "created_at": "2025-09-19T19:00:00Z",
        "updated_at": "2025-09-19T19:00:00Z",
        "bankAccount": {
            "id": 2,
            "bank_name": "First Bank",
            "account_number": "1234567890"
        }
    }
]
 

Request      

GET api/transactions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a new transaction inside a database transaction block.

Example request:
curl --request POST \
    "http://localhost/api/transactions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bank_account_id\": 2,
    \"type\": \"credit\",
    \"amount\": \"1000.00\",
    \"reference\": \"consequatur\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\",
    \"transaction_date\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/transactions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "bank_account_id": 2,
    "type": "credit",
    "amount": "1000.00",
    "reference": "consequatur",
    "description": "Dolores dolorum amet iste laborum eius est dolor.",
    "transaction_date": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 10,
    "bank_account_id": 2,
    "type": "credit",
    "amount": 1000,
    "reference": "INV-12345",
    "description": "Payment received",
    "transaction_date": "2025-09-19",
    "created_at": "2025-09-19T19:05:00Z",
    "updated_at": "2025-09-19T19:05:00Z"
}
 

Request      

POST api/transactions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

bank_account_id   integer   

Related bank account ID. Example: 2

type   string   

Transaction type: credit or debit. Example: credit

amount   numeric   

Transaction amount. Minimum 0. Example: 1000.00

reference   string  optional  

Nullable Transaction reference or invoice ID. Example: consequatur

description   string  optional  

Nullable Additional details about the transaction. Example: Dolores dolorum amet iste laborum eius est dolor.

transaction_date   date  optional  

Nullable Date of the transaction. Example: consequatur

Display the specified transaction with bank account details.

Example request:
curl --request GET \
    --get "http://localhost/api/transactions/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/transactions/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "bank_account_id": 2,
    "type": "credit",
    "amount": 1000,
    "reference": "INV-12345",
    "description": "Payment received",
    "transaction_date": "2025-09-19",
    "created_at": "2025-09-19T19:00:00Z",
    "updated_at": "2025-09-19T19:00:00Z",
    "bankAccount": {
        "id": 2,
        "bank_name": "First Bank",
        "account_number": "1234567890"
    }
}
 

Request      

GET api/transactions/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the transaction. Example: 1

transaction   integer   

The ID of the transaction. Example: 17

Update the specified transaction inside a database transaction.

Example request:
curl --request PUT \
    "http://localhost/api/transactions/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bank_account_id\": 17,
    \"type\": \"consequatur\",
    \"amount\": \"consequatur\",
    \"reference\": \"consequatur\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\",
    \"transaction_date\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/transactions/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "bank_account_id": 17,
    "type": "consequatur",
    "amount": "consequatur",
    "reference": "consequatur",
    "description": "Dolores dolorum amet iste laborum eius est dolor.",
    "transaction_date": "consequatur"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 10,
    "bank_account_id": 2,
    "type": "debit",
    "amount": 500,
    "reference": "PAY-56789",
    "description": "Payment refund",
    "transaction_date": "2025-09-20",
    "created_at": "2025-09-19T19:05:00Z",
    "updated_at": "2025-09-20T10:00:00Z"
}
 

Request      

PUT api/transactions/{id}

PATCH api/transactions/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the transaction. Example: 1

transaction   integer   

The ID of the transaction. Example: 17

Body Parameters

bank_account_id   integer  optional  

Nullable Updated bank account ID. Example: 17

type   string  optional  

Nullable Updated transaction type. Example: consequatur

amount   numeric  optional  

Nullable Updated amount. Minimum 0. Example: consequatur

reference   string  optional  

Nullable Updated reference. Example: consequatur

description   string  optional  

Nullable Updated description. Example: Dolores dolorum amet iste laborum eius est dolor.

transaction_date   date  optional  

Nullable Updated transaction date. Example: consequatur

Delete the specified transaction.

Example request:
curl --request DELETE \
    "http://localhost/api/transactions/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/transactions/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/transactions/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the transaction. Example: 1

transaction   integer   

The ID of the transaction. Example: 17

Get payments made to banks

Retrieves all credit transactions linked to bank accounts. Optionally, you can filter results by the bank name.

Example request:
curl --request GET \
    --get "http://localhost/api/paymentTobank?bank_name=First+Bank" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/paymentTobank"
);

const params = {
    "bank_name": "First Bank",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Success):


[
    {
        "id": 1,
        "bank_account_id": 1,
        "amount": "1000.00",
        "transaction_date": "2025-10-18",
        "created_at": "2025-10-18T14:27:19.000000Z",
        "bank_account": {
            "id": 1,
            "bank_name": "First Bank"
        }
    }
]
 

Request      

GET api/paymentTobank

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

bank_name   string  optional  

Optional. Filter payments by bank name. Example: First Bank

Display a listing of notifications for a given notifiable entity.

Accepts optional query parameters:

Example request:
curl --request GET \
    --get "http://localhost/api/notifications?notifiable_type=App%5CModels%5CUser&notifiable_id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/notifications"
);

const params = {
    "notifiable_type": "App\Models\User",
    "notifiable_id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
  {
    "id": 5,
    "type": "info",
    "title": "New Update Available",
    "message": "Version 2.0 is now live!",
    "is_read": false,
    "notifiable_type": "App\Models\User",
    "notifiable_id": 1,
    "created_at": "2025-09-19T09:18:00Z",
    "updated_at": "2025-09-19T09:18:00Z"
  }
]
 

Request      

GET api/notifications

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

notifiable_type   string  optional  

Optional class name of the notifiable entity. Example: App\Models\User

notifiable_id   integer  optional  

Optional ID of the notifiable entity. Example: 1

Store a new notification.

Example request:
curl --request POST \
    "http://localhost/api/notifications" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"info\",
    \"title\": \"New Update Available\",
    \"message\": \"consequatur\",
    \"is_read\": false,
    \"notifiable_type\": \"App\\\\Models\\\\User\",
    \"notifiable_id\": 1
}"
const url = new URL(
    "http://localhost/api/notifications"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "info",
    "title": "New Update Available",
    "message": "consequatur",
    "is_read": false,
    "notifiable_type": "App\\Models\\User",
    "notifiable_id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
  "id": 5,
  "type": "info",
  "title": "New Update Available",
  "message": "Version 2.0 is now live!",
  "is_read": false,
  "notifiable_type": "App\Models\User",
  "notifiable_id": 1,
  "created_at": "2025-09-19T09:18:00Z",
  "updated_at": "2025-09-19T09:18:00Z"
}
 

Request      

POST api/notifications

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

type   string   

The notification type/category. Example: info

title   string   

Notification title. Example: New Update Available

message   string   

Notification message content. Example: consequatur

is_read   boolean  optional  

Whether the notification has been read. Defaults to false. Example: false

notifiable_type   string   

The class/type of the notifiable entity. Example: App\Models\User

notifiable_id   integer   

The ID of the notifiable entity. Example: 1

Display a specific notification.

Example request:
curl --request GET \
    --get "http://localhost/api/notifications/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/notifications/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "id": 5,
  "type": "info",
  "title": "New Update Available",
  "message": "Version 2.0 is now live!",
  "is_read": false,
  "notifiable_type": "App\Models\User",
  "notifiable_id": 1,
  "created_at": "2025-09-19T09:18:00Z",
  "updated_at": "2025-09-19T09:18:00Z"
}
 

Request      

GET api/notifications/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the notification. Example: 17

notification   integer   

The ID of the notification. Example: 17

Update a notification.

Example request:
curl --request PUT \
    "http://localhost/api/notifications/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"consequatur\",
    \"title\": \"consequatur\",
    \"message\": \"consequatur\",
    \"is_read\": false,
    \"notifiable_type\": \"consequatur\",
    \"notifiable_id\": 17
}"
const url = new URL(
    "http://localhost/api/notifications/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "consequatur",
    "title": "consequatur",
    "message": "consequatur",
    "is_read": false,
    "notifiable_type": "consequatur",
    "notifiable_id": 17
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
  "id": 5,
  "type": "update",
  "title": "Update Released",
  "message": "Version 2.0 has been released.",
  "is_read": true,
  "notifiable_type": "App\Models\User",
  "notifiable_id": 1,
  "created_at": "2025-09-19T09:18:00Z",
  "updated_at": "2025-09-19T10:00:00Z"
}
 

Request      

PUT api/notifications/{id}

PATCH api/notifications/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the notification. Example: 17

notification   integer   

The ID of the notification. Example: 17

Body Parameters

type   string  optional  

Nullable Notification type/category. Example: consequatur

title   string  optional  

Nullable Notification title. Example: consequatur

message   string  optional  

Nullable Notification message. Example: consequatur

is_read   boolean  optional  

Nullable Whether the notification has been read. Example: false

notifiable_type   string  optional  

Nullable Class/type of the notifiable entity. Example: consequatur

notifiable_id   integer  optional  

Nullable ID of the notifiable entity. Example: 17

Delete a notification.

Example request:
curl --request DELETE \
    "http://localhost/api/notifications/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/notifications/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/notifications/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the notification. Example: 17

notification   integer   

The ID of the notification. Example: 17

Deposit amount to customer's balance.

Example request:
curl --request POST \
    "http://localhost/api/customers/1/deposit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"amount\": \"2000\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\"
}"
const url = new URL(
    "http://localhost/api/customers/1/deposit"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "amount": "2000",
    "description": "Dolores dolorum amet iste laborum eius est dolor."
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Deposit successful",
    "customer": {
        "id": 1,
        "balance": 3000
    }
}
 

Request      

POST api/customers/{customer_id}/deposit

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

customer_id   integer   

The ID of the customer. Example: 1

customer   integer   

The ID of the customer. Example: 17

Body Parameters

amount   numeric   

Amount to deposit. Minimum 1. Example: 2000

description   string  optional  

Example: Dolores dolorum amet iste laborum eius est dolor.

Get a list of all deposits made by a specific customer.

Example request:
curl --request GET \
    --get "http://localhost/api/customers/17/deposits" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/customers/17/deposits"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "customer_id": 1,
        "amount": 2000,
        "created_at": "2025-09-17T12:00:00Z"
    }
]
 

Example response (404):


{
    "message": "Customer not found"
}
 

Request      

GET api/customers/{id}/deposits

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the customer. Example: 17

List all payments

Example request:
curl --request GET \
    --get "http://localhost/api/payments" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/payments"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Success):


[
    {
        "id": 1,
        "amount": 25000,
        "date": "2025-10-17",
        "payment_purpose": "Office Rent",
        "person_company_name": "ABC Ltd",
        "posted_by": "Admin",
        "location": "Lagos",
        "note": "Paid by transfer"
    }
]
 

Request      

GET api/payments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Create a new payment

Example request:
curl --request POST \
    "http://localhost/api/payments" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"amount\": \"consequatur\",
    \"date\": \"consequatur\",
    \"payment_purpose\": \"consequatur\",
    \"person_company_name\": \"consequatur\",
    \"posted_by\": \"consequatur\",
    \"location\": \"consequatur\",
    \"note\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/payments"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "amount": "consequatur",
    "date": "consequatur",
    "payment_purpose": "consequatur",
    "person_company_name": "consequatur",
    "posted_by": "consequatur",
    "location": "consequatur",
    "note": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, Created):


{
    "id": 1,
    "amount": 25000,
    "payment_purpose": "Office Rent",
    "date": "2025-10-17"
}
 

Request      

POST api/payments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

amount   numeric   

The payment amount. Example: consequatur

date   date   

The payment date. Example: consequatur

payment_purpose   string   

The reason for the payment. Example: consequatur

person_company_name   string   

The person or company paid to. Example: consequatur

posted_by   string   

The name of the poster. Example: consequatur

location   string   

The location where payment was made. Example: consequatur

note   string  optional  

optional Additional notes. Example: consequatur

Show a specific payment

Example request:
curl --request GET \
    --get "http://localhost/api/payments/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/payments/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Example response (404, Not Found):


{
    "message": "Payment not found"
}
 

Request      

GET api/payments/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the payment. Example: 17

Update an existing payment

Example request:
curl --request PUT \
    "http://localhost/api/payments/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"amount\": \"consequatur\",
    \"date\": \"consequatur\",
    \"payment_purpose\": \"consequatur\",
    \"person_company_name\": \"consequatur\",
    \"location\": \"consequatur\",
    \"note\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/payments/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "amount": "consequatur",
    "date": "consequatur",
    "payment_purpose": "consequatur",
    "person_company_name": "consequatur",
    "location": "consequatur",
    "note": "consequatur"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (404, Not Found):


{
    "message": "Payment not found"
}
 

Request      

PUT api/payments/{id}

PATCH api/payments/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the payment. Example: 17

Body Parameters

amount   numeric  optional  

optional The payment amount. Example: consequatur

date   date  optional  

optional The payment date. Example: consequatur

payment_purpose   string  optional  

optional The reason for the payment. Example: consequatur

person_company_name   string  optional  

optional The person or company paid to. Example: consequatur

location   string  optional  

optional The location of the payment. Example: consequatur

note   string  optional  

optional Additional notes. Example: consequatur

Delete a payment

Example request:
curl --request DELETE \
    "http://localhost/api/payments/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/payments/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200, Deleted):


{
    "message": "Payment deleted successfully"
}
 

Example response (404, Not Found):


{
    "message": "Payment not found"
}
 

Request      

DELETE api/payments/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the payment. Example: 17

List all expenses

Example request:
curl --request GET \
    --get "http://localhost/api/expenses" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/expenses"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Success):


{
    "id": 1,
    "description": "Fuel purchase",
    "category": "Transport",
    "amount": 5000,
    "date": "2025-10-17",
    "time": "14:00",
    "posted_by": "Admin",
    "location": "Lagos"
}
 

Request      

GET api/expenses

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Create a new expense

Example request:
curl --request POST \
    "http://localhost/api/expenses" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\",
    \"category\": \"consequatur\",
    \"amount\": \"consequatur\",
    \"date\": \"consequatur\",
    \"time\": \"consequatur\",
    \"posted_by\": \"consequatur\",
    \"location\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/expenses"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "description": "Dolores dolorum amet iste laborum eius est dolor.",
    "category": "consequatur",
    "amount": "consequatur",
    "date": "consequatur",
    "time": "consequatur",
    "posted_by": "consequatur",
    "location": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, Created):


{
    "id": 1,
    "description": "Fuel purchase",
    "amount": 5000
}
 

Request      

POST api/expenses

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

description   string   

The expense description. Example: Dolores dolorum amet iste laborum eius est dolor.

category   string   

The expense category. Example: consequatur

amount   numeric   

The amount spent. Example: consequatur

date   date   

The date of expense. Example: consequatur

time   string   

The time in HH:mm format. Example: consequatur

posted_by   string   

The name of the poster. Example: consequatur

location   string   

The expense location. Example: consequatur

Show a specific expense

Example request:
curl --request GET \
    --get "http://localhost/api/expenses/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/expenses/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Example response (404, Not Found):


{
    "message": "Expense not found"
}
 

Request      

GET api/expenses/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the expense. Example: 17

Update an existing expense

Example request:
curl --request PUT \
    "http://localhost/api/expenses/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\",
    \"category\": \"consequatur\",
    \"amount\": \"consequatur\",
    \"date\": \"consequatur\",
    \"time\": \"consequatur\",
    \"posted_by\": \"consequatur\",
    \"location\": \"consequatur\"
}"
const url = new URL(
    "http://localhost/api/expenses/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "description": "Dolores dolorum amet iste laborum eius est dolor.",
    "category": "consequatur",
    "amount": "consequatur",
    "date": "consequatur",
    "time": "consequatur",
    "posted_by": "consequatur",
    "location": "consequatur"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (404, Not Found):


{
    "message": "Expense not found"
}
 

Request      

PUT api/expenses/{id}

PATCH api/expenses/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the expense. Example: 17

Body Parameters

description   string  optional  

optional The expense description. Example: Dolores dolorum amet iste laborum eius est dolor.

category   string  optional  

optional The expense category. Example: consequatur

amount   numeric  optional  

optional The amount spent. Example: consequatur

date   date  optional  

optional The date of expense. Example: consequatur

time   string  optional  

optional The time in HH:mm format. Example: consequatur

posted_by   string  optional  

optional The name of the poster. Example: consequatur

location   string  optional  

optional The expense location. Example: consequatur

Delete an expense

Example request:
curl --request DELETE \
    "http://localhost/api/expenses/17" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/expenses/17"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200, Deleted):


{
    "message": "Deleted successfully"
}
 

Example response (404, Not Found):


{
    "message": "Expense not found"
}
 

Request      

DELETE api/expenses/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the expense. Example: 17

Get payment analysis

Returns a payment analysis of purchased orders.

Example request:
curl --request GET \
    --get "http://localhost/api/paymentAnalysis" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/paymentAnalysis"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Success):


{
    "payment_analysis": [
        {
            "id": 1,
            "supplier_id": 1,
            "order_number": "PO-12345",
            "status": "pending",
            "payment_method": "cash",
            "total_amount": "1000.00",
            "order_date": "2025-09-20",
            "expected_date": "2025-09-30",
            "notes": "consequatur",
            "created_at": "2025-10-19T10:17:01.000000Z",
            "updated_at": "2025-10-19T10:17:01.000000Z",
            "supplier": {
                "id": 1,
                "name": "Supplier A",
                "email": "contact@example.com",
                "phone": "123-456-7890",
                "address": "consequatur",
                "description": "Dolores dolorum amet iste laborum eius est dolor.",
                "created_at": "2025-10-19T10:16:27.000000Z",
                "updated_at": "2025-10-19T10:16:27.000000Z"
            }
        }
    ]
}
 

Request      

GET api/paymentAnalysis

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Display a listing of all bank accounts.

Example request:
curl --request GET \
    --get "http://localhost/api/bank-accounts" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/bank-accounts"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "bank_name": "First Bank",
        "account_number": "1234567890",
        "account_name": "Business Account",
        "branch": "Main Branch",
        "account_type": "Savings",
        "balance": 15000,
        "description": "Primary business account",
        "created_at": "2025-09-17T12:00:00Z",
        "updated_at": "2025-09-17T12:00:00Z"
    }
]
 

Request      

GET api/bank-accounts

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a new bank account.

Example request:
curl --request POST \
    "http://localhost/api/bank-accounts" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bank_name\": \"First Bank\",
    \"account_number\": \"1234567890\",
    \"account_name\": \"Business Account\",
    \"branch\": \"Main Branch\",
    \"account_type\": \"Savings\",
    \"balance\": \"15000.00\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\"
}"
const url = new URL(
    "http://localhost/api/bank-accounts"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "bank_name": "First Bank",
    "account_number": "1234567890",
    "account_name": "Business Account",
    "branch": "Main Branch",
    "account_type": "Savings",
    "balance": "15000.00",
    "description": "Dolores dolorum amet iste laborum eius est dolor."
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "bank_name": "First Bank",
    "account_number": "1234567890",
    "account_name": "Business Account",
    "branch": "Main Branch",
    "account_type": "Savings",
    "balance": 15000,
    "description": "Primary business account",
    "created_at": "2025-09-17T12:00:00Z",
    "updated_at": "2025-09-17T12:00:00Z"
}
 

Request      

POST api/bank-accounts

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

bank_name   string   

Name of the bank. Example: First Bank

account_number   string   

Unique account number. Example: 1234567890

account_name   string   

Account owner or designation. Example: Business Account

branch   string  optional  

Nullable bank branch. Example: Main Branch

account_type   string  optional  

Nullable account type. Example: Savings

balance   numeric  optional  

Nullable starting balance. Example: 15000.00

description   string  optional  

Nullable description or notes. Example: Dolores dolorum amet iste laborum eius est dolor.

Show details of a specific bank account.

Example request:
curl --request GET \
    --get "http://localhost/api/bank-accounts/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/bank-accounts/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "bank_name": "First Bank",
    "account_number": "1234567890",
    "account_name": "Business Account",
    "branch": "Main Branch",
    "account_type": "Savings",
    "balance": 15000,
    "description": "Primary business account",
    "created_at": "2025-09-17T12:00:00Z",
    "updated_at": "2025-09-17T12:00:00Z"
}
 

Request      

GET api/bank-accounts/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the bank account. Example: 1

bankAccount   integer   

The ID of the bank account. Example: 17

Update an existing bank account.

Example request:
curl --request PUT \
    "http://localhost/api/bank-accounts/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bank_name\": \"consequatur\",
    \"account_number\": \"consequatur\",
    \"account_name\": \"consequatur\",
    \"branch\": \"consequatur\",
    \"account_type\": \"consequatur\",
    \"balance\": \"consequatur\",
    \"description\": \"Dolores dolorum amet iste laborum eius est dolor.\"
}"
const url = new URL(
    "http://localhost/api/bank-accounts/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "bank_name": "consequatur",
    "account_number": "consequatur",
    "account_name": "consequatur",
    "branch": "consequatur",
    "account_type": "consequatur",
    "balance": "consequatur",
    "description": "Dolores dolorum amet iste laborum eius est dolor."
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "bank_name": "First Bank Updated",
    "account_number": "1234567890",
    "account_name": "Business Account Updated",
    "branch": "Main Branch",
    "account_type": "Checking",
    "balance": 12000,
    "description": "Updated description",
    "created_at": "2025-09-17T12:00:00Z",
    "updated_at": "2025-09-17T13:00:00Z"
}
 

Request      

PUT api/bank-accounts/{id}

PATCH api/bank-accounts/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the bank account. Example: 1

bankAccount   integer   

The ID of the bank account. Example: 17

Body Parameters

bank_name   string  optional  

Optional name of the bank. Example: consequatur

account_number   string  optional  

Optional unique account number. Example: consequatur

account_name   string  optional  

Optional account owner or designation. Example: consequatur

branch   string  optional  

Nullable bank branch. Example: consequatur

account_type   string  optional  

Nullable account type. Example: consequatur

balance   numeric  optional  

Nullable current balance. Example: consequatur

description   string  optional  

Nullable description or notes. Example: Dolores dolorum amet iste laborum eius est dolor.

Delete a bank account.

Example request:
curl --request DELETE \
    "http://localhost/api/bank-accounts/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/bank-accounts/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/bank-accounts/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the bank account. Example: 1

bankAccount   integer   

The ID of the bank account. Example: 17