🚚
truQ Services
  • Getting Started
  • Environment
  • Status Codes
  • Booking Management
    • Trip Booking
      • Getting a Quote
      • Booking an open trip
      • Booking a standard trip
      • Booking a merchant trip
    • Payment and Order Confirmation
      • Standard trip order confirmation
      • Business trip order confirmation
  • Parameter Guide
    • Trip Types
    • Vehicle Categories
    • Source and Destination
Powered by GitBook
On this page
  1. Booking Management
  2. Trip Booking

Booking a standard trip

Booking a standard trip is a feature available on the customer dashboard, and via Open API that allows your customers to create a trip, while you manage the trip information processes from initiation to reconciliation.

So when your customers book a trip, they can view the trip on their dashboard, while you manage the trip process on your dashboard.

Collect trip information

The trip_type, category_size, scheduled_date, source, destination, and parameters are required to book a customer trip. They are not optional. The email, first_name, last_name, and phone fields allow us to validate the user.

The callback_url field is an optional field which redirects back to your application after a successful payment checkout.

Endpoint
https://dodge.truq.it/booking-service/booking/booking-trip/create_open_trip/
-H "Authorization: Bearer YOUR_PUBLIC_KEY"
-H "Organisation: YOUR_REFERENCE"
-X POST
Request Body
{ 
    "source": { 
        "address": "Ikoyi", 
        "latitude": 6.4500, 
        "longitude": 3.4333, 
        "state": "Lagos" 
    }, 
    "destination": { 
        "address": "Ikoyi", 
        "latitude": 6.4500, 
        "longitude": 3.4333, 
        "state": "Lagos",
        "stops": {
            "number": 0,
            "stopovers": []
        }
    },
    "email": "john@doe.com",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "2348000000000",
    "trip_type": "INTRASTATE",
    "category_size": "422cd8e2-4a19-42c2-97c8-xxxxxxxxxxxx",
    "callback_url": "https://beta.mytruq.com/tracking-page",
    "scheduled_date": "2023-03-22T10:00:00.755446+00:00"   
}
Response
{
    "status": "SUCCESS",
    "message": "Successfully calculated trip quote information",
    "data": {
        "id": "422cd8e2-4a19-42c2-97c8-xxxxxxxxxxxx",
        "reference": "BORA86N05112023011452",
        "source": {
            "address": "Ikoyi",
            "latitude": 6.45,
            "longitude": 3.4333,
            "state": "Lagos"
        },
        "destination": {
            "address": "Ojuelegba",
            "latitude": 6.5111,
            "longitude": 3.3666,
            "state": "Lagos",
            "stops": {
                "number": 0,
                "stopovers": []
            }
        },
        "organisation": "BOR_A86N",
        "is_interoperability": false,
        "category_size": "422cd8e2-4a19-42c2-97c8-xxxxxxxxxxxx",
        "trip_type": "INTRASTATE",
        "system_trip_type": "INTRASTATE",
        "extras": {
            "packaging_boxes": 0
        },
        "is_transit": false,
        "is_completed": false,
        "distance": 14.233,
        "helper_info": {},
        "added_on": "2023-05-10T08:34:51.655502Z",
        "status": "INITIATED",
        "system_status": "INITIATED",
        "is_insured": false,
        "is_paid": false,
        "quote": {
            "base_fare": 200.0,
            "cost_per_kilometer": 4269.9,
            "vat_value": 11.625,
            "platform_fee": 75.0,
            "helper_charge": 0.0,
            "charge": 4556.525,
            "total_charge": 4556.525,
            "currency": "NGN",
            "reference": "TRIP-PYT-BORA86N05102023083452",
            "estimated_value": 0.0,
            "checkout_url": "https://checkout.paystack.com/xxxxxxxxxx"
        },
        "vehicle_payment": {
            "vehicle_payment": 3863.16,
            "currency": "NGN",
            "is_paid": false
        },
        "scheduled_date": "2023-03-22T10:00:06.755446Z",
        "confirmation": {},
        "user_journey": [
            {
                "status": "INITIATED",
                "system_status": "INITIATED",
                "message": "Trip Initiated",
                "time": "2023-05-10 08:34:52.857545+00:00",
                "longitude": 6.5111,
                "latitude": 3.4333
            }
        ]
    }
}

Last updated 1 year ago