Manage your API keys and explore the documentation
Use this API key to authenticate your requests to protected endpoints.
Include your API key in all requests using the x-api-key header.
https://uasapibe-production.up.railway.app/api/auth/register
Register a new user account
{
"username": "john_doe",
"email": "john@example.com",
"password": "secure_password",
"role": "pelanggan"
}
Response:
{
"message": "User registered successfully",
"token": "jwt_token_here",
"user": {
"id": 1,
"username": "john_doe",
"email": "john@example.com",
"role": "pelanggan"
}
}
https://uasapibe-production.up.railway.app/api/auth/login
Login with existing credentials
{
"username": "john_doe",
"password": "secure_password"
}
Response:
{
"message": "Login successful",
"token": "jwt_token_here",
"user": {
"id": 1,
"username": "john_doe",
"email": "john@example.com",
"role": "pelanggan"
}
}
https://uasapibe-production.up.railway.app/api/menu
Get all menu items
{
"x-api-key": "your-api-key"
}
Response:
[
{
"id": 1,
"nama": "Nasi Goreng",
"harga": 25000,
"gambar": "nasi_goreng.jpg",
"jumlah": 10,
"id_kategori": 1,
"id_user": 1,
"kategori": {
"id_kategori": 1,
"nama_kategori": "Makanan Utama"
},
"user": {
"id_user": 1,
"username": "admin",
"email": "admin@example.com",
"role": "admin"
}
}
]
https://uasapibe-production.up.railway.app/api/menu/:id
Get menu item by ID
id - The ID of the menu item
{
"x-api-key": "your-api-key"
}
https://uasapibe-production.up.railway.app/api/menu
Create a new menu item
{
"x-api-key": "your-api-key"
}
Request Body:
{
"nama": "Nasi Goreng",
"harga": 25000,
"gambar": "nasi_goreng.jpg",
"jumlah": 10,
"id_kategori": 1,
"id_user": 1
}
https://uasapibe-production.up.railway.app/api/menu/:id
Update a menu item
{
"x-api-key": "your-api-key"
}
Request Body:
{
"nama": "Nasi Goreng Spesial",
"harga": 30000
}
https://uasapibe-production.up.railway.app/api/menu/:id
Delete a menu item
{
"x-api-key": "your-api-key"
}
https://uasapibe-production.up.railway.app/api/kategori
Get all categories
[
{
"id_kategori": 1,
"nama_kategori": "Makanan Utama"
}
]
https://uasapibe-production.up.railway.app/api/kategori/:id
Get category by ID
id - The ID of the category
https://uasapibe-production.up.railway.app/api/kategori
Create a new category
{
"nama_kategori": "Minuman"
}
https://uasapibe-production.up.railway.app/api/orders
Get all orders
[
{
"id": 1,
"user_id": 1,
"total_amount": 50000,
"status": "pending",
"created_at": "2024-01-01T00:00:00.000Z"
}
]
https://uasapibe-production.up.railway.app/api/orders
Create a new order
{
"user_id": 1,
"total_amount": 50000,
"items": [
{
"menu_id": 1,
"quantity": 2,
"price": 25000
}
]
}
https://uasapibe-production.up.railway.app/api/orders/:id/status
Update order status
{
"status": "completed"
}
https://uasapibe-production.up.railway.app/api/payment
Get all payments
[
{
"id": 1,
"order_id": 1,
"amount": 50000,
"payment_method": "cash",
"status": "completed",
"created_at": "2024-01-01T00:00:00.000Z"
}
]
https://uasapibe-production.up.railway.app/api/payment
Create a new payment
{
"order_id": 1,
"amount": 50000,
"payment_method": "cash"
}
https://uasapibe-production.up.railway.app/api/payment/:id/status
Update payment status
{
"status": "completed"
}
https://uasapibe-production.up.railway.app/api/users
Get all users
[
{
"id_user": 1,
"username": "john_doe",
"email": "john@example.com",
"role": "pelanggan"
}
]
https://uasapibe-production.up.railway.app/api/users/me
Get current user profile
{
"Authorization": "Bearer your-jwt-token"
}
https://uasapibe-production.up.railway.app/api/users/:id
Get user by ID
id - The ID of the user
All endpoints may return the following error responses:
Unauthorized
Missing or invalid API key
{
"error": "API key required"
}
Forbidden
Invalid or inactive API key
{
"error": "Invalid or inactive API key"
}
Not Found
Resource not found
{
"error": "Menu not found"
}
Internal Server Error
Server error
{
"error": "Failed to fetch menu items"
}