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

Step 1 (Register): Validate input, stash payload in Cache, send OTP email.

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/request-otp" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"admin_name\": \"b\",
    \"admin_number\": \"architecto\",
    \"email\": \"zbailey@example.net\",
    \"password\": \"-0pBNvYgxw\",
    \"shop_name\": \"a\",
    \"shop_location\": \"y\",
    \"staff_numbers\": 62,
    \"shop_type\": \"architecto\"
}"
const url = new URL(
    "http://localhost:8000/api/admin/request-otp"
);

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

let body = {
    "admin_name": "b",
    "admin_number": "architecto",
    "email": "zbailey@example.net",
    "password": "-0pBNvYgxw",
    "shop_name": "a",
    "shop_location": "y",
    "staff_numbers": 62,
    "shop_type": "architecto"
};

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

Request      

POST api/admin/request-otp

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

admin_name   string     

Must not be greater than 255 characters. Example: b

admin_number   string     

Example: architecto

email   string     

Must be a valid email address. Must not be greater than 255 characters. Example: zbailey@example.net

password   string     

Must be at least 8 characters. Example: -0pBNvYgxw

shop_name   string     

Must not be greater than 255 characters. Example: a

shop_location   string     

Must not be greater than 255 characters. Example: y

staff_numbers   integer     

Must be at least 0. Example: 62

shop_type   string     

Example: architecto

Step 2 (Register): Verify OTP, fetch cached registration data, save Admin to DB.

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/complete-registration" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"otp\": 4326.41688
}"
const url = new URL(
    "http://localhost:8000/api/admin/complete-registration"
);

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

let body = {
    "email": "gbailey@example.net",
    "otp": 4326.41688
};

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

Request      

POST api/admin/complete-registration

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

Must be a valid email address. Example: gbailey@example.net

otp   number     

Example: 4326.41688

Step 1 (Login): Verify password credentials and dispatch Login OTP.

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"login\": \"architecto\",
    \"password\": \"|]|{+-\"
}"
const url = new URL(
    "http://localhost:8000/api/admin/login"
);

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

let body = {
    "login": "architecto",
    "password": "|]|{+-"
};

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

Request      

POST api/admin/login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

login   string     

Example: architecto

password   string     

Accepts email or admin_number. Example: |]|{+-

Step 2 (Login): Verify Login OTP code and issue Sanctuam Bearer token.

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/complete-login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"otp\": 4326.41688
}"
const url = new URL(
    "http://localhost:8000/api/admin/complete-login"
);

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

let body = {
    "email": "gbailey@example.net",
    "otp": 4326.41688
};

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

Request      

POST api/admin/complete-login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

Must be a valid email address. Example: gbailey@example.net

otp   number     

Example: 4326.41688

Step 1 (Register): Validate form and send OTP code to staff email.

Example request:
curl --request POST \
    "http://localhost:8000/api/staff/request-otp" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"email\": \"zbailey@example.net\",
    \"staff_number\": \"i\",
    \"password\": \"0pBNvYgxwmi\\/#iw\\/kX\",
    \"salary\": 61,
    \"age\": 7,
    \"type\": \"architecto\"
}"
const url = new URL(
    "http://localhost:8000/api/staff/request-otp"
);

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

let body = {
    "name": "b",
    "email": "zbailey@example.net",
    "staff_number": "i",
    "password": "0pBNvYgxwmi\/#iw\/kX",
    "salary": 61,
    "age": 7,
    "type": "architecto"
};

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

Request      

POST api/staff/request-otp

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Must not be greater than 255 characters. Example: b

email   string     

Must be a valid email address. Must not be greater than 255 characters. Example: zbailey@example.net

staff_number   string     

Must not be greater than 50 characters. Example: i

password   string     

Must be at least 8 characters. Example: 0pBNvYgxwmi/#iw/kX

salary   number     

Must be at least 0. Example: 61

age   integer     

Must be at least 16. Must not be greater than 100. Example: 7

type   string     

Example: architecto

Step 2 (Register): Verify OTP and create staff account with image.

Example request:
curl --request POST \
    "http://localhost:8000/api/staff/complete-registration" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "email=gbailey@example.net"\
    --form "otp=miyvdl"\
    --form "image=@/tmp/phpaso56q" 
const url = new URL(
    "http://localhost:8000/api/staff/complete-registration"
);

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

const body = new FormData();
body.append('email', 'gbailey@example.net');
body.append('otp', 'miyvdl');
body.append('image', document.querySelector('input[name="image"]').files[0]);

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

Request      

POST api/staff/complete-registration

Headers

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

Body Parameters

email   string     

Must be a valid email address. Example: gbailey@example.net

otp   string     

Must be 6 characters. Example: miyvdl

image   file  optional    

Must be a file. Must be an image. Must not be greater than 5120 kilobytes. Example: /tmp/phpaso56q

Step 1 (Login): Validate credentials & dispatch 2FA OTP.

Example request:
curl --request POST \
    "http://localhost:8000/api/staff/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"staff_number\": \"architecto\",
    \"password\": \"|]|{+-\"
}"
const url = new URL(
    "http://localhost:8000/api/staff/login"
);

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

let body = {
    "staff_number": "architecto",
    "password": "|]|{+-"
};

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

Request      

POST api/staff/login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

staff_number   string     

Example: architecto

password   string     

Example: |]|{+-

Step 2 (Login): Verify OTP and issue token.

Example request:
curl --request POST \
    "http://localhost:8000/api/staff/complete-login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"staff_number\": \"architecto\",
    \"otp\": \"ngzmiy\"
}"
const url = new URL(
    "http://localhost:8000/api/staff/complete-login"
);

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

let body = {
    "staff_number": "architecto",
    "otp": "ngzmiy"
};

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

Request      

POST api/staff/complete-login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

staff_number   string     

Example: architecto

otp   string     

Must be 6 characters. Example: ngzmiy

Step 1 (Register): Request registration OTP code

Example request:
curl --request POST \
    "http://localhost:8000/api/user/request-otp" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"email\": \"zbailey@example.net\",
    \"password\": \"-0pBNvYgxw\"
}"
const url = new URL(
    "http://localhost:8000/api/user/request-otp"
);

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

let body = {
    "name": "b",
    "email": "zbailey@example.net",
    "password": "-0pBNvYgxw"
};

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

Request      

POST api/user/request-otp

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Must not be greater than 255 characters. Example: b

email   string     

Must be a valid email address. Must not be greater than 255 characters. Example: zbailey@example.net

password   string     

Must be at least 8 characters. Example: -0pBNvYgxw

Step 2 (Register): Verify OTP and create user account

Example request:
curl --request POST \
    "http://localhost:8000/api/user/complete-registration" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"otp\": \"miyvdl\"
}"
const url = new URL(
    "http://localhost:8000/api/user/complete-registration"
);

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

let body = {
    "email": "gbailey@example.net",
    "otp": "miyvdl"
};

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

Request      

POST api/user/complete-registration

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

Must be a valid email address. Example: gbailey@example.net

otp   string     

Must be 6 characters. Example: miyvdl

Step 1 (Login): Validate credentials & send login 2FA OTP

Example request:
curl --request POST \
    "http://localhost:8000/api/user/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"password\": \"|]|{+-\"
}"
const url = new URL(
    "http://localhost:8000/api/user/login"
);

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

let body = {
    "email": "gbailey@example.net",
    "password": "|]|{+-"
};

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

Request      

POST api/user/login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

Must be a valid email address. Example: gbailey@example.net

password   string     

Example: |]|{+-

Step 2 (Login): Verify login OTP and dispatch auth token

Example request:
curl --request POST \
    "http://localhost:8000/api/user/complete-login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"otp\": \"miyvdl\"
}"
const url = new URL(
    "http://localhost:8000/api/user/complete-login"
);

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

let body = {
    "email": "gbailey@example.net",
    "otp": "miyvdl"
};

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

Request      

POST api/user/complete-login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

Must be a valid email address. Example: gbailey@example.net

otp   string     

Must be 6 characters. Example: miyvdl

GET api/user/shop-settings

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

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


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

Example response (200):

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

{
    "id": 1,
    "website_name": "KM Telicom",
    "tagline": "Your Website Tagline",
    "shop_location": "Your Shop Location",
    "website_logo": "default_logo.png",
    "slider1_hero_text": "Your Website Hero Text 1",
    "slider1_headline": "Your Website Headline 1",
    "slider1_paragraph": "Your Website Paragraph 1",
    "slider1_image": "default_slider1.png",
    "slider1_button": "Your Website Button 1",
    "slider2_hero_text": "Your Website Hero Text 2",
    "slider2_headline": "Your Website Headline 2",
    "slider2_paragraph": "Your Website Paragraph 2",
    "slider2_image": "default_slider2.png",
    "slider2_button": "Your Website Button 2",
    "card1_headline": "Your Website Card 1 Headline",
    "card1_text": "Your Website Card 1 Text",
    "card2_headline": "Your Website Card 2 Headline",
    "card2_text": "Your Website Card 2 Text",
    "card3_headline": "Your Website Card 3 Headline",
    "card3_text": "Your Website Card 3 Text",
    "card4_headline": "Your Website Card 4 Headline",
    "card4_text": "Your Website Card 4 Text",
    "created_at": "2026-09-08T07:18:25.000000Z",
    "updated_at": "2026-09-08T07:19:12.000000Z"
}
 

Request      

GET api/user/shop-settings

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/user/about-settings

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

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


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

Example response (200):

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

{
    "id": 1,
    "slider_hero_text": "Your About Us Hero Text",
    "slider_headline": "Your About Us Headline",
    "slider_paragraph": "Your About Us Paragraph",
    "slider_button": "Your About Us Button",
    "why_choose_hero_text": "Why Choose Us Hero Text",
    "why_choose_headline": "Why Choose Us Headline",
    "why_choose_paragraph": "Why Choose Us Paragraph",
    "card1_icon": "default_card1_icon.png",
    "card1_header": "Card 1 Header",
    "card1_title": "Card 1 Title",
    "card2_icon": "default_card2_icon.png",
    "card2_header": "Card 2 Header",
    "card2_title": "Card 2 Title",
    "card3_icon": "default_card3_icon.png",
    "card3_header": "Card 3 Header",
    "card3_title": "Card 3 Title",
    "physical_outlets_header": "Our Outlets Header",
    "physical_outlets_title": "Our Outlets Title",
    "stores_location": "123 Main Street, City, Country",
    "stores_google_map_location": "https://maps.google.com/?q=loc:0,0",
    "working_hours": "Mon - Sat: 9:00 AM - 8:00 PM",
    "hotline_number_1": "+1234567890",
    "hotline_number_2": "+0987654321",
    "hotmail": "support@example.com",
    "our_vision_header": "Our Vision Header",
    "our_vision_paragraph": "Our Vision Paragraph",
    "our_vision_image": "default_vision.png",
    "created_at": "2026-09-08T07:18:58.000000Z",
    "updated_at": "2026-09-08T07:18:58.000000Z"
}
 

Request      

GET api/user/about-settings

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/products

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

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


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

Example response (200):

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

[
    {
        "id": 2,
        "category_id": 1,
        "name": "uyre",
        "slug": "uyre",
        "sku": "ewrewr",
        "quantity": 10,
        "alert_quantity": 5,
        "unit": "pcs",
        "location": "ergret",
        "buying_price": "1200.00",
        "selling_price": "200.00",
        "is_active": 1,
        "notes": null,
        "images": [
            "uploads/products/1788933918_PLZcnH49VO.jpg"
        ],
        "image": null,
        "created_at": "2026-09-09T06:05:18.000000Z",
        "updated_at": "2026-09-09T06:05:18.000000Z",
        "deleted_at": null,
        "category": {
            "id": 1,
            "name": "Keyboard",
            "slug": "keyboard",
            "description": "janina",
            "is_active": 1,
            "created_at": "2026-09-08T07:20:04.000000Z",
            "updated_at": "2026-09-08T07:20:04.000000Z"
        }
    },
    {
        "id": 1,
        "category_id": 1,
        "name": "keyboard",
        "slug": "keyboard",
        "sku": null,
        "quantity": 10,
        "alert_quantity": 5,
        "unit": "pcs",
        "location": "kshdsgkl",
        "buying_price": "250.00",
        "selling_price": "350.00",
        "is_active": 1,
        "notes": "werewr",
        "images": [
            "uploads/products/1788852142_pmwa0j108o.png"
        ],
        "image": null,
        "created_at": "2026-09-08T07:22:22.000000Z",
        "updated_at": "2026-09-08T07:22:22.000000Z",
        "deleted_at": null,
        "category": {
            "id": 1,
            "name": "Keyboard",
            "slug": "keyboard",
            "description": "janina",
            "is_active": 1,
            "created_at": "2026-09-08T07:20:04.000000Z",
            "updated_at": "2026-09-08T07:20:04.000000Z"
        }
    }
]
 

Request      

GET api/products

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/products/{product}

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

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


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

Example response (404):

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

{
    "message": "No query results for model [App\\Models\\Admin\\Product] architecto"
}
 

Request      

GET api/products/{product}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

product   string     

The product. Example: architecto

POST api/admin/logout

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

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


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

Request      

POST api/admin/logout

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/admin/me

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

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/admin/me

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/admin/categories

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

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/admin/categories

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/admin/categories

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/categories" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"description\": \"Eius et animi quos velit et.\",
    \"is_active\": false
}"
const url = new URL(
    "http://localhost:8000/api/admin/categories"
);

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

let body = {
    "name": "b",
    "description": "Eius et animi quos velit et.",
    "is_active": false
};

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

Request      

POST api/admin/categories

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Must not be greater than 255 characters. Example: b

description   string  optional    

Example: Eius et animi quos velit et.

is_active   boolean  optional    

Example: false

GET api/admin/categories/{id}

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

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/admin/categories/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the category. Example: 1

PUT api/admin/categories/{id}

Example request:
curl --request PUT \
    "http://localhost:8000/api/admin/categories/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"description\": \"Eius et animi quos velit et.\",
    \"is_active\": false
}"
const url = new URL(
    "http://localhost:8000/api/admin/categories/1"
);

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

let body = {
    "name": "b",
    "description": "Eius et animi quos velit et.",
    "is_active": false
};

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

Request      

PUT api/admin/categories/{id}

PATCH api/admin/categories/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the category. Example: 1

Body Parameters

name   string  optional    

Must not be greater than 255 characters. Example: b

description   string  optional    

Example: Eius et animi quos velit et.

is_active   boolean  optional    

Example: false

DELETE api/admin/categories/{id}

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

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


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

Request      

DELETE api/admin/categories/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the category. Example: 1

GET api/admin/products

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

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/admin/products

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/admin/products

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/products" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "category_id=architecto"\
    --form "name=n"\
    --form "sku=g"\
    --form "quantity=12"\
    --form "buying_price=77"\
    --form "selling_price=8"\
    --form "location=y"\
    --form "notes=architecto"\
    --form "images[]=@/tmp/phpzJWVnv" 
const url = new URL(
    "http://localhost:8000/api/admin/products"
);

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

const body = new FormData();
body.append('category_id', 'architecto');
body.append('name', 'n');
body.append('sku', 'g');
body.append('quantity', '12');
body.append('buying_price', '77');
body.append('selling_price', '8');
body.append('location', 'y');
body.append('notes', 'architecto');
body.append('images[]', document.querySelector('input[name="images[]"]').files[0]);

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

Request      

POST api/admin/products

Headers

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

Body Parameters

category_id   string     

Must match an existing stored value. Example: architecto

name   string     

Must not be greater than 255 characters. Example: n

sku   string  optional    

Must not be greater than 100 characters. Example: g

quantity   integer     

Must be at least 0. Example: 12

buying_price   number     

Must be at least 0. Example: 77

selling_price   number     

Must be at least 0. Example: 8

location   string     

Must not be greater than 255 characters. Example: y

notes   string  optional    

Example: architecto

images   file[]     

Must be an image. Must not be greater than 2048 kilobytes.

GET api/admin/products/{id}

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

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/admin/products/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 1

PUT api/admin/products/{id}

Example request:
curl --request PUT \
    "http://localhost:8000/api/admin/products/1" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "category_id=architecto"\
    --form "name=n"\
    --form "quantity=84"\
    --form "buying_price=12"\
    --form "selling_price=77"\
    --form "location=i"\
    --form "notes=architecto"\
    --form "images[]=@/tmp/phpSCqGNp" 
const url = new URL(
    "http://localhost:8000/api/admin/products/1"
);

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

const body = new FormData();
body.append('category_id', 'architecto');
body.append('name', 'n');
body.append('quantity', '84');
body.append('buying_price', '12');
body.append('selling_price', '77');
body.append('location', 'i');
body.append('notes', 'architecto');
body.append('images[]', document.querySelector('input[name="images[]"]').files[0]);

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

Request      

PUT api/admin/products/{id}

PATCH api/admin/products/{id}

Headers

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 1

Body Parameters

category_id   string     

Must match an existing stored value. Example: architecto

name   string     

Must not be greater than 255 characters. Example: n

sku   string  optional    
quantity   integer     

Must be at least 0. Example: 84

buying_price   number     

Must be at least 0. Example: 12

selling_price   number     

Must be at least 0. Example: 77

location   string     

Must not be greater than 255 characters. Example: i

notes   string  optional    

Example: architecto

images   file[]  optional    

Must be a file. Must be an image. Must not be greater than 5120 kilobytes.

DELETE api/admin/products/{id}

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

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


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

Request      

DELETE api/admin/products/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 1

GET api/admin/customers

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

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/admin/customers

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/admin/customers

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/customers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"address\": \"architecto\",
    \"phone\": \"ngzmiyvdljnikhwa\",
    \"due\": 50
}"
const url = new URL(
    "http://localhost:8000/api/admin/customers"
);

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

let body = {
    "name": "b",
    "address": "architecto",
    "phone": "ngzmiyvdljnikhwa",
    "due": 50
};

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

Request      

POST api/admin/customers

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Must not be greater than 255 characters. Example: b

address   string  optional    

Example: architecto

phone   string  optional    

Must not be greater than 20 characters. Example: ngzmiyvdljnikhwa

due   number  optional    

Must be at least 0. Example: 50

GET api/admin/customers/{id}

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

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/admin/customers/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the customer. Example: 16

PUT api/admin/customers/{id}

Example request:
curl --request PUT \
    "http://localhost:8000/api/admin/customers/16" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"address\": \"architecto\",
    \"phone\": \"ngzmiyvdljnikhwa\",
    \"due\": 50
}"
const url = new URL(
    "http://localhost:8000/api/admin/customers/16"
);

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

let body = {
    "name": "b",
    "address": "architecto",
    "phone": "ngzmiyvdljnikhwa",
    "due": 50
};

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

Request      

PUT api/admin/customers/{id}

PATCH api/admin/customers/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the customer. Example: 16

Body Parameters

name   string  optional    

Must not be greater than 255 characters. Example: b

address   string  optional    

Example: architecto

phone   string  optional    

Must not be greater than 20 characters. Example: ngzmiyvdljnikhwa

due   number  optional    

Must be at least 0. Example: 50

DELETE api/admin/customers/{id}

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

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


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

Request      

DELETE api/admin/customers/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the customer. Example: 16

GET api/admin/staff

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

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/admin/staff

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Store new staff record directly with file upload.

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/staff" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name=b"\
    --form "email=zbailey@example.net"\
    --form "password=-0pBNvYgxw"\
    --form "staff_number=a"\
    --form "salary=50"\
    --form "age=18"\
    --form "type=architecto"\
    --form "image=@/tmp/phpHCI4is" 
const url = new URL(
    "http://localhost:8000/api/admin/staff"
);

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

const body = new FormData();
body.append('name', 'b');
body.append('email', 'zbailey@example.net');
body.append('password', '-0pBNvYgxw');
body.append('staff_number', 'a');
body.append('salary', '50');
body.append('age', '18');
body.append('type', 'architecto');
body.append('image', document.querySelector('input[name="image"]').files[0]);

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

Request      

POST api/admin/staff

Headers

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

Body Parameters

name   string     

Must not be greater than 255 characters. Example: b

email   string     

Must be a valid email address. Must not be greater than 255 characters. Example: zbailey@example.net

password   string     

Must be at least 8 characters. Example: -0pBNvYgxw

staff_number   string     

Must not be greater than 50 characters. Example: a

salary   number     

Must be at least 0. Example: 50

age   integer     

Must be at least 16. Must not be greater than 100. Example: 18

type   string     

Example: architecto

image   file  optional    

Must be a file. Must be an image. Must not be greater than 5120 kilobytes. Example: /tmp/phpHCI4is

GET api/admin/staff/{id}

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

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/admin/staff/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the staff. Example: 16

Update existing staff record with file upload.

Example request:
curl --request PUT \
    "http://localhost:8000/api/admin/staff/16" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name=b"\
    --form "email=zbailey@example.net"\
    --form "password=-0pBNvYgxw"\
    --form "staff_number=a"\
    --form "salary=50"\
    --form "age=18"\
    --form "image=@/tmp/php77I3mM" 
const url = new URL(
    "http://localhost:8000/api/admin/staff/16"
);

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

const body = new FormData();
body.append('name', 'b');
body.append('email', 'zbailey@example.net');
body.append('password', '-0pBNvYgxw');
body.append('staff_number', 'a');
body.append('salary', '50');
body.append('age', '18');
body.append('image', document.querySelector('input[name="image"]').files[0]);

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

Request      

PUT api/admin/staff/{id}

PATCH api/admin/staff/{id}

Headers

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the staff. Example: 16

Body Parameters

name   string  optional    

Must not be greater than 255 characters. Example: b

email   string  optional    

Must be a valid email address. Must not be greater than 255 characters. Example: zbailey@example.net

password   string  optional    

Must be at least 8 characters. Example: -0pBNvYgxw

staff_number   string  optional    

Must not be greater than 50 characters. Example: a

salary   number  optional    

Must be at least 0. Example: 50

age   integer  optional    

Must be at least 16. Must not be greater than 100. Example: 18

type   string  optional    
image   file  optional    

Must be a file. Must be an image. Must not be greater than 5120 kilobytes. Example: /tmp/php77I3mM

DELETE api/admin/staff/{id}

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

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


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

Request      

DELETE api/admin/staff/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the staff. Example: 16

GET api/admin/staff/{staff_id}/salaries

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

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/admin/staff/{staff_id}/salaries

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

staff_id   integer     

The ID of the staff. Example: 16

POST api/admin/staff/{staff_id}/salaries/pay

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/staff/16/salaries/pay" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"amount\": 27,
    \"received_date\": \"2026-09-09T09:49:42\",
    \"month_year\": \"architecto\",
    \"notes\": \"architecto\"
}"
const url = new URL(
    "http://localhost:8000/api/admin/staff/16/salaries/pay"
);

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

let body = {
    "amount": 27,
    "received_date": "2026-09-09T09:49:42",
    "month_year": "architecto",
    "notes": "architecto"
};

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

Request      

POST api/admin/staff/{staff_id}/salaries/pay

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

staff_id   integer     

The ID of the staff. Example: 16

Body Parameters

amount   number     

Must be at least 0. Example: 27

received_date   string     

Must be a valid date. Example: 2026-09-09T09:49:42

month_year   string     

Example: architecto

notes   string  optional    

Example: architecto

Fetch attendance records with date-range filtering for UI views.

Example request:
curl --request GET \
    --get "http://localhost:8000/api/admin/attendance" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"start_date\": \"2026-09-09T09:49:42\",
    \"end_date\": \"2052-10-02\",
    \"filter\": \"last_month\"
}"
const url = new URL(
    "http://localhost:8000/api/admin/attendance"
);

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

let body = {
    "start_date": "2026-09-09T09:49:42",
    "end_date": "2052-10-02",
    "filter": "last_month"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).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/admin/attendance

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

staff_id   string  optional    

Must match an existing stored value.

start_date   string  optional    

Must be a valid date. Example: 2026-09-09T09:49:42

end_date   string  optional    

Must be a valid date. Must be a date after or equal to start_date. Example: 2052-10-02

filter   string  optional    

Example: last_month

Must be one of:
  • last_month
  • this_month
  • this_week

Bulk store or update daily attendance entries submitted from the UI.

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/attendance/daily" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date\": \"2026-09-09\",
    \"attendances\": [
        {
            \"staff_id\": \"architecto\",
            \"status\": \"architecto\",
            \"check_in\": \"architecto\",
            \"check_out\": \"architecto\",
            \"notes\": \"n\"
        }
    ]
}"
const url = new URL(
    "http://localhost:8000/api/admin/attendance/daily"
);

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

let body = {
    "date": "2026-09-09",
    "attendances": [
        {
            "staff_id": "architecto",
            "status": "architecto",
            "check_in": "architecto",
            "check_out": "architecto",
            "notes": "n"
        }
    ]
};

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

Request      

POST api/admin/attendance/daily

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

date   string     

Must be a valid date in the format Y-m-d. Example: 2026-09-09

attendances   object[]     

Must have at least 1 items.

staff_id   string     

Must match an existing stored value. Example: architecto

status   string     

Example: architecto

check_in   string  optional    

Example: architecto

check_out   string  optional    

Example: architecto

notes   string  optional    

Must not be greater than 500 characters. Example: n

Update a single attendance log entry.

Example request:
curl --request PUT \
    "http://localhost:8000/api/admin/attendance/16" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"check_in\": \"architecto\",
    \"check_out\": \"architecto\",
    \"notes\": \"n\"
}"
const url = new URL(
    "http://localhost:8000/api/admin/attendance/16"
);

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

let body = {
    "check_in": "architecto",
    "check_out": "architecto",
    "notes": "n"
};

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

Request      

PUT api/admin/attendance/{attendance_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

attendance_id   integer     

The ID of the attendance. Example: 16

Body Parameters

status   string  optional    
check_in   string  optional    

Example: architecto

check_out   string  optional    

Example: architecto

notes   string  optional    

Must not be greater than 500 characters. Example: n

Change order status directly (pending, confirm, cancel).

Example request:
curl --request PATCH \
    "http://localhost:8000/api/admin/orders/1/status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"order_status\": \"confirm\"
}"
const url = new URL(
    "http://localhost:8000/api/admin/orders/1/status"
);

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

let body = {
    "order_status": "confirm"
};

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

Request      

PATCH api/admin/orders/{order_id}/status

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

order_id   integer     

The ID of the order. Example: 1

Body Parameters

order_status   string     

Example: confirm

Must be one of:
  • pending
  • confirm
  • cancel

Display a listing of orders.

Filters: ?sell_by=name, ?order_number=ORD-..., ?search=query, ?status=pending|confirm|cancel

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

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/admin/orders

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Store order (defaults to pending, revenue is NOT recorded until confirmed).

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

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


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

Request      

POST api/admin/orders

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/admin/orders/{id}

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

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/admin/orders/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the order. Example: 1

Update order details.

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

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


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

Request      

PUT api/admin/orders/{id}

PATCH api/admin/orders/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the order. Example: 1

DELETE api/admin/orders/{id}

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

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


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

Request      

DELETE api/admin/orders/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the order. Example: 1

POST api/admin/inventories

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/inventories" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"architecto\",
    \"added_quantity\": 22,
    \"unit_cost\": 84,
    \"notes\": \"architecto\"
}"
const url = new URL(
    "http://localhost:8000/api/admin/inventories"
);

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

let body = {
    "product_id": "architecto",
    "added_quantity": 22,
    "unit_cost": 84,
    "notes": "architecto"
};

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

Request      

POST api/admin/inventories

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

product_id   string     

Must match an existing stored value. Example: architecto

added_quantity   integer     

Must be at least 1. Example: 22

unit_cost   number  optional    

Must be at least 0. Example: 84

notes   string  optional    

Accepts unit cost from frontend. Example: architecto

Fetch Revenue-only reports with date filtering.

Query Params: ?period=today|this_week|this_month|this_year|custom&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD

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

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/admin/reports/revenue

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Fetch Cost-only reports with date filtering.

Query Params: ?period=today|this_week|this_month|this_year|custom&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD

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

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/admin/reports/cost

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Fetch Net Summary (Revenue, Cost, Net Profit/Loss) with date filtering.

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

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/admin/reports/summary

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/admin/shop-settings

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

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/admin/shop-settings

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/admin/shop-settings

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/shop-settings" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"website_name\": \"architecto\",
    \"tagline\": \"architecto\",
    \"shop_location\": \"architecto\",
    \"slider1_hero_text\": \"architecto\",
    \"slider1_headline\": \"architecto\",
    \"slider1_paragraph\": \"architecto\",
    \"slider1_button\": \"architecto\",
    \"slider2_hero_text\": \"architecto\",
    \"slider2_headline\": \"architecto\",
    \"slider2_paragraph\": \"architecto\",
    \"slider2_button\": \"architecto\",
    \"card1_headline\": \"architecto\",
    \"card1_text\": \"architecto\",
    \"card2_headline\": \"architecto\",
    \"card2_text\": \"architecto\",
    \"card3_headline\": \"architecto\",
    \"card3_text\": \"architecto\",
    \"card4_headline\": \"architecto\",
    \"card4_text\": \"architecto\"
}"
const url = new URL(
    "http://localhost:8000/api/admin/shop-settings"
);

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

let body = {
    "website_name": "architecto",
    "tagline": "architecto",
    "shop_location": "architecto",
    "slider1_hero_text": "architecto",
    "slider1_headline": "architecto",
    "slider1_paragraph": "architecto",
    "slider1_button": "architecto",
    "slider2_hero_text": "architecto",
    "slider2_headline": "architecto",
    "slider2_paragraph": "architecto",
    "slider2_button": "architecto",
    "card1_headline": "architecto",
    "card1_text": "architecto",
    "card2_headline": "architecto",
    "card2_text": "architecto",
    "card3_headline": "architecto",
    "card3_text": "architecto",
    "card4_headline": "architecto",
    "card4_text": "architecto"
};

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

Request      

POST api/admin/shop-settings

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

website_name   string  optional    

Example: architecto

tagline   string  optional    

Example: architecto

shop_location   string  optional    

Example: architecto

slider1_hero_text   string  optional    

Example: architecto

slider1_headline   string  optional    

Example: architecto

slider1_paragraph   string  optional    

Example: architecto

slider1_button   string  optional    

Example: architecto

slider2_hero_text   string  optional    

Example: architecto

slider2_headline   string  optional    

Example: architecto

slider2_paragraph   string  optional    

Example: architecto

slider2_button   string  optional    

Example: architecto

card1_headline   string  optional    

Example: architecto

card1_text   string  optional    

Example: architecto

card2_headline   string  optional    

Example: architecto

card2_text   string  optional    

Example: architecto

card3_headline   string  optional    

Example: architecto

card3_text   string  optional    

Example: architecto

card4_headline   string  optional    

Example: architecto

card4_text   string  optional    

Example: architecto

GET api/admin/about-settings

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

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/admin/about-settings

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/admin/about-settings

Example request:
curl --request POST \
    "http://localhost:8000/api/admin/about-settings" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slider_hero_text\": \"architecto\",
    \"slider_headline\": \"architecto\",
    \"slider_paragraph\": \"architecto\",
    \"slider_button\": \"architecto\",
    \"why_choose_hero_text\": \"architecto\",
    \"why_choose_headline\": \"architecto\",
    \"why_choose_paragraph\": \"architecto\",
    \"card1_header\": \"architecto\",
    \"card1_title\": \"architecto\",
    \"card2_header\": \"architecto\",
    \"card2_title\": \"architecto\",
    \"card3_header\": \"architecto\",
    \"card3_title\": \"architecto\",
    \"physical_outlets_header\": \"architecto\",
    \"physical_outlets_title\": \"architecto\",
    \"stores_location\": \"architecto\",
    \"stores_google_map_location\": \"architecto\",
    \"working_hours\": \"architecto\",
    \"hotline_number_1\": \"architecto\",
    \"hotline_number_2\": \"architecto\",
    \"hotmail\": \"zbailey@example.net\",
    \"our_vision_header\": \"architecto\",
    \"our_vision_paragraph\": \"architecto\"
}"
const url = new URL(
    "http://localhost:8000/api/admin/about-settings"
);

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

let body = {
    "slider_hero_text": "architecto",
    "slider_headline": "architecto",
    "slider_paragraph": "architecto",
    "slider_button": "architecto",
    "why_choose_hero_text": "architecto",
    "why_choose_headline": "architecto",
    "why_choose_paragraph": "architecto",
    "card1_header": "architecto",
    "card1_title": "architecto",
    "card2_header": "architecto",
    "card2_title": "architecto",
    "card3_header": "architecto",
    "card3_title": "architecto",
    "physical_outlets_header": "architecto",
    "physical_outlets_title": "architecto",
    "stores_location": "architecto",
    "stores_google_map_location": "architecto",
    "working_hours": "architecto",
    "hotline_number_1": "architecto",
    "hotline_number_2": "architecto",
    "hotmail": "zbailey@example.net",
    "our_vision_header": "architecto",
    "our_vision_paragraph": "architecto"
};

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

Request      

POST api/admin/about-settings

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

slider_hero_text   string  optional    

Example: architecto

slider_headline   string  optional    

Example: architecto

slider_paragraph   string  optional    

Example: architecto

slider_button   string  optional    

Example: architecto

why_choose_hero_text   string  optional    

Example: architecto

why_choose_headline   string  optional    

Example: architecto

why_choose_paragraph   string  optional    

Example: architecto

card1_header   string  optional    

Example: architecto

card1_title   string  optional    

Example: architecto

card2_header   string  optional    

Example: architecto

card2_title   string  optional    

Example: architecto

card3_header   string  optional    

Example: architecto

card3_title   string  optional    

Example: architecto

physical_outlets_header   string  optional    

Example: architecto

physical_outlets_title   string  optional    

Example: architecto

stores_location   string  optional    

Example: architecto

stores_google_map_location   string  optional    

Example: architecto

working_hours   string  optional    

Example: architecto

hotline_number_1   string  optional    

Example: architecto

hotline_number_2   string  optional    

Example: architecto

hotmail   string  optional    

Must be a valid email address. Example: zbailey@example.net

our_vision_header   string  optional    

Example: architecto

our_vision_paragraph   string  optional    

Example: architecto

Logout staff session.

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

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


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

Request      

POST api/staff/logout

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/staff/me

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

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/staff/me

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/staff/customers

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

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/staff/customers

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/staff/customers

Example request:
curl --request POST \
    "http://localhost:8000/api/staff/customers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"address\": \"architecto\",
    \"phone\": \"ngzmiyvdljnikhwa\",
    \"due\": 50
}"
const url = new URL(
    "http://localhost:8000/api/staff/customers"
);

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

let body = {
    "name": "b",
    "address": "architecto",
    "phone": "ngzmiyvdljnikhwa",
    "due": 50
};

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

Request      

POST api/staff/customers

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Must not be greater than 255 characters. Example: b

address   string  optional    

Example: architecto

phone   string  optional    

Must not be greater than 20 characters. Example: ngzmiyvdljnikhwa

due   number  optional    

Must be at least 0. Example: 50

GET api/staff/customers/{id}

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

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/staff/customers/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the customer. Example: 16

PUT api/staff/customers/{id}

Example request:
curl --request PUT \
    "http://localhost:8000/api/staff/customers/16" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"address\": \"architecto\",
    \"phone\": \"ngzmiyvdljnikhwa\",
    \"due\": 50
}"
const url = new URL(
    "http://localhost:8000/api/staff/customers/16"
);

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

let body = {
    "name": "b",
    "address": "architecto",
    "phone": "ngzmiyvdljnikhwa",
    "due": 50
};

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

Request      

PUT api/staff/customers/{id}

PATCH api/staff/customers/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the customer. Example: 16

Body Parameters

name   string  optional    

Must not be greater than 255 characters. Example: b

address   string  optional    

Example: architecto

phone   string  optional    

Must not be greater than 20 characters. Example: ngzmiyvdljnikhwa

due   number  optional    

Must be at least 0. Example: 50

DELETE api/staff/customers/{id}

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

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


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

Request      

DELETE api/staff/customers/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the customer. Example: 16

GET api/staff/sales/{staff_name}

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

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/staff/sales/{staff_name}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

staff_name   string     

Example: architecto

Change order status directly (pending, confirm, cancel).

Example request:
curl --request PATCH \
    "http://localhost:8000/api/staff/orders/1/status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"order_status\": \"pending\"
}"
const url = new URL(
    "http://localhost:8000/api/staff/orders/1/status"
);

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

let body = {
    "order_status": "pending"
};

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

Request      

PATCH api/staff/orders/{order_id}/status

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

order_id   integer     

The ID of the order. Example: 1

Body Parameters

order_status   string     

Example: pending

Must be one of:
  • pending
  • confirm
  • cancel

Display a listing of orders.

Filters: ?sell_by=name, ?order_number=ORD-..., ?search=query, ?status=pending|confirm|cancel

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

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/staff/orders

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Store order (defaults to pending, revenue is NOT recorded until confirmed).

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

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


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

Request      

POST api/staff/orders

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/staff/orders/{id}

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

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/staff/orders/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the order. Example: 1

Update order details.

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

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


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

Request      

PUT api/staff/orders/{id}

PATCH api/staff/orders/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the order. Example: 1

DELETE api/staff/orders/{id}

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

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


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

Request      

DELETE api/staff/orders/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the order. Example: 1

Logout action

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

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


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

Request      

POST api/user/logout

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/user/me

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

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/me

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/user/orders

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

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/orders

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Store a newly created website user order.

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

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


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

Request      

POST api/user/orders

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Display the specified order.

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

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/orders/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the order. Example: 1

PUT api/user/orders/{id}

Example request:
curl --request PUT \
    "http://localhost:8000/api/user/orders/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"phone\": \"ngzmiyvdljnikhwa\",
    \"delivery_address\": \"y\",
    \"paid_by\": \"cod\",
    \"order_status\": \"completed\",
    \"payment_status\": \"paid\",
    \"notes\": \"k\"
}"
const url = new URL(
    "http://localhost:8000/api/user/orders/1"
);

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

let body = {
    "name": "b",
    "phone": "ngzmiyvdljnikhwa",
    "delivery_address": "y",
    "paid_by": "cod",
    "order_status": "completed",
    "payment_status": "paid",
    "notes": "k"
};

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

Request      

PUT api/user/orders/{id}

PATCH api/user/orders/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the order. Example: 1

Body Parameters

name   string  optional    

Must not be greater than 255 characters. Example: b

phone   string  optional    

Must not be greater than 20 characters. Example: ngzmiyvdljnikhwa

delivery_address   string  optional    

Must not be greater than 500 characters. Example: y

paid_by   string  optional    

Example: cod

Must be one of:
  • cash
  • cod
  • online
order_status   string  optional    

Example: completed

Must be one of:
  • pending
  • processing
  • confirmed
  • completed
  • cancelled
payment_status   string  optional    

Example: paid

Must be one of:
  • pending
  • paid
  • failed
  • confirmed
notes   string  optional    

Must not be greater than 1000 characters. Example: k