Service Call API

Clarion IT ERP — for website integration and WhatsApp team.

Also see: All API links · Delivery Challan API · User Manual

Base URL
https://erp.clarionit.in

Auth header (same for all endpoints):

Authorization: Bearer YOUR_BOT_API_TOKEN
# or
X-Api-Key: YOUR_BOT_API_TOKEN

The token comes from ERP .env → BOT_API_TOKEN. Do not put it in browser JavaScript — call the API from your server/backend only.

1) Website — ready form (no API key needed)

Company form (website / WhatsApp bot — call belongs to Company, not a sales person):

https://erp.clarionit.in/service_call/company

Website button / iframe:

<a href="https://erp.clarionit.in/service_call/company" target="_blank">Request Service</a>

<iframe
  src="https://erp.clarionit.in/service_call/company"
  style="width:100%;min-height:720px;border:0;border-radius:12px;"
  title="Clarion IT Service Request">
</iframe>

Personal sales form (optional — assigns to that sales person):

https://erp.clarionit.in/service_call/{sales-person-name-slug}
# example
https://erp.clarionit.in/service_call/toshan-dhiwar
# legacy id still works
https://erp.clarionit.in/service_call/13

2) Create Service Call (Website backend / WhatsApp bot)

POST /api/service-calls

Company-owned call — omit sales_person_id (recommended for website + WhatsApp bot):

curl -X POST "https://erp.clarionit.in/api/service-calls" \
  -H "Authorization: Bearer YOUR_BOT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Customer Name",
    "phone": "98XXXXXXXX",
    "address": "Full site address",
    "requirement": "Printer not working",
    "notes": "Prefer morning visit",
    "source": "whatsapp"
  }'

Sales-person call — only when you intentionally route to one person:

curl -X POST "https://erp.clarionit.in/api/service-calls" \
  -H "Authorization: Bearer YOUR_BOT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "sales_person_id": 13,
    "name": "Customer Name",
    "phone": "98XXXXXXXX",
    "address": "Full site address",
    "requirement": "Printer not working",
    "notes": "Prefer morning visit",
    "source": "website"
  }'

Fields

Success (201)

{
  "success": true,
  "message": "Service call created.",
  "data": {
    "id": 123,
    "ref_no": "SC/123",
    "sales_person_id": 13,
    "name": "Customer Name",
    "phone": "98XXXXXXXX",
    "status": 0,
    "status_label": "Fresh",
    "created_at": "2026-07-22T10:00:00+05:30"
  }
}

3) Get Service Call Status

GET /api/service-calls/{id}
curl "https://erp.clarionit.in/api/service-calls/123" \
  -H "Authorization: Bearer YOUR_BOT_API_TOKEN" \
  -H "Accept: application/json"

Response includes pickup_drop counts, plus visits, service_visits, and pickup_drops.

4) Assign Pickup / Drop

POST /api/service-calls/{id}/pickup-drop
curl -X POST "https://erp.clarionit.in/api/service-calls/123/pickup-drop" \
  -H "Authorization: Bearer YOUR_BOT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "engineer_id": [42],
    "date": "2026-09-15",
    "pickup_drop_kind": "pickup",
    "vendor_name": "ABC CCTV Supplier",
    "vendor_address": "Pandri, Raipur",
    "remark": "4 cameras + 1 DVR"
  }'

Complete it with POST /api/visits/{visit_id}/status and status: 3. Telegram will show Pickup / Drop Update.

5) List Sales People (for WhatsApp routing)

GET /api/sales-people
curl "https://erp.clarionit.in/api/sales-people" \
  -H "Authorization: Bearer YOUR_BOT_API_TOKEN" \
  -H "Accept: application/json"

The response includes each sales person’s id, name, and ready form_url.

Errors

Security
Keep the token only on the WhatsApp provider server or your website backend. Do not expose the API token in public website JavaScript — use the form link/iframe, or call the ERP API from your own server.