Privileged and Confidential This endpoint design has been confidentially shared with you. It is still under development and is subject to change without notice. Please do not share this document or API endpoint details with anyone who is not authorized to have access. For more information read about scopes.
Generate a report based on specified ReportType, such as reports related to driver status and quality, payment information for drivers, orders etc. for all child organizations within the organization hierarchy. This will be achieved with the help of the organization’s UUID in the request of this API.
Use case
Ensure that each organization’s UUID complies with the API’s 3-hour time limit, allowing a maximum of 6 reports to be concurrently in progress. A standout feature of the “Generate Report” API is its efficient handling of large datasets. If the CSV report exceeds 10,000 rows, the API dynamically generates a zip file comprising multiple CSV files for optimized storage and retrieval. Upon successful generation, the API furnishes a download link for the zip file, facilitating effortless access to the report data.
Using Dependent API
To generate comprehensive reports for both Rental /or Fleet partners, they should follow a two-step process. Firstly, they must utilize the Get Organizations API to obtain the encrypted IDs of all child organizations associated with the primary organization. Secondly, with these encrypted organization IDs, users can then proceed to use the Generate Report endpoint to generate the report. For obtaining the primary organization’s encrypted UUID, please contact the support team.
Support for Hierarchical Data
Supported. The API generates a report directly linked to the organization, and it also supports fetching reports linked to their child organizations. However, this support depends on the report type. Some report types are specifically designed for the child org level, while other report types may provide empty data if accessed at that level.
Supported supplier types
Rental/Fleets
Scopes
Primary - solutions.suppliers.reports
Resource
v1/vehicle-suppliers/suppliers/:org_id/reports
HTTP Method
POST
Authorization
Client Credentials
Required scopes
Primary - solutions.suppliers.reports
Example Request
curl --location 'https:
--header "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
--data '{
"reportType": "<report_type>",
"filters": [
{
"field": "dateRange",
"operator": "OPERATOR_IN_RANGE",
"value": [
"1687559400000",
"1687732199000"
]
}
]
}'
Example Response
{
"report": {
"id": "dsuirhwiuhrfbryrurptpt",
"fileName": "abcs.csv",
"orgId": "qoiewoifpwionfwoinwovmow4ivmp",
"reportType": "REPORT_TYPE_DRIVER_QUALITY",
"startTime": "2023-03-30T00:13:55.926Z",
"endTime": "2023-03-30T00:13:55.926Z",
"status": "REPORT_STATUS_IN_PROGRESS",
"failedReason": "REPORT_GENERATION_FAILED_REASON_NONE",
"createdAt": "2023-06-30T00:13:55.926Z",
"updatedAt": "2023-06-30T00:13:55.926Z",
"completedAt": ""
}
}
Request Path Parameters
Name |
Type |
Required |
Description |
org_id |
string |
Y |
Encrypted organisation UUID. |
Request Body Parameters
Name |
Type |
Required |
Description |
filters |
Array of Filter |
N |
This has a list of filters that needs to be added for specific report types to be generated. |
reportType |
string |
Y |
This is an enum . Values are mentioned in ReportType |
Filter
Name |
Type |
Required |
Description |
field |
string |
N |
This represents the field on which the filter needs to be applied. (example:- “dateRange”) |
operator |
Enum Operator |
Y |
This is an enum which represents eligible operators. |
value |
List of strings |
Y |
Values which need to be applied as filters. |
Response Fields
Name |
Type |
Description |
report |
Object of Report |
Report |
Request Entities
Operator
Name |
Value |
Description |
OPERATOR_IN_RANGE |
OPERATOR_IN_RANGE |
Operator to be used for range filters (example date range filter to add filter between 2 date range a,b) |
OPERATOR_IN |
OPERATOR_IN |
Operator to be used for in filters |
Response Entities
Report
Name |
type |
Description |
id |
string |
This is the report id. |
fileName |
string |
This is the file name for requested report. |
orgId |
string |
This is organization id (obfuscated). |
reportType |
string |
Represents the type of the report ReportType. |
startTime |
string |
ISO UTC time format for example 2023-03-30T00:13:55.926Z. |
endTime |
string |
ISO UTC time format for example 2023-03-30T00:13:55.926Z. |
status |
string |
Represents the generation status of the report ReportStatus. |
failedReason |
string |
One of the values in FailedReason. |
createdAt |
string |
ISO UTC time format for example 2023-03-30T00:13:55.926Z. |
updatedAt |
string |
ISO UTC time format for example 2023-03-30T00:13:55.926Z. |
completedAt |
string |
ISO UTC time format for example 2023-03-30T00:13:55.926Z, represents the time when the report generation was completed. |
ReportType
Name |
Generation level |
Description |
REPORT_TYPE_ORGANIZATION |
Parent |
Provides information about associated organizations like UUID, name, alias. |
REPORT_TYPE_PAYMENTS_ORDER |
Child |
Report having payment information for orders. |
REPORT_TYPE_PAYMENTS_DRIVER |
Parent |
Report having payment information for the driver. |
REPORT_TYPE_PAYMENTS_ORGANIZATION |
Parent |
Report having payment information for the organization. |
REPORT_TYPE_DRIVER_QUALITY |
Parent |
Report having driver quality-related information. |
REPORT_TYPE_DRIVER_ACTIVITY |
Parent |
Report having driver activity-related information. |
REPORT_TYPE_TRIP_ACTIVITY |
Parent |
Report having trips related information. |
REPORT_TYPE_DRIVER_STATUS |
Parent |
Report having driver realtime status and onboarding status related information. |
REPORT_TYPE_VEHICLE_PERFORMANCE |
Parent |
Report having vehicle performance-related information. |
REPORT_TYPE_DRIVER_PERFORMANCE |
Parent |
Report having driver performance-related information. |
REPORT_TYPE_BACKFILL_REALTIME_DRIVER_STATUS_CHANGE_WEBHOOK_EVENTS |
Child |
Report containing failed delivery events for REALTIME_DRIVER_STATUS_CHANGE webhook |
REPORT_TYPE_RENTAL_PAYMENTS_TRANSACTION |
Parent |
A report consisting of transactions occurring within a rental organization. |
REPORT_TYPE_RENTAL_PAYMENTS_CONTRACT |
Parent |
Report consisting of aggregated payments for rental organization, with one row per contract. |
REPORT_TYPE_RENTAL_PAYMENTS_ORGANIZATION |
Parent |
Report consisting of transactions summary at organization level. |
ReportStatus
Name |
Description |
REPORT_STATUS_COMPLETED |
Report generation is completed. |
REPORT_STATUS_FAILED |
Report generation failed due to some issue. |
REPORT_STATUS_IN_PROGRESS |
Report generation is in progress. |
FailedReason
Name |
Description |
REPORT_GENERATION_FAILED_REASON_INTERNAL_SERVER_ERROR |
Failed due to some internal error. |
REPORT_GENERATION_FAILED_REASON_NONE |
No failure occured. |
Rate Limit
- Rate limit for this endpoint is 600 requests per 10 minutes per Developer Application.
Endpoint Specific Errors
Http Status Code |
Code |
Message |
400 |
bad_request |
The request parameters are invalid. |
500 |
internal_server_error |
Internal server error. |
403 |
unauthenticated |
User does not have permission. |
429 |
rate_limited |
Number of requests exceeds allowed limit. |
503 |
service_unavailable |
Service unavailable. |
401 |
unauthorized |
Invalid OAuth 2.0 credentials. |
Notes
- DateRange to be passed in request should be in epoch format (milliseconds) and UTC timezone.
- For example, if the intention is to download the report for the date range from 24 June 2023 to 25 June 2023 in IST timezone, then the epoch values to be sent in the filter request should be 1,687,559,400,000, 1687645800000.
- The date represented in the Supplier portal List view for reports generated through this endpoint will have a date in yyyy-mm-dd format with the supplier’s configured timezone.
- Within a 3-hour time frame (starting from the latest request time), each organization can have up to 6 reports in progress at the same time, regardless of the report type. Therefore, only 6 reports can be generated concurrently for each requested organization’s UUID. Any additional requests during this period will result in an error and will not generate a new report.
- The generated report file will contain data for all the child organizations present under the organization UUID passed in the request of
Generate Report API
.
FAQ
- How frequently does the data refresh occur for each report type?
- Refer below table for the information
Name |
Data Refresh Rates |
REPORT_TYPE_ORGANIZATION |
Realtime |
REPORT_TYPE_PAYMENTS_ORDER |
4 hours |
REPORT_TYPE_PAYMENTS_DRIVER |
4 hours |
REPORT_TYPE_PAYMENTS_ORGANIZATION |
4 hours |
REPORT_TYPE_DRIVER_QUALITY |
Ratings data updated every 12 hours, for ratings from the past 4 weeks. Other columns are near-real-time information with a 30 mins lag. |
REPORT_TYPE_DRIVER_ACTIVITY |
30 minutes |
REPORT_TYPE_TRIP_ACTIVITY |
30 minutes |
REPORT_TYPE_DRIVER_STATUS |
Realtime |
REPORT_TYPE_VEHICLE_PERFORMANCE |
10 minutes |
REPORT_TYPE_DRIVER_PERFORMANCE |
2hours |
REPORT_TYPE_BACKFILL_REALTIME_DRIVER_STATUS_CHANGE_WEBHOOK_EVENTS |
Realtime |