๐Ÿ“ฑ CRM INDRA CELL

REST API Documentation v1.0

๐ŸŽฏ Base URL: http://localhost/crm-indra-cell/api/
๐Ÿ“Š Database: MySQL - crm_indra_cell
๐Ÿ”ง Status: โ— Active

๐Ÿ‘ฅ Customers API

GET /api/customers.php
Mendapatkan semua data pelanggan
Query Parameters:
- ?id=CUST001 - Get customer by ID
- ?search=ahmad - Search customers
POST /api/customers.php
Menambahkan pelanggan baru
Request Body:
{
  "full_name": "John Doe",
  "phone_number": "081234567890",
  "email": "john@email.com",
  "rfid_card_id": "RFID999",
  "ewallet_type": "GoPay",
  "ewallet_number": "081234567890",
  "bank_name": "BCA",
  "bank_account_number": "1234567890",
  "customer_status": "active"
}
PUT /api/customers.php
Update data pelanggan (include id in request body)
DELETE /api/customers.php?id=CUST001
Hapus pelanggan berdasarkan ID

๐Ÿ’ณ Transactions API

GET /api/transactions.php
Mendapatkan semua transaksi
Query Parameters:
- ?customer_id=CUST001 - Get transactions by customer
POST /api/transactions.php
Menambahkan transaksi baru
Request Body:
{
  "customer_id": "CUST001",
  "amount": 500000,
  "payment_method": "E-wallet",
  "payment_details": "GoPay",
  "transaction_status": "success",
  "notes": "Pembelian HP"
}
PUT /api/transactions.php
Update status transaksi
Request Body:
{
  "id": "TRX001",
  "transaction_status": "success"
}

๐Ÿ“Š Dashboard API

GET /api/dashboard.php
Mendapatkan statistik dashboard (total customers, revenue, dll)

๐Ÿ“ก RFID Scanner API

GET /api/rfid.php?rfid=RFID001
Cari pelanggan berdasarkan RFID Card ID
โš ๏ธ Catatan Penting:
1. Pastikan database sudah di-import
2. Sesuaikan kredensial database di config/database.php
3. Aktifkan Apache dan MySQL di XAMPP/WAMP
4. Test API menggunakan Postman atau browser

๐Ÿ”ง Setup Instructions

  1. Extract file ke folder htdocs/crm-indra-cell/
  2. Import database: database/crm_indra_cell.sql
  3. Edit config/database.php (username & password)
  4. Jalankan Apache & MySQL di XAMPP
  5. Akses: http://localhost/crm-indra-cell/