Organization API
Create, retrieve, update, and delete organizations. Manage default check-in / check-out times.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /api/organization/create | Create a new organization |
| GET | /api/organization/:orgid | Get organization details |
| PUT | /api/organization/:orgid/update | Update organization |
| GET | /api/organization/:orgid/default-time | Get default check-in / check-out times |
| PUT | /api/organization/:orgid/default-time | Update default times |
| DELETE | /api/organization/:orgid/delete | Delete organization |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
orgid | string | Organization ID |
Create Organization
POST /api/organization/createRequest Body
json
{
"name": "Grand Palace Hotel",
"email": "info@grandpalace.com",
"phone": "+91-9876543210",
"gstin": "27AABCG1234H1Z5",
"pan": "AABCG1234H",
"address": {
"line1": "12 Marine Drive",
"line2": "",
"city": "Mumbai",
"state": "Maharashtra",
"pincode": "400020",
"country": "India"
},
"currency": "INR",
"timezone": "Asia/Kolkata",
"logo": "https://storage.example.com/logos/grand-palace.png",
"defaultCheckInTime": "14:00",
"defaultCheckOutTime": "11:00"
}Response — 201 Created
json
{
"success": true,
"message": "Organization created successfully",
"data": {
"_id": "663f1a2b3c4d5e6f7a8b9c0d",
"name": "Grand Palace Hotel",
"email": "info@grandpalace.com",
"phone": "+91-9876543210",
"gstin": "27AABCG1234H1Z5",
"pan": "AABCG1234H",
"address": {
"line1": "12 Marine Drive",
"line2": "",
"city": "Mumbai",
"state": "Maharashtra",
"pincode": "400020",
"country": "India"
},
"currency": "INR",
"timezone": "Asia/Kolkata",
"logo": "https://storage.example.com/logos/grand-palace.png",
"defaultCheckInTime": "14:00",
"defaultCheckOutTime": "11:00",
"createdAt": "2026-02-23T10:00:00.000Z",
"updatedAt": "2026-02-23T10:00:00.000Z"
}
}Get Organization
GET /api/organization/:orgidResponse — 200 OK
json
{
"success": true,
"data": {
"_id": "663f1a2b3c4d5e6f7a8b9c0d",
"name": "Grand Palace Hotel",
"email": "info@grandpalace.com",
"phone": "+91-9876543210",
"gstin": "27AABCG1234H1Z5",
"pan": "AABCG1234H",
"address": {
"line1": "12 Marine Drive",
"line2": "",
"city": "Mumbai",
"state": "Maharashtra",
"pincode": "400020",
"country": "India"
},
"currency": "INR",
"timezone": "Asia/Kolkata",
"logo": "https://storage.example.com/logos/grand-palace.png",
"defaultCheckInTime": "14:00",
"defaultCheckOutTime": "11:00",
"createdAt": "2026-02-23T10:00:00.000Z",
"updatedAt": "2026-02-23T10:00:00.000Z"
}
}Update Organization
PUT /api/organization/:orgid/updateRequest Body
json
{
"name": "Grand Palace Hotel & Spa",
"phone": "+91-9876543299",
"address": {
"line1": "12 Marine Drive",
"line2": "Tower B",
"city": "Mumbai",
"state": "Maharashtra",
"pincode": "400020",
"country": "India"
}
}Response — 200 OK
json
{
"success": true,
"message": "Organization updated successfully",
"data": {
"_id": "663f1a2b3c4d5e6f7a8b9c0d",
"name": "Grand Palace Hotel & Spa",
"email": "info@grandpalace.com",
"phone": "+91-9876543299",
"gstin": "27AABCG1234H1Z5",
"pan": "AABCG1234H",
"address": {
"line1": "12 Marine Drive",
"line2": "Tower B",
"city": "Mumbai",
"state": "Maharashtra",
"pincode": "400020",
"country": "India"
},
"currency": "INR",
"timezone": "Asia/Kolkata",
"logo": "https://storage.example.com/logos/grand-palace.png",
"defaultCheckInTime": "14:00",
"defaultCheckOutTime": "11:00",
"createdAt": "2026-02-23T10:00:00.000Z",
"updatedAt": "2026-02-23T11:30:00.000Z"
}
}Get Default Time
GET /api/organization/:orgid/default-timeResponse — 200 OK
json
{
"success": true,
"data": {
"defaultCheckInTime": "14:00",
"defaultCheckOutTime": "11:00"
}
}Update Default Time
PUT /api/organization/:orgid/default-timeRequest Body
json
{
"defaultCheckInTime": "15:00",
"defaultCheckOutTime": "12:00"
}Response — 200 OK
json
{
"success": true,
"message": "Default times updated successfully",
"data": {
"defaultCheckInTime": "15:00",
"defaultCheckOutTime": "12:00"
}
}Delete Organization
DELETE /api/organization/:orgid/deleteResponse — 200 OK
json
{
"success": true,
"message": "Organization deleted successfully"
}