Base URL:
https://tripfy.africa/api/v1All requests and responses use application/json. Character encoding is UTF-8.Authentication
The API uses Laravel Sanctum bearer tokens. Obtain a token by callingPOST /api/v1/auth/login or POST /api/v1/auth/register, then include it in every authenticated request:
Rate limiting
Three tiers apply depending on the endpoint type:| Endpoint type | Limit | Window |
|---|---|---|
| Public endpoints | 60 requests | per minute |
Auth endpoints (/auth/register, /auth/login) | 10 requests | per minute |
| Write endpoints | 30 requests | per minute |
429:
Response format
Success response
data and include a meta object:
Error response
HTTP status codes
| Code | Meaning | When it is returned |
|---|---|---|
200 | OK | Successful GET, PUT |
201 | Created | Successful POST that creates a resource |
401 | Unauthorized | Missing or invalid token |
403 | Forbidden | Authenticated but not permitted (e.g. suspended account) |
404 | Not found | Resource does not exist |
422 | Unprocessable entity | Validation failure |
429 | Too many requests | Rate limit exceeded |
500 | Internal server error | Unexpected server-side error |
Pagination
List endpoints return paginated results. Control the page with query parameters:Page number to return. Defaults to
1.Number of items per page. Defaults to
12 for packages, 15 for bookings and reviews. Maximum is 50.meta object contains:
The page number returned.
Total number of pages.
Items returned per page.
Total number of matching items across all pages.
Filtering and sorting
Most list endpoints accept these common query parameters:Full-text search against
title and description fields.Filter packages by destination ID.
Filter packages by category ID.
Minimum adult price filter (inclusive).
Maximum adult price filter (inclusive).
Sort order. Accepted values:
newest (default), price_asc, price_desc, rating.Data formats
- Dates — ISO 8601 strings, e.g.
2024-01-15or2024-01-15T10:30:00Z. - Prices — Decimal floats in USD, e.g.
250.00. - Coordinates — Decimal degrees, e.g.
{ "latitude": -6.1659, "longitude": 35.7363 }. - Boolean flags — JSON
true/false.
Endpoint index
Authentication (public)
| Method | Path | Description |
|---|---|---|
POST | /api/v1/auth/register | Register a new traveller account |
POST | /api/v1/auth/login | Log in and receive a token |
Authentication (requires token)
| Method | Path | Description |
|---|---|---|
GET | /api/v1/auth/me | Return the authenticated user |
POST | /api/v1/auth/logout | Revoke the current token |
POST | /api/v1/auth/logout-all | Revoke all tokens for the user |
Packages (public)
| Method | Path | Description |
|---|---|---|
GET | /api/v1/packages | List active packages |
GET | /api/v1/packages/categories | List package categories |
GET | /api/v1/packages/featured | List featured packages |
GET | /api/v1/packages/{slug} | Package detail |
GET | /api/v1/packages/{slug}/reviews | Reviews for a package |
Destinations (public)
| Method | Path | Description |
|---|---|---|
GET | /api/v1/destinations | List active destinations |
GET | /api/v1/destinations/{slug} | Destination detail with packages |
Bookings
| Method | Path | Auth | Description |
|---|---|---|---|
GET | /api/v1/bookings/availability | Public | Check available spaces for a date |
GET | /api/v1/bookings | Required | List bookings for the current user |
GET | /api/v1/bookings/{uid} | Required | Single booking detail |
POST | /api/v1/bookings/{uid}/cancel | Required | Cancel a pending or confirmed booking |
Reviews
| Method | Path | Auth | Description |
|---|---|---|---|
GET | /api/v1/packages/{slug}/reviews | Public | List approved reviews |
POST | /api/v1/reviews | Required | Submit a review |
User profile (requires token)
| Method | Path | Description |
|---|---|---|
GET | /api/v1/user/profile | Get full profile |
PUT | /api/v1/user/profile | Update profile fields |
PUT | /api/v1/user/password | Change password |
GET | /api/v1/user/stats | Booking statistics summary |
Payment webhooks
| Method | Path | Description |
|---|---|---|
GET / POST | /api/payment/{gateway}/{transaction}/{type} | Payment gateway IPN callback |