Skip to main content

Get Company by ID API

Overview​

Retrieves full details of a corporate company, including associated departments, state master details, active employee bands, active approval policies, and object counts (users, bookings, invoices).

  • Endpoint: /api/companies/get-by-id
  • Method: GET
  • Access: Super Admin / Platform RM / Corporate Admin

Request Query Parameters​

ParameterTypeRequiredDescription
idString (UUID)YesTarget company ID

Request Example​

GET /api/companies/get-by-id?id=c478a846-993d-4c8d-bf8d-d77cb3370e01

Success Response (200 OK)​

{
"success": true,
"message": "Company details retrieved successfully",
"data": {
"id": "c478a846-993d-4c8d-bf8d-d77cb3370e01",
"name": "Abbott Healthcare",
"legalName": "Abbott Healthcare India Private Limited",
"gstin": "27AAACA0000A1Z5",
"gstType": "REGISTERED",
"panNumber": "AAACA0000A",
"address": "123 Business Park, BKC",
"stateId": 21,
"pincode": "400051",
"phone": "+912212345678",
"emailId": "info@abbott.com",
"website": "https://www.abbott.com",
"creditLimit": "1000000.00",
"creditDays": 30,
"priceToleranceType": "PERCENTAGE",
"priceTolerancePercent": "5.00",
"priceToleranceAmount": null,
"active": true,
"createdAt": "2026-08-24T12:00:00.000Z",
"updatedAt": "2026-08-24T12:00:00.000Z",
"departments": [
{
"id": "d1234567-89ab-cdef-0123-456789abcdef",
"companyId": "c478a846-993d-4c8d-bf8d-d77cb3370e01",
"name": "Marketing",
"budget": "500000.00",
"costCode": "MKT-01"
}
],
"state": {
"id": 21,
"name": "Maharashtra",
"countryId": 101,
"active": true
},
"employeeBands": [
{
"id": "b1234567-89ab-cdef-0123-456789abcdef",
"companyId": "c478a846-993d-4c8d-bf8d-d77cb3370e01",
"name": "Band 1",
"code": "B1",
"description": "Junior Executive Level Band",
"autoApprovalLimit": "7000.00",
"maxBookingLimit": "25000.00",
"active": true
}
],
"approvalPolicies": [
{
"id": "p1234567-89ab-cdef-0123-456789abcdef",
"companyId": "c478a846-993d-4c8d-bf8d-d77cb3370e01",
"name": "Standard Travel Policy",
"travelType": "FLIGHT",
"maxLevels": 3,
"autoApprovalLimit": "7000.00",
"escalationTimeMinutes": 20,
"reApprovalFareThresholdPercent": "5.00",
"active": true
}
],
"_count": {
"users": 45,
"bookings": 128,
"invoices": 12
}
}
}

Error Response (404 Not Found)​

{
"success": false,
"message": "Active company with ID 'c478a846-993d-4c8d-bf8d-d77cb3370e01' not found",
"data": null
}

Database Impact​

  • Tables: companies, departments, states, employee_bands, approval_policies
  • Operations: SELECT query with relational includes.