post
https://{URL}/v1/open-api/transports/trips
This method involves sending a POST request to retrieve available trips provided by Klikoo's B2B.
A. Request Header
| Field | Format | Mandatory | Length | Example |
|---|---|---|---|---|
| Content-Type | string | Y | application/json | |
| Open-Api-Timestamp | yyyy-mm-dd'T'hh:mm:ss+07:00 | Y | 2024-02-07T10:28:35.000+07:0 | |
| Open-Api-Signature | Digital Signature | Y | 88 | vNMoAmiDRV+paVyD5FaidgI5k Ry2pCo8oEoQN/GBpIPuO3eicY 63b7xY0WDffScvkOZsZ1442ewa bI7Wzd22pw== |
B. Request Body
| Field | Type | Description | Required | Example |
|---|---|---|---|---|
| product_code | string | Unique identifier for the product | true | "BUS" |
| source_id | int | The ID of the source location | true | 113 |
| source_type | string | The type of the source location | true | "CITY" |
| destination_id | int | The ID of the destination location | true | 132 |
| destination_type | string | The type of the destination location | true | "CITY" |
| total_seat | int | The total number of seats available | true | 1 |
| date | string | The date of the trip | ||
| pagination | object | An object containing pagination information | ||
limit | int | The maximum number of items to return per page | false | 100 |
page | int | The current page number | false | 1 |
| sort | object | An object containing sorting options | ||
field | string | The field by which to sort the results (Get from response) | true | "" |
value | string | The sorting order for the results (ascending or descending) (Get from response) | true | "" |
| search | array of objects | An array search parameters | ||
field | string | The field to search within the dataset (Get from response) | true | “” |
value | string | The value to search for within the specified search field (Get from response) | true | “” |
C. Sample Request
{
"product_code": "BUS",
"source_id": 132,
"source_type": "CITY",
"destination_id": 436,
"destination_type": "CITY",
"total_seat": 2,
"date": "2024-04-10",
"pagination": {
"limit": 100,
"page": 1,
"sort": {
"field": "boarding_time",
"value": "asc"
},
"search": [
{
"field": "boarding_time",
"value": "1"
},
{
"field": "travel_name",
"value": "Daytrans"
}
]
}
}
D. Response Body
| Field | Type | Description | Example |
|---|---|---|---|
| response_code | string | Contains the OpenAPI response code | “200052000” |
| response_message | string | Contains the value of OpenAPI response message | “Sukses” |
| meta | object | Contains the metadata related to transaction list’s pagination | |
total_data | int | The total number of data entries in data set | 178 |
total_page | int | The total number of pages in the paginated data set | 2 |
current_page | int | The current page number in the paginated data set | 1 |
per_page | int | The number of items per page in the paginated data set | 100 |
next_page | int | The number of the next page in the paginated data set | 2 |
| data | object | The object containing trips info | |
| trips | array of objects | The list of objects containing trips data | |
id | int | The ID of the terminal | 266782 |
available_seat | int | The number of available seats on the trip | 6 |
source_name | string | The name of the source or departure location | “Pringsewu” |
boarding_point_name | string | The name of boarding point | “Gading Rejo” |
boarding_point_address | string | The address of boarding point | "Kec. Gading Rejo, Kabupaten Pringsewu, Lampung, Indonesia" |
destination_name | string | The name of the trip's destination | “Jakarta” |
dropping_point_name | string | The name of dropping point | "Penjaringan" |
dropping_point_address | string | The address of dropping point | "Kec. Penjaringan, Jkt Utara, Daerah Khusus Ibukota Jakarta, Indonesia" |
travel_name | string | The name of the travel service | “Antar Trans” |
vehicle_type | string | The type of vehicle used for the trip | “BUS” |
bus_type | string | The type of bus | “Shuttle” |
depart_time | string | The departure time of the trip | "2024-12-24T14:30:00+07:00" |
arrival_time | string | The arrival time of the trip | "2024-12-24T23:35:00+07:00" |
lower_price | int | The lowest price for the trip | 400400 |
high_price | int | The highest price for the trip | 400400 |
trip_duration | string | The duration of the trip | "09j 09m" |
facilities | array of objects | An array of facilities available on the trip | "AC", "Non-Smoking Room" |
| filters | array of objects | An array of objects representing filters | |
grouping_name | string | The group name of the filter | "Jam berangkat" |
title | string | The tittle for the filter | "00:00 - 06:00" |
key | string | The key to identify the filter category | "boarding_time" |
value | string | The value representing the selected filter | "1" |
| sorts | array of objects | An array of objects representing sort options | |
title | string | The tittle of the sorting option | "Durasi tersingkat" |
key | string | The key for the sorting category | "trip_duration" |
value | string | The value for the sorting option | "asc" |
E. Sample Response
{
"response_code": "200052000",
"response_message": "Sukses",
"meta": {
"total_data": 178,
"total_page": 2,
"current_page": 1,
"per_page": 100,
"next_page": 2
},
"data": {
"trips": [
{
"id": 266782,
"available_seat": 6,
"source_name": "Pringsewu",
"boarding_point_name": "Gading Rejo",
"boarding_point_address": "Kec. Gading Rejo, Kabupaten Pringsewu, Lampung, Indonesia",
"destination_name": "Jakarta",
"drop_point_name": "Penjaringan",
"drop_point_address": "Kec. Penjaringan, Jkt Utara, Daerah Khusus Ibukota Jakarta, Indonesia",
"travel_name": "Antar Trans",
"vehicle_type": "BUS",
"bus_type": "Shuttle",
"depart_time": "2024-12-24T14:30:00+07:00",
"arrival_time": "2024-12-24T23:35:00+07:00",
"lower_price": 400400,
"high_price": 400400,
"trip_duration": "09j 09m",
"facilities": [
"AC",
"Non-Smoking Room"
]
},
],
"filters": [
{
"grouping_name": "Jam berangkat",
"title": "00:00 - 06:00",
"key": "boarding_time",
"value": "1"
},
{
"grouping_name": "Jam berangkat",
"title": "06:00 - 12:00",
"key": "boarding_time",
"value": "2"
}
],
"sorts": [
{
"title": "Durasi tersingkat",
"key": "trip_duration",
"value": "asc"
},
{
"title": "Harga terendah",
"key": "lower_price",
"value": "asc"
}
]
}
}
Try It Here (Form)
To try the following endpoint, enter the example request data you want to use in the following form