Skip to main content
This page covers all public read endpoints for packages, categories, destinations, and availability, plus the authenticated endpoint for submitting reviews.

List packages

Return a paginated list of active tour packages. Only packages belonging to guides with an active subscription plan are included.
GET /api/v1/packages

Query parameters

Full-text search against title and description.
destination_id
integer
Filter by destination ID.
category_id
integer
Filter by package category ID.
min_price
number
Minimum adult price (inclusive).
max_price
number
Maximum adult price (inclusive).
sort
string
Sort order. One of: newest (default), price_asc, price_desc, rating.
per_page
integer
Items per page. Maximum 50. Defaults to 12.

Response 200 OK

data
array
Array of package summary objects.
meta
object
Pagination metadata: current_page, last_page, per_page, total.
{
  "data": [
    {
      "id": 1,
      "title": "Serengeti Safari Adventure",
      "slug": "serengeti-safari-adventure",
      "destination": "Serengeti",
      "category": "Safari",
      "duration": 5,
      "adult_price": 450.00,
      "children_price": 225.00,
      "infant_price": 0.00,
      "is_featured": true,
      "discount": true,
      "discount_amount": 10,
      "discount_type": 0,
      "cover_image": "https://tripfy.africa/assets/upload/packages/serengeti.jpg",
      "review_count": 34,
      "review_average": 4.7,
      "max_travelers": 8,
      "guide": "James Oduya"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 4,
    "per_page": 12,
    "total": 47
  }
}
# All packages
curl "https://tripfy.africa/api/v1/packages"

# Safari packages under $500, sorted cheapest first
curl "https://tripfy.africa/api/v1/packages?category_id=2&max_price=500&sort=price_asc"

List categories

Return all active package categories. Use the id field to filter the packages list.
GET /api/v1/packages/categories

Response 200 OK

data
array
{
  "data": [
    { "id": 1, "name": "Beach", "image": "https://tripfy.africa/assets/upload/categories/beach.jpg" },
    { "id": 2, "name": "Safari", "image": "https://tripfy.africa/assets/upload/categories/safari.jpg" },
    { "id": 3, "name": "Cultural", "image": "https://tripfy.africa/assets/upload/categories/cultural.jpg" }
  ]
}
curl https://tripfy.africa/api/v1/packages/categories

Return up to 10 currently featured packages ordered by newest first. Intended for home-screen carousels.
GET /api/v1/packages/featured

Response 200 OK

Same package summary shape as list packages, wrapped in data. No pagination — always returns at most 10 items.
{
  "data": [
    {
      "id": 7,
      "title": "Zanzibar Spice Tour",
      "slug": "zanzibar-spice-tour",
      "destination": "Zanzibar",
      "category": "Cultural",
      "duration": 1,
      "adult_price": 85.00,
      "is_featured": true,
      "review_average": 4.9,
      "cover_image": "https://tripfy.africa/assets/upload/packages/spice.jpg"
    }
  ]
}
curl https://tripfy.africa/api/v1/packages/featured

Package detail

Return full details for a single active package, including media, itinerary, amenities, related packages, and a preview of reviews.
GET /api/v1/packages/{slug}

Path parameter

slug
string
required
The package’s URL slug, e.g. serengeti-safari-adventure.

Response 200 OK

Includes all summary fields plus:
data
object
{
  "data": {
    "id": 1,
    "title": "Serengeti Safari Adventure",
    "slug": "serengeti-safari-adventure",
    "duration": 5,
    "adult_price": 450.00,
    "description": "<p>Witness the Great Migration...</p>",
    "time_slots": ["06:00", "14:00"],
    "media": [
      "https://tripfy.africa/assets/upload/packages/img1.jpg",
      "https://tripfy.africa/assets/upload/packages/img2.jpg"
    ],
    "reviews": [
      {
        "id": 12,
        "rating": 5,
        "comment": "Absolutely breathtaking experience.",
        "user": "Sofia Müller",
        "created_at": "2024-05-20"
      }
    ],
    "related": []
  }
}
curl https://tripfy.africa/api/v1/packages/serengeti-safari-adventure

Package reviews

Return a paginated list of approved top-level reviews for a package, along with the overall average rating.
GET /api/v1/packages/{slug}/reviews

Path parameter

slug
string
required
The package slug.

Response 200 OK

data
array
Array of approved reviews, 10 per page.
meta
object
{
  "data": [
    {
      "id": 12,
      "rating": 5,
      "comment": "One of the best safari experiences of my life.",
      "user": { "name": "Sofia Müller", "image": null },
      "created_at": "2024-05-20"
    }
  ],
  "meta": {
    "average": 4.7,
    "total": 34
  }
}
curl "https://tripfy.africa/api/v1/packages/serengeti-safari-adventure/reviews"

List destinations

Return all active destinations ordered by visitor count (most visited first).
GET /api/v1/destinations

Response 200 OK

data
array
{
  "data": [
    {
      "id": 1,
      "title": "Zanzibar",
      "slug": "zanzibar",
      "description": "Spice island off the coast of Tanzania.",
      "image": "https://tripfy.africa/assets/upload/destinations/zanzibar.jpg",
      "visitor_count": 1240
    }
  ]
}
curl https://tripfy.africa/api/v1/destinations

Destination detail

Return a single destination together with up to 20 of its active packages (featured packages listed first).
GET /api/v1/destinations/{slug}

Path parameter

slug
string
required
The destination slug, e.g. zanzibar.

Response 200 OK

data
object
Destination fields plus a packages array.
{
  "data": {
    "id": 1,
    "title": "Zanzibar",
    "slug": "zanzibar",
    "description": "Spice island off the coast of Tanzania.",
    "image": "https://tripfy.africa/assets/upload/destinations/zanzibar.jpg",
    "visitor_count": 1240,
    "packages": [
      {
        "id": 7,
        "title": "Zanzibar Spice Tour",
        "slug": "zanzibar-spice-tour",
        "duration": 1,
        "adult_price": 85.00,
        "is_featured": true,
        "review_average": 4.9,
        "cover_image": "https://tripfy.africa/assets/upload/packages/spice.jpg"
      }
    ]
  }
}
curl https://tripfy.africa/api/v1/destinations/zanzibar

Check availability

Return the number of available spaces for a package on a specific date. No authentication required — useful for showing availability before a user logs in.
GET /api/v1/bookings/availability

Query parameters

package_slug
string
required
Slug of the package to check.
date
string
required
Date to check in YYYY-MM-DD format. Must be today or in the future.

Response 200 OK

package
string
Package title.
date
string
The requested date.
available
integer
Number of spaces still available on that date.
max
integer
Maximum group size configured for the package.
{
  "package": "Serengeti Safari Adventure",
  "date": "2024-08-15",
  "available": 4,
  "max": 8
}
curl "https://tripfy.africa/api/v1/bookings/availability?package_slug=serengeti-safari-adventure&date=2024-08-15"

Submit a review

Create a review for a package. The review is held for admin approval before it appears publicly. You must have a confirmed (status=1) or completed (status=2) booking for the package to submit a review, and you can only submit one review per package.
POST /api/v1/reviews
Requires authentication.

Request parameters

package_id
integer
required
The numeric ID of the package you are reviewing.
rating
integer
required
Star rating from 1 (worst) to 5 (best).
comment
string
required
Review text. Minimum 10 characters, maximum 1 000 characters.

Response 201 Created

message
string
"Review submitted and pending approval. Thank you!"
data
object
The newly created review object.
{
  "message": "Review submitted and pending approval. Thank you!",
  "data": {
    "id": 99,
    "rating": 5,
    "comment": "An unforgettable adventure from start to finish.",
    "user": { "name": "Amina Hassan", "image": null },
    "created_at": "2024-06-10"
  }
}
Submitting a second review for the same package returns 422 Unprocessable Entity with { "message": "You have already submitted a review for this package." }.
curl -X POST https://tripfy.africa/api/v1/reviews \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"package_id": 1, "rating": 5, "comment": "An unforgettable adventure from start to finish."}'

Build docs developers (and LLMs) love