Tripza
Enterprise Feature

Enterprise API Integration

Connect your fleet management system directly to Tripzen's booking engine. Secure, real-time, and scalable.

Authentication

All requests to the Enterprise API must be authenticated using an API Key. You can find your API key in the Operator Dashboard settings under API Integrations.

Security Requirements

X-API-KEY: <YOUR_API_KEY>

Enterprise Plan Required

API access is exclusive to partners on the Enterprise subscription tier. Access will be rejected for Starter or Professional accounts.

API Endpoints

Explore the core capabilities of the Tripzen Enterprise API.

POST
/api/enterprise/trips

Synchronize trip details from your system to Tripzen.

{
  "origin": "Colombo",
  "destination": "Kandy",
  "departureDate": "2024-06-15",
  "departureTime": "08:30",
  "fare": 1500.00,
  "vehicleNumber": "NB-1234",
  "totalSeats": 42
}
GET
/api/enterprise/seats?tripId={id}

Query real-time seat availability for a specific trip.

POST
/api/enterprise/bookings

Submit a new booking request to the Tripzen system.

{
  "tripId": "123",
  "seatNumber": "1A,1B",
  "passengerName": "John Doe",
  "phoneNumber": "0771234567",
  "paymentStatus": "PAID"
}

Webhook Notifications

Receive real-time notifications about booking events. Configure your endpoint in the dashboard.

Best Practices

Follow these guidelines to ensure a robust, secure, and performant integration with the Tripzen platform.

Tenant Isolation

Our API enforces strict tenant isolation. Your API key guarantees that you can only read, modify, or book seats on your own trips.

Attempting to pass a tripId belonging to another operator will result in a 403 Forbidden or 401 Unauthorized error.

Key Rotation

Never commit your API key to version control or hardcode it in frontend code (like mobile apps or websites).

If you suspect your key is compromised, immediately click Revoke Key in your Tripzen dashboard and generate a new one.

Idempotent Bookings

When calling POST /api/enterprise/bookings, handle network timeouts gracefully. Do not blindly retry without checking if the booking was already created.

Store the returned bookingId (e.g., ENT-123456) in your local database immediately.

Use Webhooks over Polling

Do not repeatedly call the GET /seats endpoint to check for new bookings on a trip.

Instead, subscribe to the booking.created and booking.cancelled webhooks to have Tripzen push updates directly to your system in real-time.

Need Technical Assistance?

Our developer relations team is available to help you with your integration.