MENU navbar-image

Introduction

REST API untuk platform Yokito Food — bakery homemade Padang. Menyediakan endpoint publik (produk, kategori, promo, pesanan) dan endpoint admin terproteksi (CRUD + manajemen pesanan).

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

To authenticate requests, include an Authorization header with the value "Bearer {ADMIN_BEARER_TOKEN}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

Login via POST /api/v1/auth/login untuk mendapatkan token. Sertakan sebagai Authorization: Bearer {token} di setiap request admin.

Authentication

Login, logout, dan info profil admin.

Login admin

Mengembalikan Bearer token yang digunakan di semua endpoint admin.

Example request:
curl --request POST \
    "http://api-yokitofood.test/api/v1/auth/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"admin@yokitofood.test\",
    \"password\": \"password\"
}"
const url = new URL(
    "http://api-yokitofood.test/api/v1/auth/login"
);

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

let body = {
    "email": "admin@yokitofood.test",
    "password": "password"
};

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

Request      

POST api/v1/auth/login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

Email admin. Example: admin@yokitofood.test

password   string     

Password. Example: password

Logout

requires authentication

Hapus token yang sedang aktif.

Example request:
curl --request POST \
    "http://api-yokitofood.test/api/v1/admin/logout" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/logout"
);

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


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

Request      

POST api/v1/admin/logout

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Profil admin yang sedang login

requires authentication

Example request:
curl --request GET \
    --get "http://api-yokitofood.test/api/v1/admin/me" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/me"
);

const headers = {
    "Authorization": "Bearer {ADMIN_BEARER_TOKEN}",
    "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
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/admin/me

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Public — Categories

Daftar kategori aktif

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

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
vary: Origin
 

{
    "data": [
        {
            "id": 1,
            "name": "Kue Kering",
            "slug": "kue-kering",
            "description": null,
            "sort_order": 1
        },
        {
            "id": 2,
            "name": "Kue Basah",
            "slug": "kue-basah",
            "description": null,
            "sort_order": 2
        },
        {
            "id": 3,
            "name": "Roti",
            "slug": "roti",
            "description": null,
            "sort_order": 3
        },
        {
            "id": 4,
            "name": "Minuman",
            "slug": "minuman",
            "description": null,
            "sort_order": 4
        },
        {
            "id": 5,
            "name": "Snack Box",
            "slug": "snack-box",
            "description": null,
            "sort_order": 5
        }
    ]
}
 

Request      

GET api/v1/categories

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Public — Products

Daftar produk aktif

Example request:
curl --request GET \
    --get "http://api-yokitofood.test/api/v1/products?category=kue-kering&search=brownies&featured=1&per_page=12" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/products"
);

const params = {
    "category": "kue-kering",
    "search": "brownies",
    "featured": "1",
    "per_page": "12",
};
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):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "data": [],
    "links": {
        "first": "http://api-yokitofood.test/api/v1/products?page=1",
        "last": "http://api-yokitofood.test/api/v1/products?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": null,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "page": null,
                "active": false
            },
            {
                "url": "http://api-yokitofood.test/api/v1/products?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "http://api-yokitofood.test/api/v1/products",
        "per_page": 12,
        "to": null,
        "total": 0
    }
}
 

Request      

GET api/v1/products

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

category   string  optional    

Filter berdasarkan slug kategori. Example: kue-kering

search   string  optional    

Cari berdasarkan nama atau deskripsi. Example: brownies

featured   boolean  optional    

Tampilkan hanya produk unggulan. Example: true

per_page   integer  optional    

Jumlah item per halaman (max 48). Example: 12

Detail produk by slug

Example request:
curl --request GET \
    --get "http://api-yokitofood.test/api/v1/products/coklat-brownies-premium" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/products/coklat-brownies-premium"
);

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
vary: Origin
 

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

Request      

GET api/v1/products/{slug}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

slug   string     

Slug produk. Example: coklat-brownies-premium

Public — Promos

Promo yang sedang aktif

Mengembalikan promo yang aktif dan dalam periode berlaku.

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

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
vary: Origin
 

{
    "data": []
}
 

Request      

GET api/v1/promos/active

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Public — Testimonials

Daftar testimoni aktif

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

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
vary: Origin
 

{
    "data": []
}
 

Request      

GET api/v1/testimonials

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Public — Settings

Setting publik (general, contact, social)

Example request:
curl --request GET \
    --get "http://api-yokitofood.test/api/v1/settings" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/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
vary: Origin
 

{
    "data": {
        "general": {
            "site_name": "Yokito Food",
            "site_tagline": "Homemade with Love",
            "site_description": "Kue dan makanan rumahan berkualitas."
        },
        "contact": {
            "whatsapp_number": "6281234567890",
            "whatsapp_message": "Halo, saya ingin memesan: ",
            "email": "hello@yokitofood.test",
            "address": ""
        },
        "social": {
            "instagram": "",
            "facebook": "",
            "tiktok": ""
        }
    }
}
 

Request      

GET api/v1/settings

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Public — Orders

Buat pesanan baru

Idempotent via client_id: jika client_id sudah ada, kembalikan order yang sama (HTTP 200). Diskon promo dihitung otomatis jika kode valid.

Example request:
curl --request POST \
    "http://api-yokitofood.test/api/v1/orders" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"client_id\": \"550e8400-e29b-41d4-a716-446655440000\",
    \"customer_name\": \"Rina Sari\",
    \"customer_phone\": \"08123456789\",
    \"customer_address\": \"Jl. Merdeka No. 10, Padang\",
    \"notes\": \"Tolong pakai pita merah\",
    \"promo_code\": \"DISKON10\",
    \"items\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://api-yokitofood.test/api/v1/orders"
);

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

let body = {
    "client_id": "550e8400-e29b-41d4-a716-446655440000",
    "customer_name": "Rina Sari",
    "customer_phone": "08123456789",
    "customer_address": "Jl. Merdeka No. 10, Padang",
    "notes": "Tolong pakai pita merah",
    "promo_code": "DISKON10",
    "items": [
        "architecto"
    ]
};

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

Request      

POST api/v1/orders

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

client_id   string     

UUID unik yang dibuat client sebelum request. Example: 550e8400-e29b-41d4-a716-446655440000

customer_name   string     

Nama pemesan. Example: Rina Sari

customer_phone   string     

Nomor WhatsApp. Example: 08123456789

customer_address   string  optional    

Alamat pengiriman. Example: Jl. Merdeka No. 10, Padang

notes   string  optional    

Catatan tambahan. Example: Tolong pakai pita merah

promo_code   string  optional    

Kode promo (opsional). Example: DISKON10

items   string[]     

Daftar item pesanan.

product_id   integer     

ID produk. Example: 1

quantity   integer     

Jumlah (1–99). Example: 2

Admin — Categories

GET api/v1/admin/categories

requires authentication

Example request:
curl --request GET \
    --get "http://api-yokitofood.test/api/v1/admin/categories" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/categories"
);

const headers = {
    "Authorization": "Bearer {ADMIN_BEARER_TOKEN}",
    "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
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/admin/categories

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/v1/admin/categories

requires authentication

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

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

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

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

Request      

POST api/v1/admin/categories

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

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

sort_order   integer  optional    

Must be at least 0. Example: 60

PUT api/v1/admin/categories/{category_id}

requires authentication

Example request:
curl --request PUT \
    "http://api-yokitofood.test/api/v1/admin/categories/1" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"description\": \"Eius et animi quos velit et.\",
    \"is_active\": true,
    \"sort_order\": 60
}"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/categories/1"
);

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

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

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

Request      

PUT api/v1/admin/categories/{category_id}

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

category_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: true

sort_order   integer  optional    

Must be at least 0. Example: 60

DELETE api/v1/admin/categories/{category_id}

requires authentication

Example request:
curl --request DELETE \
    "http://api-yokitofood.test/api/v1/admin/categories/1" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/categories/1"
);

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


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

Request      

DELETE api/v1/admin/categories/{category_id}

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

category_id   integer     

The ID of the category. Example: 1

Admin — Products

GET api/v1/admin/products

requires authentication

Example request:
curl --request GET \
    --get "http://api-yokitofood.test/api/v1/admin/products" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/products"
);

const headers = {
    "Authorization": "Bearer {ADMIN_BEARER_TOKEN}",
    "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
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/admin/products

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/v1/admin/products

requires authentication

Example request:
curl --request POST \
    "http://api-yokitofood.test/api/v1/admin/products" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"category_id\": \"architecto\",
    \"name\": \"n\",
    \"description\": \"Eius et animi quos velit et.\",
    \"price\": 60,
    \"stock_status\": \"sold_out\",
    \"is_active\": false,
    \"is_featured\": false,
    \"sort_order\": 42
}"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/products"
);

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

let body = {
    "category_id": "architecto",
    "name": "n",
    "description": "Eius et animi quos velit et.",
    "price": 60,
    "stock_status": "sold_out",
    "is_active": false,
    "is_featured": false,
    "sort_order": 42
};

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

Request      

POST api/v1/admin/products

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

category_id   string     

The id of an existing record in the categories table. Example: architecto

name   string     

Must not be greater than 255 characters. Example: n

description   string  optional    

Example: Eius et animi quos velit et.

price   integer     

Must be at least 0. Example: 60

stock_status   string     

Example: sold_out

Must be one of:
  • available
  • sold_out
  • pre_order
is_active   boolean  optional    

Example: false

is_featured   boolean  optional    

Example: false

sort_order   integer  optional    

Must be at least 0. Example: 42

GET api/v1/admin/products/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://api-yokitofood.test/api/v1/admin/products/16" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/products/16"
);

const headers = {
    "Authorization": "Bearer {ADMIN_BEARER_TOKEN}",
    "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
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/admin/products/{id}

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 16

POST api/v1/admin/products/{id}

requires authentication

Example request:
curl --request POST \
    "http://api-yokitofood.test/api/v1/admin/products/16" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"description\": \"Eius et animi quos velit et.\",
    \"price\": 60,
    \"stock_status\": \"available\",
    \"is_active\": false,
    \"is_featured\": true,
    \"sort_order\": 42
}"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/products/16"
);

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

let body = {
    "name": "b",
    "description": "Eius et animi quos velit et.",
    "price": 60,
    "stock_status": "available",
    "is_active": false,
    "is_featured": true,
    "sort_order": 42
};

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

Request      

POST api/v1/admin/products/{id}

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 16

Body Parameters

category_id   string  optional    

The id of an existing record in the categories table.

name   string  optional    

Must not be greater than 255 characters. Example: b

description   string  optional    

Example: Eius et animi quos velit et.

price   integer  optional    

Must be at least 0. Example: 60

stock_status   string  optional    

Example: available

Must be one of:
  • available
  • sold_out
  • pre_order
is_active   boolean  optional    

Example: false

is_featured   boolean  optional    

Example: true

sort_order   integer  optional    

Must be at least 0. Example: 42

DELETE api/v1/admin/products/{id}

requires authentication

Example request:
curl --request DELETE \
    "http://api-yokitofood.test/api/v1/admin/products/16" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/products/16"
);

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


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

Request      

DELETE api/v1/admin/products/{id}

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 16

POST api/v1/admin/products/{id}/restore

requires authentication

Example request:
curl --request POST \
    "http://api-yokitofood.test/api/v1/admin/products/16/restore" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/products/16/restore"
);

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


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

Request      

POST api/v1/admin/products/{id}/restore

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 16

Admin — Testimonials

GET api/v1/admin/testimonials

requires authentication

Example request:
curl --request GET \
    --get "http://api-yokitofood.test/api/v1/admin/testimonials" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/testimonials"
);

const headers = {
    "Authorization": "Bearer {ADMIN_BEARER_TOKEN}",
    "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
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/admin/testimonials

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/v1/admin/testimonials

requires authentication

Example request:
curl --request POST \
    "http://api-yokitofood.test/api/v1/admin/testimonials" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer_name\": \"b\",
    \"customer_location\": \"n\",
    \"content\": \"architecto\",
    \"rating\": 2,
    \"is_active\": false,
    \"sort_order\": 84
}"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/testimonials"
);

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

let body = {
    "customer_name": "b",
    "customer_location": "n",
    "content": "architecto",
    "rating": 2,
    "is_active": false,
    "sort_order": 84
};

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

Request      

POST api/v1/admin/testimonials

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

customer_name   string     

Must not be greater than 255 characters. Example: b

customer_location   string  optional    

Must not be greater than 255 characters. Example: n

content   string     

Example: architecto

rating   integer  optional    

Must be at least 1. Must not be greater than 5. Example: 2

is_active   boolean  optional    

Example: false

sort_order   integer  optional    

Must be at least 0. Example: 84

PUT api/v1/admin/testimonials/{testimonial_id}

requires authentication

Example request:
curl --request PUT \
    "http://api-yokitofood.test/api/v1/admin/testimonials/16" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/testimonials/16"
);

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


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

Request      

PUT api/v1/admin/testimonials/{testimonial_id}

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

testimonial_id   integer     

The ID of the testimonial. Example: 16

DELETE api/v1/admin/testimonials/{testimonial_id}

requires authentication

Example request:
curl --request DELETE \
    "http://api-yokitofood.test/api/v1/admin/testimonials/16" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/testimonials/16"
);

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


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

Request      

DELETE api/v1/admin/testimonials/{testimonial_id}

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

testimonial_id   integer     

The ID of the testimonial. Example: 16

Admin — Promos

GET api/v1/admin/promos

requires authentication

Example request:
curl --request GET \
    --get "http://api-yokitofood.test/api/v1/admin/promos" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/promos"
);

const headers = {
    "Authorization": "Bearer {ADMIN_BEARER_TOKEN}",
    "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
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/admin/promos

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/v1/admin/promos

requires authentication

Example request:
curl --request POST \
    "http://api-yokitofood.test/api/v1/admin/promos" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"code\": \"n\",
    \"description\": \"Eius et animi quos velit et.\",
    \"type\": \"fixed\",
    \"value\": 16,
    \"min_order\": 42,
    \"max_discount\": 40,
    \"starts_at\": \"2026-04-10T19:25:31\",
    \"ends_at\": \"2052-05-03\",
    \"is_active\": true
}"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/promos"
);

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

let body = {
    "name": "b",
    "code": "n",
    "description": "Eius et animi quos velit et.",
    "type": "fixed",
    "value": 16,
    "min_order": 42,
    "max_discount": 40,
    "starts_at": "2026-04-10T19:25:31",
    "ends_at": "2052-05-03",
    "is_active": true
};

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

Request      

POST api/v1/admin/promos

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Must not be greater than 255 characters. Example: b

code   string  optional    

Must not be greater than 50 characters. Example: n

description   string  optional    

Example: Eius et animi quos velit et.

type   string     

Example: fixed

Must be one of:
  • percentage
  • fixed
value   integer     

Must be at least 1. Example: 16

min_order   integer  optional    

Must be at least 0. Example: 42

max_discount   integer  optional    

Must be at least 1. Example: 40

starts_at   string  optional    

Must be a valid date. Example: 2026-04-10T19:25:31

ends_at   string  optional    

Must be a valid date. Must be a date after or equal to starts_at. Example: 2052-05-03

is_active   boolean  optional    

Example: true

PUT api/v1/admin/promos/{promo_id}

requires authentication

Example request:
curl --request PUT \
    "http://api-yokitofood.test/api/v1/admin/promos/16" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/promos/16"
);

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


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

Request      

PUT api/v1/admin/promos/{promo_id}

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

promo_id   integer     

The ID of the promo. Example: 16

DELETE api/v1/admin/promos/{promo_id}

requires authentication

Example request:
curl --request DELETE \
    "http://api-yokitofood.test/api/v1/admin/promos/16" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/promos/16"
);

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


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

Request      

DELETE api/v1/admin/promos/{promo_id}

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

promo_id   integer     

The ID of the promo. Example: 16

Admin — Settings

GET api/v1/admin/settings

requires authentication

Example request:
curl --request GET \
    --get "http://api-yokitofood.test/api/v1/admin/settings" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/settings"
);

const headers = {
    "Authorization": "Bearer {ADMIN_BEARER_TOKEN}",
    "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
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/admin/settings

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

PUT api/v1/admin/settings

requires authentication

Example request:
curl --request PUT \
    "http://api-yokitofood.test/api/v1/admin/settings" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"settings\": [
        {
            \"key\": \"architecto\",
            \"value\": \"architecto\"
        }
    ]
}"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/settings"
);

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

let body = {
    "settings": [
        {
            "key": "architecto",
            "value": "architecto"
        }
    ]
};

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

Request      

PUT api/v1/admin/settings

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

settings   object[]     
key   string     

Example: architecto

value   string  optional    

Example: architecto

Admin — Orders

Daftar semua pesanan (paginated)

requires authentication

Example request:
curl --request GET \
    --get "http://api-yokitofood.test/api/v1/admin/orders?status=pending&search=YKT-2026" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/orders"
);

const params = {
    "status": "pending",
    "search": "YKT-2026",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {ADMIN_BEARER_TOKEN}",
    "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
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/admin/orders

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

status   string  optional    

Filter status: pending, approved, in_progress, completed, cancelled. Example: pending

search   string  optional    

Cari berdasarkan nomor order, nama, atau telepon. Example: YKT-2026

GET api/v1/admin/orders/{order_id}

requires authentication

Example request:
curl --request GET \
    --get "http://api-yokitofood.test/api/v1/admin/orders/16" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/orders/16"
);

const headers = {
    "Authorization": "Bearer {ADMIN_BEARER_TOKEN}",
    "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
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/admin/orders/{order_id}

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

order_id   integer     

The ID of the order. Example: 16

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

requires authentication

Example request:
curl --request PATCH \
    "http://api-yokitofood.test/api/v1/admin/orders/16/status" \
    --header "Authorization: Bearer {ADMIN_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"status\": \"completed\",
    \"admin_note\": \"b\",
    \"discount_amount\": 39
}"
const url = new URL(
    "http://api-yokitofood.test/api/v1/admin/orders/16/status"
);

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

let body = {
    "status": "completed",
    "admin_note": "b",
    "discount_amount": 39
};

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

Request      

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

Headers

Authorization        

Example: Bearer {ADMIN_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

order_id   integer     

The ID of the order. Example: 16

Body Parameters

status   string     

Example: completed

Must be one of:
  • approved
  • in_progress
  • completed
  • cancelled
admin_note   string  optional    

Must not be greater than 1000 characters. Example: b

discount_amount   integer  optional    

Override diskon — admin bisa sesuaikan saat approve. Must be at least 0. Example: 39