Laundry Bonda REST API

RESTful API untuk Aplikasi Laundry Management System

API Active Session Auth MySQL

Quick Start

Base URL untuk semua endpoint:

http://localhost/laundry_android/api/
1. Login
POST /api/auth.php?action=login
{
  "username": "admin",
  "password": "admin123"
}
2. Get Data
GET /api/orders.php?status=pending
Using JavaScript
// Include API Client
<script src="/laundry_android/assets/js/api-client.js"></script>

// Use the helper
const result = await LaundryAPI.auth.login('admin', 'password');
const orders = await LaundryAPI.orders.list({ status: 'pending' });

Available Endpoints

Authentication
POST /auth.php?action=login

Login user

POST /auth.php?action=register

Register new customer

GET /auth.php

Get current user info

POST /auth.php?action=logout

Logout

Users
GET /users.php

List all users (admin) or get user profile

POST /users.php

Create new user

PUT /users.php

Update user profile

DELETE /users.php?id={id}

Deactivate user (admin)

Services
GET /services.php

List all services

POST /services.php

Create service (admin)

PUT /services.php

Update service (admin)

Orders
GET /orders.php

List orders (filtered by role)

POST /orders.php

Create new order

PUT /orders.php

Update order (status, courier, etc)

DELETE /orders.php?id={id}

Cancel order

Settings
GET /settings.php

Get all settings

PUT /settings.php

Update setting (admin)

Notifications
GET /notifications.php

List user notifications

PUT /notifications.php

Mark as read

Courier Earnings
GET /courier_earnings.php

Get earnings (courier/admin)

PUT /courier_earnings.php

Update payment status (admin)

Documentation

Untuk dokumentasi lengkap, lihat file:

View Full Documentation

Laundry Bonda API v1.0 | GitHub