Company Reference
Complete reference for company fields and configuration options
Company Reference
This reference documents all company fields, settings, and configuration options.
Company Fields
Basic Information
| Field | Type | Required | Max Length | Description |
|---|---|---|---|---|
name | String | Yes | 200 | Company display name |
slug | String | Yes | 100 | URL-friendly unique identifier |
verifiedDomains | String[] | Yes | — | Email domains for user matching |
allowAutoSignup | Boolean | No | — | Auto-activate users (default: true) |
isActive | Boolean | No | — | Company operational status (default: true) |
Booking Engine Configuration
| Field | Type | Required | Max Length | Description |
|---|---|---|---|---|
bookingEngineClientId | String | No | 255 | OAuth client identifier |
bookingEngineClientSecret | String | No | 255 | OAuth client secret (encrypted) |
bookingEngineScopes | String | No | 500 | Space-separated OAuth scopes |
bookingEngineBaseUrl | String | No | 500 | API base URL (must be valid URL) |
bookingEngineTokenUrl | String | No | 500 | Token endpoint URL (must be valid URL) |
System Fields
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier (CUID) |
createdAt | DateTime | Creation timestamp |
updatedAt | DateTime | Last update timestamp |
deletedAt | DateTime | Soft delete timestamp (null if not deleted) |
Field Validations
Slug Format
The slug must use lowercase letters, numbers, and hyphens only.
| Example | Valid? | Notes |
|---|---|---|
acme | ✅ | Simple slug |
acme-corp | ✅ | Hyphen separator |
global-travel-inc | ✅ | Multiple hyphens |
company123 | ✅ | Numbers allowed |
Acme | ❌ | Uppercase not allowed |
acme_corp | ❌ | Underscores not allowed |
acme corp | ❌ | Spaces not allowed |
-acme | ❌ | Cannot start with hyphen |
URL Format
Booking engine URLs must be valid HTTP/HTTPS URLs.
| Example | Valid? | Notes |
|---|---|---|
https://api.supplier.com | ✅ | Standard HTTPS URL |
https://api.supplier.com/v1 | ✅ | With path |
http://localhost:3000 | ✅ | For development |
api.supplier.com | ❌ | Missing protocol |
ftp://api.supplier.com | ❌ | Wrong protocol |
https:// | ❌ | Incomplete URL |
Domain Format
Verified domains should be valid domain names without the @ symbol:
Valid examples:
acme.comacme.co.uksub.acme.com
Invalid examples:
@acme.com(includes @ symbol)acme(missing TLD)http://acme.com(includes protocol)
Default Values
| Field | Default Value |
|---|---|
allowAutoSignup | true |
isActive | true |
verifiedDomains | [] (empty array) |
bookingEngineClientId | null |
bookingEngineClientSecret | null |
bookingEngineScopes | null |
bookingEngineBaseUrl | null |
bookingEngineTokenUrl | null |
Company Relationships
Related Entities
| Relationship | Type | Description |
|---|---|---|
companyUsers | One-to-Many | User memberships in this company |
companyRoles | One-to-Many | Roles defined for this company |
policies | One-to-Many | Travel policies for this company |
budgets | One-to-Many | Budget configurations |
costCenters | One-to-Many | Organizational cost centers |
bookingRequests | One-to-Many | Booking requests from users |
orders | One-to-Many | Completed bookings |
userDelegations | One-to-Many | Delegation relationships |
budgetSettings | One-to-One | Company-wide budget settings |
Automatic Behaviors
On Company Creation
When a new company is created:
-
Predefined Roles — Three roles are automatically created:
- Member (basic permissions)
- Manager (oversight permissions)
- Admin (full permissions)
-
Default Settings — Company starts with:
- Active status
- Auto-signup enabled
- No booking engine configuration
On Company Deletion
When a company is soft-deleted:
deletedAttimestamp is set- Company excluded from normal queries
- All users lose access
- Data preserved for potential recovery
Security
Credential Protection
When viewing company details, the booking engine client secret is never displayed. Instead, a hasConfiguredCredentials indicator shows whether credentials have been set.
The booking engine client secret is never shown after being saved. Keep a secure backup of your credentials.
Status Reference
Company Status
| Status | isActive | deletedAt | User Access |
|---|---|---|---|
| Active | true | null | Full access |
| Inactive | false | null | Blocked |
| Deleted | — | Set | Blocked |
Status Transitions
Error Codes
| Error | Description | Resolution |
|---|---|---|
SLUG_EXISTS | Slug already used by another company | Use a different slug |
COMPANY_NOT_FOUND | Company ID doesn't exist | Check company ID |
DOMAIN_ALREADY_CLAIMED | Domain belongs to another company | Contact platform admin |
INVALID_URL | URL format is incorrect | Use valid HTTP/HTTPS URL |
INVALID_DOMAIN | Domain format is incorrect | Use domain without @ or protocol |
COMPANY_INACTIVE | Company is deactivated | Activate the company |
COMPANY_DELETED | Company was deleted | Contact platform admin |
Query Filters
Available Filters
| Filter | Type | Description |
|---|---|---|
search | String | Search by name or slug |
isActive | Boolean | Filter by active status |
allowAutoSignup | Boolean | Filter by auto-signup setting |
createdAtFrom | DateTime | Created after date |
createdAtTo | DateTime | Created before date |
Sort Options
| Field | Description |
|---|---|
createdAt | Sort by creation date |
name | Sort alphabetically |
isActive | Sort by status |