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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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": "« 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 »",
"page": null,
"active": false
}
],
"path": "http://api-yokitofood.test/api/v1/products",
"per_page": 12,
"to": null,
"total": 0
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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]."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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": ""
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.