API

Mobile app & partner contract

Bearer tokens power the native Android app. Partner platforms use an admin-issued X-Api-Key on public/* routes. Full markdown: documentation/API.md.

Base URL & envelope

Query style:

https://meromachine.com.sociobytes.com/api/index.php?route=

Pretty path:

https://meromachine.com.sociobytes.com/api/v1/

Success: { "ok": true, "data": … }. Error: { "ok": false, "error": "…" }. Rate limit ~120/min.

App auth (Bearer)

POST auth/register · POST auth/login with login (email or phone), password, optional otp for 2FA · GET auth/me · POST auth/logout

POST auth/verify with email_code + sms_code · POST auth/resend

Authorization: Bearer YOUR_TOKEN

Catalog

GET categories · GET cities · GET skills

GET technicians (filters: q, category_id, online, verified, lat, lng, radius…)

GET technicians/{id} · GET services · GET services/{id}

GET blogs · GET blogs/{slug}

Customer

GET/POST favorites · DELETE favorites/{technician_id}

POST jobs / POST instant-requests · GET jobs · GET jobs/{id}

POST jobs/{id}/choose · counter · raise

POST quotations/{id}/accept|reject

Technician

GET technician/requests · accept / decline / quote

POST technician/availability · location · skills · kyc

GET/POST technician/services · update / delete / toggle_active

GET earnings (includes payments ledger)

Bookings, chat, live pulse

GET bookings · status · otp · pay · review · complaint

GET conversations · messages (after) · send

GET notifications · POST notifications/read

GET pulse?since= — unread, notes, incoming requests, customer accepts, waiting jobs

PUT me — profile update for either role

Partner API (X-Api-Key)

Keys are issued by a Mero Machine admin (Admin → API access). Test keys start with np_test_, production with np_live_.

X-Api-Key: np_test_your_key

GET public/categories · cities · professionals · blogs

POST public/jobs · GET public/jobs/{id}

{
  "customer_name": "Sita Sharma",
  "customer_email": "sita@example.com",
  "customer_phone": "9800000000",
  "category_id": 1,
  "city": "Kathmandu",
  "address": "Naxal",
  "description": "Kitchen tap is leaking",
  "budget": 1500,
  "title": "Fix kitchen tap",
  "external_ref": "order-1042"
}

Examples

curl "https://meromachine.com.sociobytes.com/api/index.php?route=health"

curl -X POST "https://meromachine.com.sociobytes.com/api/index.php?route=auth/login" \
  -H "Content-Type: application/json" \
  -d '{"login":"you@example.com","password":"secret"}'

curl -X POST "https://meromachine.com.sociobytes.com/api/index.php?route=auth/login" \
  -H "Content-Type: application/json" \
  -d '{"login":"9800000000","password":"secret"}'

curl -H "X-Api-Key: np_test_your_key" \
  "https://meromachine.com.sociobytes.com/api/index.php?route=public/categories"

Android emulator host: http://10.0.2.2/nepalipro/api/v1/