Rides Aggregations
===
### Get Drivers Active Rides
- **URL:** {{base_url}}/v1/aggregate/users/{{driver-id}}/active-rides
- **Method:** GET
- **Request Params:**
```
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{driver-id}} | Intiger
| pathao-user-type | {{pathao-driver-type}}| String
```
- **Sample Response:**
`Response with status code 200`
```
{
"has_active_ride": true,
"active_ride_id": 49539,
"type": "driver",
"status": "ACCEPTED",
"id": 49539,
"pickup_address": "Mehedi General store, 2, Rd 5, Lake View, Badda",
"pickup_latitude": null,
"pickup_longitude": null,
"estimated_pickup_latitude": 23.78090627293817,
"estimated_pickup_longitude": 90.42087882757187,
"dropoff_address": "Zara Neha Fashion Mall, CWN (A) 3A, Rd 49, Gulshan 2",
"dropoff_latitude": null,
"dropoff_longitude": null,
"estimated_dropoff_latitude": 23.79362473315447,
"estimated_dropoff_longitude": 90.41099790483713,
"ride_type": 1
}
```
### Get Users Promo List
- **URL:** {{base_url}}/v1/aggregate/users/{{user-id}}/promos
- **Method:** GET
- **Request Params:**
```
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{user-id}} | Intiger
| pathao-user-type | {{pathao-user-type}} | String
| Content-Type | {{application/json}} | String
```
- **Sample Response:**
`Response with status code 200`
```
{
"codes": [
{
"id": 1990,
"user_id": 1285,
"code": "june13",
"type": "rides_discount",
"value": "30",
"expires_at": "2019-06-20 00:00:00",
"created_at": "2019-06-16 15:11:49",
"updated_at": "2019-06-16 15:11:49",
"max_value": null,
"city_id": 0,
"country_id": 1,
"max_dollar_amount": null,
"number_prefix": "",
"package_name": "",
"is_flash_promo": 0,
"description": "BDT30 off on your next ride!()",
"promo_for": "bike",
"promo_code_type": "bike"
},
{
"id": 1986,
"user_id": 1285,
"code": "car45",
"type": "rides_discount_pc",
"value": "45",
"expires_at": "2019-06-30 00:00:00",
"created_at": "2019-06-16 15:13:24",
"updated_at": "2019-06-16 15:13:24",
"max_value": null,
"city_id": 1,
"country_id": 1,
"max_dollar_amount": 50,
"number_prefix": "",
"package_name": "",
"is_flash_promo": 0,
"description": "45% off on your next ride in Dhaka! (Up to 50BDT. minimum ride fare: 115BDT)",
"promo_for": "car",
"promo_code_type": "car plus"
}
],
"success": true
}
```
### Apply Users Promo Code
- **URL:** {{base_url}}/v1/aggregate/users/{{user-id}}/promos
- **Method:** POST
- **Request Params:**
```
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{user-id}} | Intiger
| pathao-user-type | {{pathao-user-type}} | String
| Content-Type | {{application/json}} | String
```
- **Body:**
`Sample Payload`
```
{
"add_promo_code":"bike45"
}
```
- **Sample Response:**
`Response with status code 200`
```
{
"message": "Promo code has been added successfully!",
"success": true
}
```
### Get Driver Leaderboard by Trips
- **URL:** {{base_url}}/v1/aggregate/users/{{driver-id}}/leaderboard?type=trip
- **Method:** GET
- **Request Params:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| type | trip
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{driver-id}} | Intiger
| pathao-user-type | {{pathao-driver-type}}| String
| Content-Type | {{application/json}} | String
```
- **Sample Response:**
`Response with status code 200`
```
{
"leaderboard": [
{
"completed_trips": 5,
"driver": {
"name": "Shahidul Alam STG"
}
},
{
"completed_trips": 4,
"driver": {
"name": "Sazia Sharmin"
}
},
{
"completed_trips": 4,
"driver": {
"name": "Uthred son of Uthred"
}
},
{
"completed_trips": 2,
"driver": {
"name": "Shamsur Rahman"
}
},
{
"completed_trips": 2,
"driver": {
"name": "Mahmudul Hasan"
}
}
],
"success": true
}
```
### Get Driver Leaderboard by Earnings
- **URL:** {{base_url}}/v1/aggregate/users/{{driver-id}}/leaderboard?type=earning
- **Method:** GET
- **Request Params:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| type | trip
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{driver-id}} | Intiger
| pathao-user-type | {{pathao-driver-type}}| String
| Content-Type | {{application/json}} | String
```
- **Sample Response:**
`Response with status code 200`
```
{
"leaderboard": [
{
"total_earnings": "135",
"driver": {
"name": "Uthred son of Uthred"
}
},
{
"total_earnings": "131",
"driver": {
"name": "Shahidul Alam STG"
}
},
{
"total_earnings": "122",
"driver": {
"name": "Shamsur Rahman"
}
},
{
"total_earnings": "100",
"driver": {
"name": "Sazia Sharmin"
}
},
{
"total_earnings": "62",
"driver": {
"name": "Mahmudul Hasan"
}
}
],
"success": true
}
```
### Get Driver Daily Stats
- **URL:** {{base_url}}/v1/aggregate/users/{{driver-id}}/daily-stats/1
- **Method:** GET
- **Request Params:**
```
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{driver-id}} | Intiger
| pathao-user-type | {{pathao-driver-type}}| String
| Content-Type | {{application/json}} | String
```
- **Sample Response:**
`Response with status code 200`
```
{
"stats": {
"total_earning": 135,
"total_payable": -102,
"total_fare": 33,
"total_collected": 122,
"collected_by_cash": 33,
"collected_by_wallet": 89,
"total_completed": 4,
"boost_earning": 0,
"customer_satisfactory_per": "100%",
"rating_participants": 4,
"quest_bonus": 0,
"request_received": 13,
"net_total_earning": 135,
"completion_ratio": "36%",
"missed": 6,
"weekly_stats": [
0,
"135",
0,
0,
0,
0,
0
]
},
"success": true
}
```
### Get Driver Daily Stats v2
- **URL:** {{base_url}}/v2/aggregate/users/{{driver-id}}/daily-stats/sun
- **Method:** GET
- **Request Params:**
```
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{driver-id}} | Intiger
| pathao-user-type | {{pathao-driver-type}}| String
| Content-Type | {{application/json}} | String
```
- **Sample Response:**
`Response with status code 200`
```
{
"stats": {
"total_earning": 135,
"total_payable": -102,
"total_fare": 33,
"total_collected": 122,
"collected_by_cash": 33,
"collected_by_wallet": 89,
"total_completed": 4,
"boost_earning": 0,
"customer_satisfactory_per": "100%",
"rating_participants": 4,
"quest_bonus": 0,
"request_received": 13,
"net_total_earning": 135,
"completion_ratio": "36%",
"missed": 6,
"weekly_stats": {
"sun": 135,
"mon": 0,
"tue": 0,
"wed": 0,
"thu": 0,
"fri": 0,
"sat": 0
}
},
"success": true
}
```
### Get Users Referral Promo Code
- **URL:** {{base_url}}/v1/aggregate/users/{{user-id}}/referral-code
- **Method:** GET
- **Request Params:**
```
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{user-id}} | Intiger
| pathao-user-type | {{pathao-user-type}} | String
| Content-Type | {{application/json}} | String
```
- **Sample Response:**
`Response with status code 200`
```
{
"referrals": {
"code": "f3cdn",
"referral_promo_text": {
"en": "Share this code with a friend who hasn't tried Pathao. Your friend gets discounts on the first two rides, while you get a discount after your friend enjoys the two rides!",
"bn": "এই কোডটি শেয়ার করুন এমন কোন বন্ধুর সাথে যে এখনো পাঠাও ব্যবহার করেনি। আপনার বন্ধু প্রথম ২ রাইডে ডিসকাউন্ট পাবে আর বন্ধুর ২ রাইড শেষ হলে আপনিও পাবেন ডিসকাউন্ট!",
"np": "पठाओलाई मन पराउनुहुन्छ? तपाईको साथीहरुले पनि अवश्य मन पराउनुहुनेछ, तलको कोड शेयर गर्नुहोस्, तपाईँ र तपाइले रिफर गर्नुभएको हरेक व्यक्तिले 50TK सम्म फ्री राइड प्राप्त गर्नुहुनेछ । जति धेरै रिफर गर्नुहुन्छ, त्यति नै धेरै फ्री राइडको अफर प्राप्त गर्नुहुनेछ!"
}
},
"success": true
}
```
### Create Users Referral Promo Code
- **URL:** {{base_url}}/v1/aggregate/users/{{user-id}}/referral-code
- **Method:** POST
- **Request Params:**
```
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{user-id}} | Intiger
| pathao-user-type | {{pathao-user-type}} | String
| Content-Type | {{application/json}} | String
```
- **Body:**
`Sample Payload`
```
{
"country_id":1
}
```
- **Sample Response:**
`Response with status code 200`
```
{
"success": true
}
```
### Get Driver Cooldown Status
- **URL:** {{base_url}}/v1/aggregate/users/{{driver-id}}/cooldown
- **Method:** GET
- **Request Params:**
```
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{driver-id}} | Intiger
| pathao-user-type | {{pathao-driver-type}} | String
| Content-Type | {{application/json}} | String
```
- **Sample Response:**
`Response with status code 200`
```
{
"is_suspended": false,
"is_cooldown_locked": false,
"suspension_started_at": null,
"suspened_duration": null,
"suspened_message": null,
"suspension_end_after": null,
"rejection_header": null,
"rejection_header_bn": null,
"rejection_body": null,
"rejection_body_bn": null,
"cancelation_header": null,
"cancelation_header_bn": null,
"cancelation_body": null,
"cancelation_body_bn": null,
"driver_suspended_text": {
"en": "",
"bn": "",
"np": ""
},
"driver_suspended_at": null,
"is_active_for_rejection": true,
"is_active_for_cancelation": true
}
```
### Get Driver Lifetime Stats
- **URL:** {{base_url}}/v1/aggregate/users/{{driver-id}}/lifetime-stats
- **Method:** GET
- **Request Params:**
```
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{driver-id}} | Intiger
| pathao-user-type | {{pathao-driver-type}} | String
| Content-Type | {{application/json}} | String
```
- **Sample Response:**
`Response with status code 200`
```
{
"trips": 576,
"undiscounted_fare": 45129,
"earnings": 36186,
"rating": 79,
"five_star_rating_count": 455,
"rating_participants": 575,
"missed_rides": 674
}
```
### Send New Users First Trip Promo Offer Text
- **URL:** {{base_url}}/v1/aggregate/users/{{user-id}}/send-first-trip-promos
- **Method:** GET
- **Request Params:**
```
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{user-id}} | Intiger
| pathao-user-type | {{pathao-user-type}} | String
| Content-Type | {{application/json}} | String
```
- **Sample Response:**
`Response with status code 200`
```
{
"message": "comms has been successfully sent!",
"success": true
}
```
### Get Drivers Active Rides v2
- **URL:** {{base_url}}/v2/aggregate/users/{{driver-id}}/active-rides
- **Method:** GET
- **Request Params:**
```
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{driver-id}} | Intiger
| pathao-user-type | {{pathao-driver-type}} | String
```
- **Sample Response:**
`Response with status code 200`
```
{
"has_active_ride": true,
"active_ride_id": 49539,
"type": "driver",
"status": "ACCEPTED",
"id": 49539,
"pickup_address": "Mehedi General store, 2, Rd 5, Lake View, Badda",
"pickup_latitude": null,
"pickup_longitude": null,
"estimated_pickup_latitude": 23.78090627293817,
"estimated_pickup_longitude": 90.42087882757187,
"dropoff_address": "Zara Neha Fashion Mall, CWN (A) 3A, Rd 49, Gulshan 2",
"dropoff_latitude": null,
"dropoff_longitude": null,
"estimated_dropoff_latitude": 23.79362473315447,
"estimated_dropoff_longitude": 90.41099790483713,
"ride_type": 1
}
```
### Get Users Promo List v2
- **URL:** {{base_url}}/v2/aggregate/users/{{user-id}}/promos
- **Method:** GET
- **Request Params:**
```
```
- **HEADERS:**
```
| KEY | VALUE | Data Type
--------------- ----------- ---------
| pathao-user-id | {{user-id}} | Intiger
| pathao-user-type | {{pathao-user-type}} | String
| Content-Type | {{application/json}} | String
```
- **Sample Response:**
`Response with status code 200`
```
{
"codes": [
{
"id": 1986,
"user_id": 1285,
"code": "car45",
"type": "rides_discount_pc",
"value": "45",
"expires_at": "2019-06-30 00:00:00",
"created_at": "2019-06-16 15:13:24",
"updated_at": "2019-06-16 15:13:24",
"max_value": null,
"city_id": 1,
"country_id": 1,
"max_dollar_amount": 50,
"number_prefix": "",
"package_name": "",
"is_flash_promo": 0,
"description": "45% off on your next ride in Dhaka! (Up to 50BDT. minimum ride fare: 115BDT)",
"promo_for": "car",
"promo_code_type": "car plus"
},
{
"id": 1987,
"user_id": 1285,
"code": "bike45",
"type": "rides_discount",
"value": "45",
"expires_at": "2019-06-30 00:00:00",
"created_at": "2019-06-16 16:38:41",
"updated_at": "2019-06-16 16:38:41",
"max_value": null,
"city_id": 0,
"country_id": 1,
"max_dollar_amount": null,
"number_prefix": "",
"package_name": "",
"is_flash_promo": 0,
"description": "BDT45 off on your next ride!()",
"promo_for": "bike",
"promo_code_type": "bike"
}
],
"digital_offers": [],
"success": true
}
```