Skip to main content

Overview

The MechZie admin panel is a separate web application that communicates with the same API using admin or super_admin JWT tokens. Admins authenticate via Firebase email/password (not phone OTP) through a dedicated endpoint.

Admin Login

1

Sign in via Firebase email/password

Use the Firebase JS SDK in the admin panel:
2

Exchange Firebase token for MechZie JWT

Response (200):
Returns 401 if Firebase email is unverified, or no admin account exists for that email. Returns 403 if the account’s role is customer or mechanic.
3

Use the access token

Store and use accessToken as a Bearer token for all admin API calls. Refresh using POST /auth/refresh like any other role.

Payments

List Payments

GET /admin/payments Returns a paginated list of all payments with joined customer and mechanic details. Amounts are in paisa (÷ 100 = ₹). Query parameters:
Response (200):

Payment Stats

GET /admin/payments/stats Returns aggregate stats across all payments in a single query.
Response (200):

Invites (super_admin only)

All /super-admin/* endpoints require the super_admin role. admin accounts receive 403.

List Invites

GET /super-admin/invites Returns all invites (pending, used, and revoked) ordered newest-first. The invite token hash is never included in the response.
Response (200):
invited_by_name is null if the inviting super_admin account has been deleted.

Endpoint Summary