Base URL: /api/v1
- Endpoint:
POST /auth/login - Body:
{ "email": "user@example.com", "password": "password" } - Response:
{ "access_token": "1|...", "token_type": "Bearer", "user": { ... } }
- Endpoint:
POST /auth/register - Body:
{ "name": "User Name", "email": "user@example.com", "password": "password", "password_confirmation": "password" }
- Endpoint:
GET /customers - Query Params:
?search=name - Response: Paginated list of customers.
- Endpoint:
POST /customers - Body:
{ "name": "Customer Name", "email": "cust@example.com", "phone": "123456", "address": "Address", "tax_number": "TAX123" }
- Endpoint:
GET /products - Query Params:
?search=name&category_id=1 - Response: Paginated list of products.
- Endpoint:
POST /products - Body:
{ "name": "Product Name", "sku": "SKU-001", "price": 100, "cost": 50, "stock": 10, "category_id": 1 }
- Endpoint:
POST /invoices - Description: Creates invoice, calculates totals, deducts stock.
- Body:
{ "customer_id": 1, "date": "2024-12-09", "due_date": "2024-12-16", "status": "draft", "discount": 0, "tax": 0, "items": [ { "product_id": 1, "quantity": 2, "price": 100 } ] }
- Endpoint:
POST /payments - Body:
{ "invoice_id": 1, "amount": 200, "payment_method": "cash", "payment_date": "2024-12-09" }
- Endpoint:
GET /dashboard/stats - Response: Stats overview.