AdminLTE Preloader Image

API Documentation ProcessSmaart POS REST API

API Base Information

Base URL https://mpos.processsmaart.com/api
Server Port 8001
Response Format JSON
Authentication Laravel Sanctum

Quick Start Guide

1. Start the Laravel Server
php artisan serve --port=8001
2. Test API Connection
curl -X GET https://mpos.processsmaart.com/api/health
3. Authentication (Example)
curl -X POST https://mpos.processsmaart.com/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"identifier":"admin@processsmaart.com","password":"123456"}'
4. Make Authenticated Request
curl -X GET https://mpos.processsmaart.com/api/items \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN_HERE"

Role-Based Access Control (RBAC)

Authentication Required

All API endpoints (except login and health check) require authentication using Laravel Sanctum Bearer tokens. Users can only access endpoints they have permission for based on their assigned role.

Admin

Full Access - 26 Permissions

  • All Dashboard features
  • Full CRUD on Items, Transactions, Customers
  • Employee & Role Management
  • Approve/Reject Cancel Requests
  • View & Export Reports
  • Print Barcodes
Email: admin@processsmaart.com
Sales Manager

Management Access - 16 Permissions

  • Dashboard access
  • View/Create/Edit Items & Transactions
  • View/Create/Edit Customers
  • View Employees (no create/delete)
  • Approve/Reject Cancel Requests
  • View & Export Reports
  • Print Barcodes
Email: sales.manager@processsmaart.com
Sales Executive

Basic POS Access - 8 Permissions

  • Dashboard (own data only)
  • View Items
  • View/Create Transactions
  • View Cancel Requests (own only)
  • View/Create/Edit Customers
Email: sales.executive@processsmaart.com
Test Credentials

All demo accounts use the same password: 123456

Use the identifier field which accepts either email or mobile number for login.

Authentication

POST /api/auth/login

Authenticate user and get access token

{
  "email": "admin@example.com",
  "password": "password"
}
POST /api/auth/logout

Logout and revoke access token

GET /api/auth/profile

Get authenticated user profile

Employee Management

GET /api/employees

List all employees

POST /api/employees

Create new employee

GET /api/employees/{id}

Get employee by ID

PUT /api/employees/{id}

Update employee

DELETE /api/employees/{id}

Delete employee

Customer Management

GET /api/customers

List customers with filtering & pagination

?search=&type=&location=&active=&paginate=true
POST /api/customers

Create new customer with shop details

GET /api/customers/{id}

Get customer by ID

PUT /api/customers/{id}

Update customer information

DELETE /api/customers/{id}

Smart delete customer

GET /api/customers/mobile/{mobile}

Find customer by mobile number

GET /api/customers/location/{location}

Find customers by location

GET /api/customers-outlets

Get company outlets only

GET /api/customers-stats

Customer statistics & analytics

POST /api/customers/bulk-update

Bulk activate/deactivate customers

PUT /api/customers/{id}/status

Update customer status

POST /api/customers/import

Import customers from CSV

GET /api/customers/export

Export customers to CSV

Item Management

GET /api/items

List all items

POST /api/items

Create new item

GET /api/items/{id}

Get item by ID

PUT /api/items/{id}

Update item

DELETE /api/items/{id}

Delete item

GET /api/items/barcode/{barcode}

Find item by barcode

Transaction Processing

GET /api/transactions

List all transactions

POST /api/transactions

Create new transaction

GET /api/transactions/{id}

Get transaction by ID

PUT /api/transactions/{id}

Update transaction

POST /api/transactions/{id}/cancel

Cancel transaction (requires authorization)

Note: Use cancel requests instead

Cancel Request Management

GET /api/cancel-requests

List all cancel requests

?status=pending|approved|rejected
POST /api/cancel-requests

Create cancel request for transaction

Body: {transaction_id, reason}
GET /api/cancel-requests/{id}

Get cancel request details

POST /api/cancel-requests/{id}/approve

Approve cancel request (admin/manager only)

Body: {admin_notes?}
POST /api/cancel-requests/{id}/reject

Reject cancel request (admin/manager only)

Body: {admin_notes}

Synchronization

GET /api/sync/status

Get current sync status

POST /api/sync

Trigger data synchronization

GET /api/health

System health check

Enhanced Customer Features (Shop/Bakery Support)

New Customer System

The customer system has been enhanced to support bakery and shop customers with comprehensive business information, credit management, and location-based filtering.

Customer Fields
  • name - Customer/Owner name
  • shop_name - Shop/Business name
  • mobile - Mobile number (10-15 digits)
  • customer_type - company_outlet or customer
  • location - Area/Location
  • nearby_location - Nearby landmark
  • address - Full address
  • contact_person - Contact person name
  • email - Email address
  • gst_number - GST number (validated)
  • credit_limit - Credit limit amount
  • credit_balance - Outstanding credit
  • notes - Additional notes
  • is_active - Active status
Query Parameters
Parameter Description Example
search Search across multiple fields ?search=bakery
type Filter by customer type ?type=company_outlet
location Filter by location ?location=downtown
active Filter by active status ?active=true
paginate Enable pagination ?paginate=true
per_page Items per page ?per_page=20
Validation Rules
  • mobile: 10-15 digits, unique
  • email: Valid email format, unique
  • gst_number: Indian GST format
  • customer_type: company_outlet or customer
  • credit_limit: Numeric, min: 0

Sample Requests & Responses

Create Item Request
POST /api/items
Content-Type: application/json
Authorization: Bearer {your-token}

{
  "barcode": "1234567890",
  "name": "Sample Product",
  "price": "29.99",
  "category": "Electronics",
  "stock_quantity": 100,
  "description": "Sample product description"
}
Create Shop Customer Request
POST /api/customers
Content-Type: application/json
Authorization: Bearer {your-token}

{
  "name": "Sweet Dreams Bakery Owner",
  "shop_name": "Sweet Dreams Bakery",
  "mobile": "9999000111",
  "address": "123 Main Street, City",
  "location": "Downtown",
  "nearby_location": "Near City Mall",
  "customer_type": "company_outlet",
  "contact_person": "Store Manager",
  "email": "contact@sweetdreams.com",
  "gst_number": "29ABCDE1234F1Z5",
  "credit_limit": 50000,
  "notes": "Premium bakery outlet"
}
Customer Search & Filter
GET /api/customers?search=bakery&type=company_outlet&location=downtown&paginate=true&per_page=10
Authorization: Bearer {your-token}

Response includes:
- Filtered customer list
- Pagination metadata
- Total count
- Search/filter applied
Customer Statistics Response
{
  "total_customers": 22,
  "active_customers": 22,
  "company_outlets": 2,
  "regular_customers": 20,
  "total_credit_outstanding": "917.00",
  "locations": [
    "Gandhi Nagar",
    "Downtown",
    "Uptown"
  ]
}
Bulk Update Request
POST /api/customers/bulk-update
Content-Type: application/json
Authorization: Bearer {your-token}

{
  "customer_ids": [
    "uuid1", "uuid2", "uuid3"
  ],
  "action": "activate",
  "customer_type": "company_outlet"
}
Enhanced Customer Response
{
  "message": "Customer created successfully",
  "customer": {
    "id": "uuid-here",
    "name": "Sweet Dreams Bakery Owner",
    "shop_name": "Sweet Dreams Bakery",
    "mobile": "9999000111",
    "customer_type": "company_outlet",
    "location": "Downtown",
    "credit_limit": "50000.00",
    "credit_balance": "0.00",
    "is_active": true,
    "created_at": "2024-01-01T00:00:00.000Z"
  }
}
Error Response
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "name": ["The name field is required."],
    "price": ["The price must be a number."]
  }
}

Testing Tools