Pavan Cab Booking API Documentation Overview The Pavan Cab Booking API enables users and AIs to book cabs in Goa by sending booking details to the Pavan Cab team via WhatsApp at +918180951176. The primary endpoint, booking-team-message.php, supports GET and POST requests for submitting bookings via a URL or JSON payload. Additional APIs provide data for pickup locations, drop-off locations, one-way fares, sightseeing tours, and hour-based packages to construct accurate booking messages. No API key is required, as authentication is handled server-side using the WhatsApp Cloud API. Endpoints 1. Booking Submission URL: https://pavancab.com/developers/booking-team-message.php Methods: GET, POST Content-Type (POST only): application/json Authentication: None required Purpose: Sends booking details to the team via WhatsApp. GET Request Format: https://pavancab.com/developers/booking-team-message.php?customer_phone=&message= Parameters: customer_phone (required): WhatsApp number in E.164 format, e.g., +919284654591. message (optional): Booking details, e.g., Booking: 8hr Sedan from Patnem, ₹2900, 22:30, regular. Example:https://pavancab.com/developers/booking-team-message.php?customer_phone=%2B919284654591&message=Booking%3A%208hr%20Sedan%20from%20Patnem%2C%20%E2%82%B92900%2C%2022%3A30%2C%20regular Team Message: 🚖 Booking: 8hr Sedan from Patnem, ₹2900, 22:30, regular. Customer: +919284654591 POST Request Payload:{ "customer_phone": "", "message": "" } Example:curl -X POST https://pavancab.com/developers/booking-team-message.php \ -H "Content-Type: application/json" \ -d '{"customer_phone": "+919284654591", "message": "Booking: 8hr Sedan from Patnem, ₹2900, 22:30, regular"}' Response Format Success (HTTP 200):{ "status": "success", "message": "Message sent to team.", "timestamp": "2025-06-10 20:50:00", "http_code": 200, "whatsapp_response": { "messaging_product": "whatsapp", "contacts": [{"input": "+918180951176", "wa_id": "918180951176"}], "messages": [{"id": ""}] } } Error (HTTP 400, 500):{ "status": "error", "error": "", "timestamp": "2025-06-10 20:50:00", "http_code": , "details": { "curl_error": "", "whatsapp_error": {"code": , "message": "", "details": ""}, "verbose_log": "" } } 2. Pickup Locations URL: https://pavancab.com/fare/fetch_pickup_locations.php Method: GET Purpose: Retrieves available pickup locations. Response:[{"id":"16","name":"Agonda"}, {"id":"24","name":"Patnem"}, ...] Usage: Use id to fetch fares or drop-off locations. 3. Drop-off Locations URL: https://pavancab.com/fare/fetch_dropoff_locations.php?startingLocation= Method: GET Purpose: Retrieves drop-off locations for a given pickup location. Example: https://pavancab.com/fare/fetch_dropoff_locations.php?startingLocation=24 Response:[{"id":"1232","destination":"Dabolim"}, ...] 4. One-way Fares URL: https://pavancab.com/fare/fetch_fare_chart.php?airportId= Method: GET Purpose: Retrieves fares for one-way trips from a pickup location. Example: https://pavancab.com/fare/fetch_fare_chart.php?airportId=24 Response:[{"destination":"Dabolim","distance":"61.00","sedanFare":"2400","suvFare":"2900"}, ...] 5. Sightseeing Tours URL: https://pavancab.com/fare/tour-fare-fetch.php?pickupId= Method: GET Purpose: Retrieves fares for sightseeing tours from a pickup location. Example: https://pavancab.com/fare/tour-fare-fetch.php?pickupId=24 Response:{ "status": "success", "data": [ {"id":23,"place_id":24,"place_name":"Patnem","tour_name":"North Goa","car_type":"Swift","rate":2500,"is_active":true}, ... ] } 6. Hour-based Packages URL: https://pavancab.com/fare/hour-fare-fetch.php?pickupLocation= Method: GET Purpose: Retrieves fares for hour-based packages from a pickup location. Example: https://pavancab.com/fare/hour-fare-fetch.php?pickupLocation=24 Response:[ { "placeId":24, "cabType":"Sedan", "4HrFare":1700, "8HrFare":2500, "12HrFare":3500, "KmRate":20, "HrRate":200, "NightRate":500 }, ... ] Booking Types One-way Trips: Car types: Sedan, SUV Night charge: +10% if pickup is 10 PM–6 AM Example: Patnem to Dabolim, Sedan, 11 PM: ₹2400 + 10% = ₹2640 Sightseeing Tours: Tours: North Goa (10 AM–6 PM), South Goa (10 AM–7:30 PM), Dudhsagar (7–8 AM start, return 4–5 PM) Car types: Swift, Ertiga, Innova Night charge: +10% if pickup is 10 PM–6 AM (rare due to timings) Example: North Goa from Patnem, Swift, 10 AM: ₹2500 Hour-based Packages: Durations: 4/8/12 hours Car types: Sedan, Ertiga Night charge: +₹500 (one-time) if pickup is 10 PM–6 AM Extra charges: ₹20/km (Sedan), ₹25/km (Ertiga), ₹200/hr beyond limits Example: 8hr Sedan from Patnem, 11 PM: ₹2500 + ₹500 = ₹2900 Default Message If booking details are unclear: message: customer need some cab requirement regarding cab booking in goa Example URL:https://pavancab.com/developers/booking-team-message.php?customer_phone=%2B919284654591&message=customer%20need%20some%20cab%20requirement%20regarding%20cab%20booking%20in%20goa Team Message: 🚖 customer need some cab requirement regarding cab booking in goa. Customer: +919284654591 Error Handling HTTP 400: Customer phone number is required.: Ensure customer_phone is provided. Invalid phone number format.: Use E.164 format (e.g., +919284654591). HTTP 500 (WhatsApp API issues): Check details.whatsapp_error: Code 190: Invalid token; contact Pavan Cab. Code 100: Template issue; verify ‘grab’ template. Code 429: Rate limit; retry later. Fallback message may be sent if primary fails. Other APIs: Handle HTTP errors (e.g., 404, 500) by retrying or notifying the user. Security Use HTTPS for all requests. Validate customer_phone format (+ followed by 10–15 digits). Sanitize message to prevent injection. Avoid sensitive data in GET URLs, as they may be logged. Comply with India’s DPDP Act for customer data. Optional: Implement rate limiting (contact Pavan Cab for setup). Testing Booking Submission (GET):https://pavancab.com/developers/booking-team-message.php?customer_phone=%2B919284654591&message=Booking%3A%208hr%20Sedan%20from%20Patnem%2C%20%E2%82%B92900%2C%2022%3A30%2C%20regular Booking Submission (POST):curl -X POST https://pavancab.com/developers/booking-team-message.php \ -H "Content-Type: application/json" \ -d '{"customer_phone": "+919284654591", "message": "Booking: 8hr Sedan from Patnem, ₹2900, 22:30, regular"}' Fetch Pickup Locations:curl https://pavancab.com/fare/fetch_pickup_locations.php Verify team receives message at +918180951176. Check JSON responses for status: success or errors. Support Contact: +918180951176 (WhatsApp/call) for integration issues. Admin: Report persistent errors (e.g., token issues) to Pavan Cab admin. Notes Time Zone: All times are in IST (UTC+5:30). Payment: Customers pay drivers directly after drop-off. WhatsApp Template: Uses ‘grab’ template with one text parameter. Deployment: Endpoint is live at https://pavancab.com/developers/booking-team-message.php.