REST API v1 — Sales Force (Postman ready)

JWT API for the Flutter field-sales app. Copy any request below into Postman as-is.

Base URL (local): https://sales.anoopjewellers.co.in/api/v1/
Base URL (live): https://sales.anoopjewellers.co.in/api/v1/
Health: GET https://sales.anoopjewellers.co.in/api/v1
Markdown: docs/API.md

Postman — import & test in 2 minutes

  1. Import collection file: docs/postman/Anoop_Jewellers_Sales_API.postman_collection.json
  2. Set collection variable base_url to https://sales.anoopjewellers.co.in/api/v1
  3. Run Auth → Login first (token is saved automatically)
  4. Run any other request — Bearer token is already set

Sales person accounts are created in Admin → Sales Persons (no public register). Login with that email/mobile + password.

Headers

Public (login / refresh / forgot-password):

Content-Type: application/json
Accept: application/json

Protected (everything else):

Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

Photo upload: use multipart/form-data (no JSON Content-Type). Keep Bearer token.

Response format

Success
{
  "status": true,
  "message": "Success",
  "data": {}
}
Error
{
  "status": false,
  "message": "Validation failed",
  "errors": {
    "mobile": ["Customer mobile must be unique"]
  }
}

Pagination

{
  "status": true,
  "message": "Success",
  "data": {
    "data": [],
    "meta": {
      "current_page": 1,
      "per_page": 20,
      "total": 42,
      "last_page": 3
    }
  }
}

Auth flow

  1. POST /login → save access_token + refresh_token
  2. Send Authorization: Bearer access_token on protected calls
  3. On 401 → POST /refresh-token
  4. If refresh fails → logout to login screen

Authentication

POST/loginPublic
Login

Login with email OR mobile + password. Sales person must be approved.

Postman
POST https://sales.anoopjewellers.co.in/api/v1/login
Content-Type: application/json
Accept: application/json

{
  "email": "sales1@example.com",
  "password": "Password@123"
}

Or use mobile:

{
  "mobile": "9876500001",
  "password": "Password@123"
}
Success 200
{
  "status": true,
  "message": "Login successful",
  "data": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
    "token_type": "Bearer",
    "expires_in": 3600,
    "refresh_token": "a1b2c3d4e5...",
    "user": {
      "id": 3,
      "name": "Amit Kumar",
      "email": "sales1@example.com",
      "mobile": "9876500001",
      "role": "sales_person",
      "avatar": null
    },
    "sales_person": {
      "id": 5,
      "full_name": "Amit Kumar",
      "mobile": "9876500001",
      "city": "Delhi",
      "team_id": 1,
      "approval_status": "approved",
      "profile_photo": null
    }
  }
}
Errors
  • 401 Invalid credentials / not approved
  • 422 Missing email/mobile or password
  • 429 Too many attempts
POST/logoutJWT required
Logout

Revoke refresh token.

Postman
POST https://sales.anoopjewellers.co.in/api/v1/logout
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "refresh_token": "{{refresh_token}}"
}
{
  "status": true,
  "message": "Logged out",
  "data": []
}
POST/refresh-tokenPublic
Refresh token

Get new access + refresh tokens.

Postman
POST https://sales.anoopjewellers.co.in/api/v1/refresh-token
Content-Type: application/json
Accept: application/json

{
  "refresh_token": "{{refresh_token}}"
}

Response shape same as login data.

POST/forgot-passwordPublic
Forgot password

Always returns generic success.

Postman
POST https://sales.anoopjewellers.co.in/api/v1/forgot-password
Content-Type: application/json
Accept: application/json

{
  "email": "sales1@example.com"
}
POST/change-passwordJWT required
Change password

Change password for logged-in user.

Postman
POST https://sales.anoopjewellers.co.in/api/v1/change-password
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "current_password": "Password@123",
  "password": "NewPass@123",
  "password_confirmation": "NewPass@123"
}

Profile

GET/profileJWT required
Get profile

User + sales_person profile.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/profile
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "id": 3,
    "name": "Amit Kumar",
    "email": "sales1@example.com",
    "mobile": "9876500001",
    "role": "sales_person",
    "avatar": null,
    "sales_person": {
      "id": 5,
      "full_name": "Amit Kumar",
      "mobile": "9876500001",
      "city": "Delhi",
      "address": "Connaught Place",
      "pin_code": "110001",
      "vehicle_number": "DL01AB1234"
    }
  }
}
PUT/profileJWT required
Update profile

Update user + sales person fields.

Postman
PUT https://sales.anoopjewellers.co.in/api/v1/profile
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "name": "Amit Kumar",
  "mobile": "9876500001",
  "email": "sales1@example.com",
  "alternate_mobile": "9876500099",
  "address": "Connaught Place",
  "pin_code": "110001",
  "city": "Delhi",
  "vehicle_number": "DL01AB1234"
}
POST/profile/photoJWT required
Upload profile photo

Multipart form-data. Field: image OR photo OR profile_photo. Alias: POST /profile/image

POST https://sales.anoopjewellers.co.in/api/v1/profile/photo
Authorization: Bearer {{access_token}}
Body → form-data:
  key: image   type: File   value: (select photo.jpg)
{
  "status": true,
  "message": "Profile photo uploaded",
  "data": {
    "path": "profile/ab12cd.jpg",
    "url": "https://sales.anoopjewellers.co.in/uploads/profile/ab12cd.jpg"
  }
}

Dashboard

GET/dashboardJWT required
Dashboard KPIs

Today sales, targets, attendance timer, customers, orders.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/dashboard
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Dashboard data",
  "data": {
    "today_sales": 125000,
    "today_target": 50000,
    "weekly_target": 250000,
    "monthly_target": 1000000,
    "achievement_percent": 42.5,
    "total_customers": 18,
    "total_orders": 12,
    "today_visits": 3,
    "working_timer": 145,
    "working_minutes": 145,
    "check_in_status": "checked_in",
    "checked_in": true,
    "targets": {},
    "orders_summary": {},
    "attendance_today": {}
  }
}
GET/summaryJWT required
Summary (alias)

Same payload as GET /dashboard.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/summary
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
GET/sales/monthlyJWT required
Monthly sales chart

Last 12 months order totals for the logged-in sales person.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/sales/monthly
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "rows": [
      { "month": "2026-01", "total": "80000.00", "orders": 4 },
      { "month": "2026-02", "total": "120000.00", "orders": 6 }
    ]
  }
}
GET/sales/summaryJWT required
Sales summary

Today / week / month order counts and sales totals.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/sales/summary
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "today_orders": 2,
    "weekly_orders": 8,
    "monthly_orders": 12,
    "total_sales": 540000,
    "today_sales": 125000
  }
}

Attendance

POST/attendance/check-inJWT required
Check in

Start work session. Optional GPS. Returns attendance_check_id for periodic location pings.

Postman
POST https://sales.anoopjewellers.co.in/api/v1/attendance/check-in
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "lat": 28.6139,
  "lng": 77.2090
}
{
  "status": true,
  "message": "Checked in successfully",
  "data": {
    "attendance_id": 10,
    "session_id": 22,
    "attendance_check_id": 22,
    "status": "present",
    "check_in_at": "2026-08-11 09:05:00",
    "checked_in": true
  }
}
POST/attendance/locationJWT required
Periodic Location Ping

Post periodic GPS location (every 5 minutes) during an active check-in session.

Postman
POST https://sales.anoopjewellers.co.in/api/v1/attendance/location
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "attendance_check_id": 22,
  "lat": 28.6139,
  "lng": 77.2090,
  "recorded_at": "2026-08-11 09:10:00"
}
{
  "status": true,
  "message": "Location logged successfully",
  "data": {
    "log_id": 101,
    "attendance_check_id": 22,
    "sales_person_id": 5,
    "lat": 28.6139,
    "lng": 77.209,
    "recorded_at": "2026-08-11 09:10:00"
  }
}
POST/attendance/check-outJWT required
Check out

End open session. Optional GPS.

Postman
POST https://sales.anoopjewellers.co.in/api/v1/attendance/check-out
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "lat": 28.6139,
  "lng": 77.2090
}
GET/attendance/todayJWT required
Today attendance

Today row + open session + working minutes.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/attendance/today
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "attendance": { "id": 10, "status": "present", "working_minutes": 120 },
    "checked_in": true,
    "open_session": { "id": 22, "check_in_at": "2026-08-11 09:05:00" },
    "working_minutes": 145,
    "working_timer": 145
  }
}
GET/attendance/historyJWT required
Attendance history

Paginated attendance rows.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/attendance/history?page=1
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
GET/attendance/calendarJWT required
Attendance calendar

Days for a month. Query: month=YYYY-MM

Postman
GET https://sales.anoopjewellers.co.in/api/v1/attendance/calendar?month=2026-08
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "month": "2026-08",
    "days": [
      {
        "attendance_date": "2026-08-01",
        "status": "present",
        "working_minutes": 480,
        "check_in_at": "2026-08-01 09:10:00",
        "check_out_at": "2026-08-01 18:00:00"
      }
    ]
  }
}
GET/attendance/monthlyJWT required
Monthly attendance summary

Counts by status. Query: month=YYYY-MM

Postman
GET https://sales.anoopjewellers.co.in/api/v1/attendance/monthly?month=2026-08
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "month": "2026-08",
    "summary": {
      "present": 18,
      "late": 2,
      "absent": 1,
      "on_leave": 1,
      "holiday": 0,
      "working_minutes": 9000
    }
  }
}

Targets

GET/targets/dailyJWT required
Daily target

Current daily target + achievement.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/targets/daily
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "period_type": "daily",
    "target_amount": 50000,
    "achieved_amount": 12500,
    "achievement_percent": 25
  }
}
GET/targets/weeklyJWT required
Weekly target

Current weekly target.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/targets/weekly
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
GET/targets/monthlyJWT required
Monthly target

Current monthly target.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/targets/monthly
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

Customers

Assignment: POST /customers auto-assigns to the logged-in sales person (do not send assigned_sales_person_id).
Required on create: name, mobile, latitude + longitude.
GPS aliases: lat = lat | alt | latitude  ·  lng = lng | lang | long | longitude.
Status: pending | not_interested | interested | reschedule (if reschedule → reschedule_date_time required).
List / show / update / delete / follow-up / photo = own customers only. Mobile must be unique.
Location fields (create / update / follow-up)
Stored asAccepted request keysRequired on create?
latlat, alt, latitudeYes
lnglng, lang, long, longitudeYes

Response always returns lat and lng. Example using Flutter-style aliases: {"alt":28.61,"lang":77.20}

GET/customersJWT required
List my customers

Only customers assigned to logged-in sales person. Supports search + status + date filters.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/customers?page=1&per_page=20&search=rahul&status=reschedule&customer_type=retail&from_date=2026-08-01&to_date=2026-08-31
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
Query params
ParamDescription
page, per_pagePagination (default 20)
searchname / mobile / email / pin_code / summary
statuspending | not_interested | interested | reschedule
customer_typee.g. retail
dateExact created date YYYY-MM-DD
from_date / to_dateCreated date range (aliases: start_date / end_date)
Success sample
{
  "status": true,
  "message": "Success",
  "data": {
    "data": [
      {
        "id": 10,
        "name": "Priya Verma",
        "mobile": "9876543210",
        "email": "priya@example.com",
        "address": "Mumbai",
        "pin_code": "400001",
        "customer_type": "retail",
        "notes": null,
        "status": "interested",
        "reschedule_date_time": null,
        "summary": "Wants gold set",
        "lat": "28.6139390",
        "lng": "77.2090210",
        "assigned_sales_person_id": 5,
        "last_visit_at": "2026-08-30 10:00:00",
        "created_at": "2026-08-30 10:00:00"
      }
    ],
    "meta": { "current_page": 1, "per_page": 20, "total": 1, "last_page": 1 }
  }
}
POST/customers/check-mobileJWT required
Check if customer mobile exists

Also available as GET/POST /customers/check_mobile, /check-customer-mobile, /check_customer_mobile. Optional ignore_id when editing.

Postman
POST https://sales.anoopjewellers.co.in/api/v1/customers/check-mobile
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "mobile": "9876543210",
  "ignore_id": null
}
{
  "status": true,
  "message": "Customer mobile number is available",
  "data": {
    "exists": false,
    "name": null,
    "mobile": "9876543210",
    "customer": null
  }
}
GET/customers/{id}JWT required
Get customer details, follow-ups & photos

Must be assigned to you. Includes follow_ups[] and visit_photos[].

Postman
GET https://sales.anoopjewellers.co.in/api/v1/customers/2
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "id": 2,
    "name": "Rahul Sharma",
    "mobile": "9000000002",
    "email": "rahul@example.com",
    "address": "Delhi",
    "pin_code": "110001",
    "customer_type": "retail",
    "notes": null,
    "assigned_sales_person_id": 5,
    "status": "reschedule",
    "reschedule_date_time": "2026-08-25 15:30:00",
    "summary": "Callback requested",
    "lat": "28.6139390",
    "lng": "77.2090210",
    "assigned_sales_person": {
      "id": 5,
      "full_name": "Amit Kumar",
      "mobile": "9876500001"
    },
    "follow_ups": [
      {
        "id": 12,
        "status": "reschedule",
        "reschedule_date_time": "2026-08-25 15:30:00",
        "summary": "Callback requested",
        "lat": "28.6139390",
        "lng": "77.2090210",
        "created_at": "2026-08-23 12:00:00"
      }
    ],
    "visit_photos": [
      {
        "id": 4,
        "photo_path": "customer_photos/abc123.jpg",
        "url": "https://sales.anoopjewellers.co.in/uploads/customer_photos/abc123.jpg",
        "notes": "Initial visit photo"
      }
    ]
  }
}
POST/customersJWT required
Create customer (auto-assign)

Requires name, mobile, lat/alt and lng/lang. Optional photo multipart. Optional device_id (must be approved).

Postman
POST https://sales.anoopjewellers.co.in/api/v1/customers
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "name": "Priya Verma",
  "mobile": "9876543210",
  "lat": 28.613939,
  "lng": 77.209021,
  "status": "reschedule",
  "reschedule_date_time": "2026-08-26 11:00:00",
  "summary": "Meeting rescheduled for Wednesday morning",
  "email": "priya@example.com",
  "address": "Mumbai",
  "pin_code": "400001",
  "customer_type": "retail",
  "notes": "Interested in gold set",
  "device_id": "unique_device_uuid_12345"
}

Same create using aliases alt / lang:

{
  "name": "Priya Verma",
  "mobile": "9876543210",
  "alt": 28.613939,
  "lang": 77.209021,
  "status": "pending"
}
Fields
FieldRequiredNotes
nameYesMax 150
mobileYesUnique
lat / alt / latitudeYesGPS latitude
lng / lang / long / longitudeYesGPS longitude
statusNoDefault pending
reschedule_date_timeIf status=rescheduleAlso accepts rescheduled_at
summaryNoAlso accepts description
email, address, pin_code, customer_type, notesNo—
device_idNo*If sent, device must be approved (or header X-Device-Id)
photo / image / visit_photoNomultipart/form-data file
Success 201
{
  "status": true,
  "message": "Customer created and assigned to you",
  "data": {
    "id": 10,
    "status": "reschedule",
    "reschedule_date_time": "2026-08-26 11:00:00",
    "summary": "Meeting rescheduled for Wednesday morning",
    "lat": 28.613939,
    "lng": 77.209021,
    "photo_path": null,
    "photo_url": null,
    "assigned_sales_person_id": 5,
    "assigned_sales_person": {
      "id": 5,
      "full_name": "Amit Kumar",
      "mobile": "9876500001"
    }
  }
}
Errors
  • 422 — missing lat/lng (lang), validation, duplicate mobile, missing reschedule_date_time
  • 403 — device not approved
PUT/customers/{id}JWT required
Update customer

Same fields as create. Own customers only. lat/lng optional (keeps previous if omitted).

Postman
PUT https://sales.anoopjewellers.co.in/api/v1/customers/10
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "name": "Priya Verma",
  "mobile": "9876543210",
  "email": "priya@example.com",
  "address": "Mumbai Andheri",
  "pin_code": "400053",
  "customer_type": "retail",
  "notes": "Follow up next week",
  "status": "interested",
  "summary": "Confirmed interested in gold bangles set",
  "lat": 28.613939,
  "lng": 77.209021
}
POST/customers/{id}/follow-upJWT required
Add follow-up entry

Also POST /customers/{id}/follow_up. Updates customer status + logs follow-up. Optional photo.

Postman
POST https://sales.anoopjewellers.co.in/api/v1/customers/10/follow-up
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "status": "reschedule",
  "reschedule_date_time": "2026-08-28 14:00:00",
  "summary": "Call back on Friday afternoon",
  "lat": 28.613939,
  "lng": 77.209021
}
{
  "status": true,
  "message": "Follow-up recorded successfully",
  "data": {
    "follow_up_id": 15,
    "customer_id": 10,
    "status": "reschedule",
    "reschedule_date_time": "2026-08-28 14:00:00",
    "summary": "Call back on Friday afternoon",
    "photo_path": null,
    "photo_url": null
  }
}
POST/customers/{id}/photoJWT required
Upload visit photo

multipart/form-data. Field: photo | image | visit_photo.

POST https://sales.anoopjewellers.co.in/api/v1/customers/10/photo
Authorization: Bearer {{access_token}}
Body → form-data:
  photo = (file)
  lat = 28.613939   (optional; also alt)
  lng = 77.209021   (optional; also lang)
  notes = Store front photo
DELETE/customers/{id}JWT required
Delete customer

Soft-delete own customer.

Postman
DELETE https://sales.anoopjewellers.co.in/api/v1/customers/10
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Customer deleted",
  "data": []
}

Orders

GET/ordersJWT required
List my orders

Orders created by logged-in sales person.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/orders?page=1&per_page=20&status=pending&search=ORD
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
GET/orders/{id}JWT required
Get order + items

Order detail with line items.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/orders/1
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "id": 1,
    "order_number": "ORD20260800001",
    "customer_id": 10,
    "customer_name": "Priya Verma",
    "sales_person_id": 5,
    "total_amount": "48500.00",
    "status": "pending",
    "payment_mode": "upi",
    "payment_status": "pending",
    "order_date": "2026-08-11",
    "items": [
      {
        "id": 1,
        "item_name": "Gold Ring 22K",
        "quantity": 1,
        "price": "45000.00"
      },
      {
        "id": 2,
        "item_name": "Silver Chain",
        "quantity": 1,
        "price": "3500.00"
      }
    ]
  }
}
POST/ordersJWT required
Create order

At least one item required. customer_id must be yours.

Postman
POST https://sales.anoopjewellers.co.in/api/v1/orders
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "customer_id": 10,
  "payment_mode": "upi",
  "payment_status": "pending",
  "status": "pending",
  "notes": "Deliver after festival",
  "order_date": "2026-08-11",
  "items": [
    { "item_name": "Gold Ring 22K", "quantity": 1, "price": 45000 },
    { "name": "Silver Chain", "quantity": 1, "price": 3500 }
  ]
}
Required

customer_id, items[] with price and item_name (or name), optional quantity (default 1)

Success 201
{
  "status": true,
  "message": "Order created",
  "data": {
    "id": 1,
    "order": { }
  }
}

Status values: pending, approved, rejected, completed, cancelled

PUT/orders/{id}JWT required
Update order

Update payment/status/notes (not line items).

Postman
PUT https://sales.anoopjewellers.co.in/api/v1/orders/1
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "payment_mode": "cash",
  "payment_status": "paid",
  "status": "completed",
  "notes": "Collected in full"
}

Leave

POST/leave/requestJWT required
Request leave

Creates pending leave; notifies admins.

Postman
POST https://sales.anoopjewellers.co.in/api/v1/leave/request
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "leave_date": "2026-08-20",
  "leave_to_date": "2026-08-21",
  "leave_type": "casual",
  "reason": "Family function",
  "notes": "Will be reachable on phone"
}

leave_type examples: casual, sick, emergency

{
  "status": true,
  "message": "Leave request submitted",
  "data": { "id": 7 }
}
GET/leave/historyJWT required
Leave history

Last 100 leave requests.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/leave/history
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
GET/leave/statusJWT required
Pending leave status

Only pending requests.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/leave/status
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "pending": [],
    "count": 0
  }
}

Team

GET/team/performanceJWT required
Team performance

Your team members + daily/monthly sales.

Postman
GET https://sales.anoopjewellers.co.in/api/v1/team/performance
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "team": { "id": 1, "name": "North Zone" },
    "members": [
      {
        "id": 5,
        "full_name": "Amit Kumar",
        "mobile": "9876500001",
        "monthly_sales": "540000.00",
        "daily_sales": "125000.00"
      }
    ]
  }
}
GET/team/leaderboardJWT required
Leaderboard

Query: period=daily|weekly|monthly

Postman
GET https://sales.anoopjewellers.co.in/api/v1/team/leaderboard?period=monthly
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "period": "monthly",
    "leaderboard": [
      {
        "rank": 1,
        "id": 5,
        "full_name": "Amit Kumar",
        "city": "Delhi",
        "team_name": "North Zone",
        "total_sales": "540000.00",
        "orders_count": 12
      }
    ]
  }
}

Notifications

GET/notificationsJWT required
List notifications

Paginated. Query: page

Postman
GET https://sales.anoopjewellers.co.in/api/v1/notifications?page=1
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json
{
  "status": true,
  "message": "Success",
  "data": {
    "data": [
      {
        "id": 3,
        "title": "Leave approved",
        "body": "Your leave on 2026-08-20 was approved",
        "type": "leave",
        "is_read": 0
      }
    ],
    "unread": 1,
    "meta": {
      "current_page": 1,
      "per_page": 30,
      "total": 1,
      "last_page": 1
    }
  }
}
POST/notification/readJWT required
Mark notification read

Body: id or notification_id

Postman
POST https://sales.anoopjewellers.co.in/api/v1/notification/read
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "id": 3
}
POST/subscribe_notificationJWT required
Register FCM Push Token

Body: fcm_token, device_type

Postman
POST https://sales.anoopjewellers.co.in/api/v1/subscribe_notification
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "fcm_token": "fcm_token_sample_string",
  "device_type": "android"
}

Devices & Security

POST/request_device_accessJWT required
Request Device Approval

Body: device_id, device_name, device_model, os_version

Postman
POST https://sales.anoopjewellers.co.in/api/v1/request_device_access
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "device_id": "unique_device_uuid_12345",
  "device_name": "Samsung S23",
  "device_model": "SM-S911B",
  "os_version": "Android 14"
}
POST/check_device_statusJWT required
Check Device Approval Status

Body: device_id or Header: X-Device-Id

Postman
POST https://sales.anoopjewellers.co.in/api/v1/check_device_status
Authorization: Bearer {{access_token}}
Content-Type: application/json
Accept: application/json

{
  "device_id": "unique_device_uuid_12345"
}

DB migration (browser)

Protected by MIGRATION_KEY in .env.production (live) or .env.local (local). Set a long random secret before use. Prefer SSH php database/migrate.php on production when possible.
GET/migrate.phpPublic
Run database migration

Upgrades DB schema. Not under /api/v1 — lives at site root /migrate.php

URL (production)
GET https://sales.anoopjewellers.co.in/migrate.php?key=YOUR_MIGRATION_KEY&type=all
URL (local WAMP)
GET https://sales.anoopjewellers.co.in/migrate.php?key=local_migration_key_change_me&type=all
Query params
ParamRequiredValues
keyYesMIGRATION_KEY from env file
typeNoall (default), main, unique_mobile
Success 200
{
  "status": true,
  "message": "Migration completed",
  "data": {
    "type": "all",
    "lines": [
      "Running customer column upgrades...",
      "Main migration complete.",
      "Unique mobile migration complete."
    ]
  }
}
Errors
  • 403 — wrong or missing key
  • 503 — MIGRATION_KEY not configured
  • 500 — database / SQL failure

Error codes

HTTPMeaningTypical cause
200OKSuccessful read/update
201CreatedCustomer / order / leave created
400Bad requestBusiness rule (already checked in, etc.)
401UnauthorizedMissing/invalid/expired JWT
404Not foundUnknown id or not assigned to you
422Validation failedSee errors object
429Too many requestsRate limit / login throttle
500Server errorCheck server logs

Flutter / Postman checklist

  1. Import docs/postman/Anoop_Jewellers_Sales_API.postman_collection.json
  2. Set base_url → https://sales.anoopjewellers.co.in/api/v1
  3. Login with a sales person account from Admin
  4. Suggested order: Login → Dashboard → Check-in → Create Customer → Create Order → Targets → Leave → Logout
Dio snippet
final dio = Dio(BaseOptions(
  baseUrl: 'https://sales.anoopjewellers.co.in/api/v1/',
  headers: {'Accept': 'application/json'},
));
dio.options.headers['Authorization'] = 'Bearer $accessToken';
final res = await dio.get('dashboard');

Anoop Jewellers Sales API v1 · Flutter Android · Same DB as Admin Panel