NAV
php javascript

Info

Welcome to the generated API reference.

Authentication

Login

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.justgo.co.za/api/user/login',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'email' => 'quos',
            'password' => 'autem',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/user/login"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "email": "quos",
    "password": "autem"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "user": {
        "id": 1,
        "name": "Admin",
        "email": "tester1@deta.co.za",
        "email_verified_at": null,
        "created_at": "2020-03-18T08:49:57.000000Z",
        "updated_at": "2020-03-18T08:49:57.000000Z"
    },
    "token_type": "Bearer",
    "access_token": "this-here-will-be-your-access-token"
}

HTTP Request

POST api/user/login

Body Parameters

Parameter Type Status Description
email string required User Email address
password string required User password

Booking

Get Booking Details

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.justgo.co.za/api/bookings/get-details',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'booking_id_or_justgo_reference' => 'JG0000148',
            'send_email' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/bookings/get-details"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "booking_id_or_justgo_reference": "JG0000148",
    "send_email": 1
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "session_id": "JUSTGO-108-5f0b6a2c142ee",
    "booking_status": "Completed",
    "reference": "JG0000146",
    "url": "https:\/\/bit.ly\/2HX0qXZ",
    "data": {
        "ReserveBusTrip": {
            "bookingReference": "BUS93709",
            "providerReference": "5624",
            "ticketTimeLimit": "2018-10-24T10:39:41.850+02:00",
            "success": true,
            "errors": []
        },
        "PayBusReservation": {
            "carmaTickets": [],
            "intercapeTickets": [],
            "computicketTickets": [],
            "eldoTickets": [],
            "intercityTickets": [
                {
                    "id": 13261,
                    "carrier": "Eagle Liner",
                    "passengerType": "Adult",
                    "discount": 0,
                    "title": "Mr",
                    "gender": "",
                    "firstName": "John",
                    "lastName": "Doe",
                    "telephone": "0839417020",
                    "emergencyTelephone": "",
                    "amount": 190,
                    "arrivalStopId": 184,
                    "arrivalStop": "Kokstad (Shell, Hope Service Station)",
                    "arrivalDate": "2020-11-03 04:55",
                    "departureStopId": 77,
                    "departureStop": "Johannesburg Park Station (Bay21)",
                    "departureDate": "2020-11-02 19:15",
                    "ticketNumber": "ELIX12118928",
                    "seatNumber": "s04",
                    "route": "3074 - Pretoria - Matatiele",
                    "date": "2020-11-02 13:50"
                }
            ],
            "blueLabelTickets": [],
            "success": true,
            "errors": []
        }
    }
}

HTTP Request

POST api/bookings/get-details

URL Parameters

Parameter Status Description
token optional string required Access Token

Body Parameters

Parameter Type Status Description
booking_id_or_justgo_reference string required Booking ID
send_email integer required Send Email

Bus Booking

Get Bus Points

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.justgo.co.za/api/bus/get-bus-points',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/bus/get-bus-points"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "bust_location": [
        {
            "locationId": 945,
            "locationName": "Aberdeen"
        },
        {
            "locationId": 946,
            "locationName": "Acornhoek"
        }
    ]
}

HTTP Request

GET api/bus/get-bus-points

URL Parameters

Parameter Status Description
token optional string required Access Token

Search Bus Trip

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.justgo.co.za/api/bus/search-bus-trip',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'adults' => 2,
            'children' => 0,
            'infants' => 0,
            'departure_point_id' => 455,
            'arrival_point_id' => 362,
            'departure_date' => '2020-08-22',
            'return_date' => '2020-08-25',
            'voucher' => 'Voucher Code',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/bus/search-bus-trip"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "adults": 2,
    "children": 0,
    "infants": 0,
    "departure_point_id": 455,
    "arrival_point_id": 362,
    "departure_date": "2020-08-22",
    "return_date": "2020-08-25",
    "voucher": "Voucher Code"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "session_id": "JUSTGO-108-5f0b6a2c142ee",
    "departure_results_found": "10",
    "return_results_found": "5"
}

HTTP Request

POST api/bus/search-bus-trip

URL Parameters

Parameter Status Description
token optional string required Access Token

Body Parameters

Parameter Type Status Description
adults integer required Number of adults
children integer required Number of children
infants integer required Number of infants
departure_point_id integer required Departure point
arrival_point_id integer required Arrival point
departure_date date required Departure Date (Format: 2020-08-22)
return_date date optional Return Date (Format: 2020-08-25)
voucher string optional Discount Voucher

Search Bus Get Search results

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.justgo.co.za/api/bus/get-bus-search-results',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'session_id' => 'JUSTGO-108-5f0b6a2c142ee',
            'order_by' => '["cheapest", "ealierst", "latest", "fastest"]',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/bus/get-bus-search-results"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "session_id": "JUSTGO-108-5f0b6a2c142ee",
    "order_by": "[\"cheapest\", \"ealierst\", \"latest\", \"fastest\"]"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "outbound_results_count": "1",
    "outbound_results": [
        {
            "results_id": 4320,
            "session_id": "JUSTGO-108-5f0b6a2c142ee",
            "tc_unique_session_id": "JUSTGO-176-5f0c242e7d741",
            "provider": "eldo",
            "departureLocation": "2163",
            "destinationLocation": "2153",
            "departureLocationDescription": "JOHANNESBURG: JOHANNESBURG PARK STATION",
            "destinationLocationDescription": "DURBAN: DURBAN STATION",
            "departureDate": "2020-07-25 08:30",
            "arrivalDate": "2020-07-25 16:20",
            "journeyDuration": "07h50m",
            "tripCode": "61333220",
            "serviceCode": "AP",
            "serviceName": "APM",
            "classType": "Luxury",
            "availableSeats": "10",
            "price": "210",
            "service_fee_cost": null,
            "global_service_fee_cost_rand": null,
            "global_service_fee_cost_perc": 1.8,
            "provider_service_fee_perc": 0,
            "entity_service_fee_cost_rand": 10,
            "entity_service_fee_cost_perc": 6,
            "entity_service_fee_override_cost_rand": null,
            "entity_service_fee_override_cost_perc": 2,
            "price_including_service_fee_cost": "230.58",
            "price_including_service_fee_cost_before_discount": 240.58,
            "date_created": "2020-07-13 11:07:03",
            "has_discount": true,
            "supplier_name": "APM",
            "carrier_logo": "https:\/\/www.justgo.co.zaupload\/carrier_logos\/apm-logo.png",
            "depature_time": "08:30am",
            "arrival_time": "04:20pm"
        }
    ],
    "inbound_results_count": "1",
    "inbound_results": [
        {
            "results_id": 733,
            "session_id": "JUSTGO-108-5f0b6a2c142ee",
            "tc_unique_session_id": "JUSTGO-176-5f0c242e7d741",
            "provider": "eldo",
            "departureLocation": "2153",
            "destinationLocation": "2163",
            "departureLocationDescription": "DURBAN: DURBAN STATION",
            "destinationLocationDescription": "JOHANNESBURG: JOHANNESBURG PARK STATION",
            "departureDate": "2020-07-27 09:10",
            "arrivalDate": "2020-07-27 17:00",
            "journeyDuration": "07h50m",
            "tripCode": "61522641",
            "serviceCode": "AP",
            "serviceName": "APM",
            "classType": "Luxury",
            "availableSeats": "10",
            "price": "210",
            "service_fee_cost": null,
            "global_service_fee_cost_rand": null,
            "global_service_fee_cost_perc": 1.8,
            "provider_service_fee_perc": 0,
            "entity_service_fee_cost_rand": 10,
            "entity_service_fee_cost_perc": 6,
            "entity_service_fee_override_cost_rand": null,
            "entity_service_fee_override_cost_perc": 2,
            "price_including_service_fee_cost": "230.58",
            "price_including_service_fee_cost_before_discount": 240.58,
            "date_created": "2020-07-13 11:07:04",
            "has_discount": false,
            "supplier_name": "APM",
            "carrier_logo": "https:\/\/www.justgo.co.zaupload\/carrier_logos\/apm-logo.png",
            "depature_time": "09:10am",
            "arrival_time": "05:00pm"
        }
    ]
}

HTTP Request

POST api/bus/get-bus-search-results

URL Parameters

Parameter Status Description
token optional string required Access Token

Body Parameters

Parameter Type Status Description
session_id string required Unique Session ID
order_by string required Order by

Search Bus Trip Summary

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.justgo.co.za/api/bus/get-bus-trip-summary',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'session_id' => 'JUSTGO-108-5f0b6a2c142ee',
            'outbound_results_id' => 456,
            'inbound_results_id' => 352,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/bus/get-bus-trip-summary"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "session_id": "JUSTGO-108-5f0b6a2c142ee",
    "outbound_results_id": 456,
    "inbound_results_id": 352
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "outbound_trip_summary": {
        "total_passengers": 1,
        "price_before_discount": 240.58,
        "price_after_discount": 230.58,
        "departure_place": "JOHANNESBURG: JOHANNESBURG PARK STATION",
        "arrival_place": "DURBAN: DURBAN STATION",
        "depature_date": "25 July 2020",
        "depature_time": "08:30am - 04:20pm"
    },
    "inbound_trip_summary": {
        "total_passengers": 1,
        "price_before_discount": 240.58,
        "price_after_discount": 230.58,
        "departure_place": "DURBAN: DURBAN STATION",
        "arrival_place": "JOHANNESBURG: JOHANNESBURG PARK STATION",
        "depature_date": "27 July 2020",
        "depature_time": "09:10am - 05:00pm"
    },
    "time_remaining_minutes": 698,
    "grand_total_price": 461.16,
    "grand_total_price_before_discount": 481.16
}

HTTP Request

POST api/bus/get-bus-trip-summary

URL Parameters

Parameter Status Description
token optional string required Access Token

Body Parameters

Parameter Type Status Description
session_id string required Unique Session ID
outbound_results_id integer required Outbound Results ID
inbound_results_id integer optional Inbound Results ID

Reserve Bus Trip

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.justgo.co.za/api/bus/reserve-bus-trip',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'session_id' => 'JUSTGO-112-5f0df4fc95605',
            'primary_email' => 'tester@test.co.za',
            'primary_mobile_number' => '0653463078',
            'outbound_results_id' => 455,
            'inbound_results_id' => 455,
            'adult_title_id_1' => 1,
            'adult_name_as_per_id_or_passport_1' => 'fuga',
            'adult_surname_as_per_id_or_passport_1' => 'officia',
            'adult_date_of_birth_day_1' => 22,
            'adult_date_of_birth_month_1' => 9,
            'adult_date_of_birth_year_1' => 1988,
            'child_title_id_1' => 1,
            'child_name_as_per_id_or_passport_1' => 'consequuntur',
            'child_surname_as_per_id_or_passport_1' => 'qui',
            'child_date_of_birth_day_1' => 22,
            'child_date_of_birth_month_1' => 9,
            'child_date_of_birth_year_1' => 1988,
            'infant_title_id_1' => 1,
            'infant_name_as_per_id_or_passport_1' => 'facere',
            'infant_surname_as_per_id_or_passport_1' => 'id',
            'infant_date_of_birth_day_1' => 22,
            'infant_date_of_birth_month_1' => 9,
            'infant_date_of_birth_year_1' => 1988,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/bus/reserve-bus-trip"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "session_id": "JUSTGO-112-5f0df4fc95605",
    "primary_email": "tester@test.co.za",
    "primary_mobile_number": "0653463078",
    "outbound_results_id": 455,
    "inbound_results_id": 455,
    "adult_title_id_1": 1,
    "adult_name_as_per_id_or_passport_1": "fuga",
    "adult_surname_as_per_id_or_passport_1": "officia",
    "adult_date_of_birth_day_1": 22,
    "adult_date_of_birth_month_1": 9,
    "adult_date_of_birth_year_1": 1988,
    "child_title_id_1": 1,
    "child_name_as_per_id_or_passport_1": "consequuntur",
    "child_surname_as_per_id_or_passport_1": "qui",
    "child_date_of_birth_day_1": 22,
    "child_date_of_birth_month_1": 9,
    "child_date_of_birth_year_1": 1988,
    "infant_title_id_1": 1,
    "infant_name_as_per_id_or_passport_1": "facere",
    "infant_surname_as_per_id_or_passport_1": "id",
    "infant_date_of_birth_day_1": 22,
    "infant_date_of_birth_month_1": 9,
    "infant_date_of_birth_year_1": 1988
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "booking_id": "5",
    "outbound_booking_reference": "BUS21182",
    "inbound_booking_reference": "BUS21183"
}

HTTP Request

POST api/bus/reserve-bus-trip

URL Parameters

Parameter Status Description
token optional string required Access Token

Body Parameters

Parameter Type Status Description
session_id string required
primary_email string required Booking Email
primary_mobile_number string required Booking contact number
outbound_results_id integer required Search outbound result_id
inbound_results_id integer optional Search inbound result_id
adult_title_id_1 integer required (1 = Mr, 2 = Mrs, 4 = Ms)
adult_name_as_per_id_or_passport_1 string required Name
adult_surname_as_per_id_or_passport_1 string required Surname
adult_date_of_birth_day_1 integer optional Day of birth
adult_date_of_birth_month_1 integer optional Month of birth
adult_date_of_birth_year_1 integer optional Year of birth
child_title_id_1 integer required (1 = Mr, 2 = Mrs, 4 = Ms)
child_name_as_per_id_or_passport_1 string required Name
child_surname_as_per_id_or_passport_1 string required Surname
child_date_of_birth_day_1 integer optional Day of birth
child_date_of_birth_month_1 integer optional Month of birth
child_date_of_birth_year_1 integer optional Year of birth
infant_title_id_1 integer required (1 = Mr, 2 = Mrs, 4 = Ms)
infant_name_as_per_id_or_passport_1 string required Name
infant_surname_as_per_id_or_passport_1 string required Surname
infant_date_of_birth_day_1 integer optional Day of birth (dd)
infant_date_of_birth_month_1 integer optional Month of birth (mm)
infant_date_of_birth_year_1 integer optional Year of birth (YYYY)

Pay Bus Trip

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.justgo.co.za/api/bus/pay-bus-trip',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'session_id' => 'JUSTGO-112-5f0df4fc95605',
            'booking_id' => 5,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/bus/pay-bus-trip"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "session_id": "JUSTGO-112-5f0df4fc95605",
    "booking_id": 5
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "outbound_payment_response": {
        "status": true,
        "Data": {
            "carmaTickets": [
                {
                    "trace": "string",
                    "stserviceNr": "string",
                    "dtdepDate": "string",
                    "stcarrier": "string",
                    "stboard": "string",
                    "stboardLoc": "string",
                    "stboarddt": "string",
                    "stdest": "string",
                    "stdestLoc": "string",
                    "dtarrival": "string",
                    "stticketType": "string",
                    "stclass": "string",
                    "stacc": "string",
                    "stticketnr": "string",
                    "cramount": 0,
                    "inpaxNo": 0,
                    "stsurname": "string",
                    "stinitials": "string",
                    "sttitle": "string",
                    "stdiscount": "string",
                    "stpassport": "string",
                    "stpassType": "string",
                    "streference": "string",
                    "stbarcode": "string"
                }
            ]
        }
    },
    "inbound_payment_response": {
        "status": true,
        "Data": {
            "intercapeTickets": [
                {
                    "TripDetails": [
                        {
                            "arrWhere": "string",
                            "ticketTitle": "string",
                            "ticketHeader": "string",
                            "depWhere": "string",
                            "depTime": "string",
                            "arrTime": "string",
                            "depPlace": "string",
                            "ticketFooter": "string",
                            "tripID": "string",
                            "numTix": 0,
                            "passengers": [
                                {
                                    "Price": 0,
                                    "TicketNo": "string",
                                    "PaxName": "string",
                                    "Notes": "string"
                                }
                            ],
                            "arrPlace": "string"
                        }
                    ],
                    "TicketSerial": "string"
                }
            ]
        }
    }
}

HTTP Request

POST api/bus/pay-bus-trip

URL Parameters

Parameter Status Description
token optional string required Access Token

Body Parameters

Parameter Type Status Description
session_id string required
booking_id integer required Booking ID

Flight Booking

Get Airports

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.justgo.co.za/api/flight/get-flight-points',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/flight/get-flight-points"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": true,
    "flight_location": [
        {
            "airportName": "O R Tambo International",
            "airportCode": "JNB",
            "country": "South Africa",
            "city": "Johannesburg - All Airports",
            "timezone": 2,
            "DST": "U",
            "tzFormat": "Africa\/Johannesburg",
            "weight": 2
        },
        {
            "airportName": "Cape Town International Airport",
            "airportCode": "CPT",
            "country": "South Africa",
            "city": "Cape Town",
            "timezone": 2,
            "DST": "U",
            "tzFormat": "Africa\/Johannesburg",
            "weight": 1
        }
    ]
}

HTTP Request

GET api/flight/get-flight-points

URL Parameters

Parameter Status Description
token optional string required Access Token

Search Flight Trip

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.justgo.co.za/api/flight/search-flight-trip',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'adults' => 2,
            'children' => 0,
            'infants' => 0,
            'cabins' => '(Economy, Business, Premium)',
            'departure_airport_code' => 455,
            'arrival_airport_code' => 362,
            'departure_date' => '2020-08-22',
            'return_date' => '2020-08-25',
            'voucher' => 'Voucher Code',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/flight/search-flight-trip"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "adults": 2,
    "children": 0,
    "infants": 0,
    "cabins": "(Economy, Business, Premium)",
    "departure_airport_code": 455,
    "arrival_airport_code": 362,
    "departure_date": "2020-08-22",
    "return_date": "2020-08-25",
    "voucher": "Voucher Code"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "session_id": "JUSTGO-108-5f0b6a2c142ee",
    "departure_results_found": "10",
    "return_results_found": "5"
}

HTTP Request

POST api/flight/search-flight-trip

URL Parameters

Parameter Status Description
token optional string required Access Token

Body Parameters

Parameter Type Status Description
adults integer required Number of adults
children integer required Number of children
infants integer required Number of infants
cabins string required Description of cabins (Economy, Business, Premium)
departure_airport_code integer required Departure point
arrival_airport_code integer required Arrival point
departure_date date required Departure Date (Format: 2020-08-22)
return_date date optional Return Date (Format: 2020-08-25)
voucher string optional Discount Voucher

Search Flight Get Search results

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.justgo.co.za/api/flight/get-flight-search-results',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'session_id' => 'JUSTGO-108-5f0b6a2c142ee',
            'order_by' => '["cheapest", "ealierst", "latest", "fastest"]',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/flight/get-flight-search-results"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "session_id": "JUSTGO-108-5f0b6a2c142ee",
    "order_by": "[\"cheapest\", \"ealierst\", \"latest\", \"fastest\"]"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "outbound_results_count": "1",
    "outbound_results": [
        {
            "results_id": 3126,
            "session_id": "JUSTGO-242-5f15b9854c9bb",
            "tc_unique_session_id": "JUSTGO-242-5f15b9854c9bb",
            "fareTypeCode": "2",
            "fareTypeName": "ECONOMY",
            "fareCode": "23",
            "totalFare": "469",
            "securityGUID": "8bce587ak3n910qfp0w4p565s3dby6cbd61126f731d6",
            "ticketType": "",
            "ticketTimeLimit": "",
            "provider": "radixx",
            "pricingSource": "",
            "negotiatedCode": "",
            "validatingAirlineCode": "FA",
            "sequenceNumber": "1",
            "legOptions": [
                {
                    "segments": [
                        {
                            "airportFromCode": "JNB",
                            "airportFromName": "O R Tambo International",
                            "airportToCode": "DUR",
                            "airportToName": "Durban International Airport",
                            "operatingAirlineCode": "FA",
                            "operatingAirlineName": "FlySafair",
                            "marketingAirlineCode": "FA",
                            "marketingAirlineName": "FlySafair",
                            "flightNumber": "FA286",
                            "departureDateTime": "Tue, 25 Aug 07:30am",
                            "arrivalDateTime": "Tue, 25 Aug 08:45am",
                            "stopQuantity": "0",
                            "equipmentType": "",
                            "equipmentName": "",
                            "journeyDuration": "01:15",
                            "cabin": "ECONOMY",
                            "resBookDesigCode": "F",
                            "RPH": "23",
                            "numberInParty": "",
                            "ticketTimeLimit": "",
                            "ticketType": "",
                            "LFID": "144138",
                            "logo": "https:\/\/www.justgo.co.za\/upload\/carrier_logos\/flysafair-logo.png",
                            "departureDate": "25 August 2020",
                            "arrivalDate": "01 January 1970",
                            "legDuration": "01h15m",
                            "supplier_name": "FlySafair"
                        }
                    ]
                }
            ],
            "fareBreakdowns": [
                {
                    "passengerType": "ADT",
                    "numPassengers": "1",
                    "totalPassengerFare": "469",
                    "fareIncludesLuggage": "",
                    "taxes": [
                        {
                            "taxName": "Value Added Tax",
                            "amount": "40.96"
                        },
                        {
                            "taxName": "Passenger services charge April VAT 2018",
                            "amount": "86.75"
                        },
                        {
                            "taxName": "Passenger Security Charge (01 Oct 18)",
                            "amount": "22"
                        },
                        {
                            "taxName": "CAA March 2020",
                            "amount": "26.23"
                        },
                        {
                            "taxName": "COVID19 FEE",
                            "amount": "17.39"
                        },
                        {
                            "taxName": "Value Added Tax",
                            "amount": "2.61"
                        }
                    ]
                }
            ],
            "luggageAllowancesPerPassenger": null,
            "ordering_earliest_depature_date": "2020-08-25T07:30:00",
            "journeyReturnTotalStops": null,
            "journeyDepatureTotalStops": "0",
            "date_created": "2020-07-20",
            "service_fee_cost": null,
            "global_service_fee_cost_rand": null,
            "global_service_fee_cost_perc": 1.8,
            "provider_service_fee_perc": 0,
            "entity_reginal_flight_fee_cost": 0,
            "entity_service_fee_cost_rand": 100,
            "entity_service_fee_cost_perc": 4,
            "entity_service_fee_override_cost_rand": null,
            "entity_service_fee_override_cost_perc": 2,
            "totalFare_including_servicefee": 605.58,
            "totalFare_including_servicefee_before_discount": 605.58,
            "journeyDurationDepature": "01:15",
            "journeyDurationReturn": null,
            "price": "605.58",
            "logo": "FA",
            "depature_date": "Tuesday, 25 August",
            "arrival_date": "Tuesday, 25 August",
            "depature_time": "07:30am",
            "arrival_time": "08:45am",
            "journey_duration": "01h15m",
            "stops_count": "0",
            "flight_number": "FA286",
            "supplier_name": "FlySafair"
        }
    ],
    "inbound_results_count": "1",
    "inbound_results": [
        {
            "results_id": 3126,
            "session_id": "JUSTGO-242-5f15b9854c9bb",
            "tc_unique_session_id": "JUSTGO-242-5f15b9854c9bb",
            "fareTypeCode": "2",
            "fareTypeName": "ECONOMY",
            "fareCode": "23",
            "totalFare": "469",
            "securityGUID": "8bce587ak3n910qfp0w4p565s3dby6cbd61126f731d6",
            "ticketType": "",
            "ticketTimeLimit": "",
            "provider": "radixx",
            "pricingSource": "",
            "negotiatedCode": "",
            "validatingAirlineCode": "FA",
            "sequenceNumber": "1",
            "legOptions": [
                {
                    "segments": [
                        {
                            "airportFromCode": "JNB",
                            "airportFromName": "O R Tambo International",
                            "airportToCode": "DUR",
                            "airportToName": "Durban International Airport",
                            "operatingAirlineCode": "FA",
                            "operatingAirlineName": "FlySafair",
                            "marketingAirlineCode": "FA",
                            "marketingAirlineName": "FlySafair",
                            "flightNumber": "FA286",
                            "departureDateTime": "Tue, 25 Aug 07:30am",
                            "arrivalDateTime": "Tue, 25 Aug 08:45am",
                            "stopQuantity": "0",
                            "equipmentType": "",
                            "equipmentName": "",
                            "journeyDuration": "01:15",
                            "cabin": "ECONOMY",
                            "resBookDesigCode": "F",
                            "RPH": "23",
                            "numberInParty": "",
                            "ticketTimeLimit": "",
                            "ticketType": "",
                            "LFID": "144138",
                            "logo": "https:\/\/www.justgo.co.za\/upload\/carrier_logos\/flysafair-logo.png",
                            "departureDate": "25 August 2020",
                            "arrivalDate": "01 January 1970",
                            "legDuration": "01h15m",
                            "supplier_name": "FlySafair"
                        }
                    ]
                }
            ],
            "fareBreakdowns": [
                {
                    "passengerType": "ADT",
                    "numPassengers": "1",
                    "totalPassengerFare": "469",
                    "fareIncludesLuggage": "",
                    "taxes": [
                        {
                            "taxName": "Value Added Tax",
                            "amount": "40.96"
                        },
                        {
                            "taxName": "Passenger services charge April VAT 2018",
                            "amount": "86.75"
                        },
                        {
                            "taxName": "Passenger Security Charge (01 Oct 18)",
                            "amount": "22"
                        },
                        {
                            "taxName": "CAA March 2020",
                            "amount": "26.23"
                        },
                        {
                            "taxName": "COVID19 FEE",
                            "amount": "17.39"
                        },
                        {
                            "taxName": "Value Added Tax",
                            "amount": "2.61"
                        }
                    ]
                }
            ],
            "luggageAllowancesPerPassenger": null,
            "ordering_earliest_depature_date": "2020-08-25T07:30:00",
            "journeyReturnTotalStops": null,
            "journeyDepatureTotalStops": "0",
            "date_created": "2020-07-20",
            "service_fee_cost": null,
            "global_service_fee_cost_rand": null,
            "global_service_fee_cost_perc": 1.8,
            "provider_service_fee_perc": 0,
            "entity_reginal_flight_fee_cost": 0,
            "entity_service_fee_cost_rand": 100,
            "entity_service_fee_cost_perc": 4,
            "entity_service_fee_override_cost_rand": null,
            "entity_service_fee_override_cost_perc": 2,
            "totalFare_including_servicefee": 605.58,
            "totalFare_including_servicefee_before_discount": 605.58,
            "journeyDurationDepature": "01:15",
            "journeyDurationReturn": null,
            "price": "605.58",
            "logo": "FA",
            "depature_date": "Tuesday, 25 August",
            "arrival_date": "Tuesday, 25 August",
            "depature_time": "07:30am",
            "arrival_time": "08:45am",
            "journey_duration": "01h15m",
            "stops_count": "0",
            "flight_number": "FA286",
            "supplier_name": "FlySafair"
        }
    ]
}

HTTP Request

POST api/flight/get-flight-search-results

URL Parameters

Parameter Status Description
token optional string required Access Token

Body Parameters

Parameter Type Status Description
session_id string required Unique Session ID
order_by string required Order by

Search Flight Trip Summary

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.justgo.co.za/api/flight/get-flight-trip-summary',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'session_id' => 'JUSTGO-108-5f0b6a2c142ee',
            'outbound_results_id' => 456,
            'inbound_results_id' => 352,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/flight/get-flight-trip-summary"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "session_id": "JUSTGO-108-5f0b6a2c142ee",
    "outbound_results_id": 456,
    "inbound_results_id": 352
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "outbound_trip_summary": {
        "total_passengers": 1,
        "price_before_discount": 240.58,
        "price_after_discount": 230.58,
        "departure_place": "JOHANNESBURG: JOHANNESBURG PARK STATION",
        "arrival_place": "DURBAN: DURBAN STATION",
        "depature_date": "25 July 2020",
        "depature_time": "08:30am - 04:20pm"
    },
    "inbound_trip_summary": {
        "total_passengers": 1,
        "price_before_discount": 240.58,
        "price_after_discount": 230.58,
        "departure_place": "DURBAN: DURBAN STATION",
        "arrival_place": "JOHANNESBURG: JOHANNESBURG PARK STATION",
        "depature_date": "27 July 2020",
        "depature_time": "09:10am - 05:00pm"
    },
    "time_remaining_minutes": 698,
    "grand_total_price": 461.16,
    "grand_total_price_before_discount": 481.16
}

HTTP Request

POST api/flight/get-flight-trip-summary

URL Parameters

Parameter Status Description
token optional string required Access Token

Body Parameters

Parameter Type Status Description
session_id string required Unique Session ID
outbound_results_id integer required Outbound Results ID
inbound_results_id integer optional Inbound Results ID

Reserve Flight Trip

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.justgo.co.za/api/flight/reserve-flight-trip',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'session_id' => 'JUSTGO-112-5f0df4fc95605',
            'primary_email' => 'tester@test.co.za',
            'primary_mobile_number' => '0653463078',
            'outbound_results_id' => 455,
            'inbound_results_id' => 455,
            'adult_title_id_1' => 1,
            'adult_name_as_per_id_or_passport_1' => 'qui',
            'adult_surname_as_per_id_or_passport_1' => 'nobis',
            'adult_date_of_birth_day_1' => 22,
            'adult_date_of_birth_month_1' => 9,
            'adult_date_of_birth_year_1' => 1988,
            'child_title_id_1' => 1,
            'child_name_as_per_id_or_passport_1' => 'dolor',
            'child_surname_as_per_id_or_passport_1' => 'et',
            'child_date_of_birth_day_1' => 22,
            'child_date_of_birth_month_1' => 9,
            'child_date_of_birth_year_1' => 1988,
            'infant_title_id_1' => 1,
            'infant_name_as_per_id_or_passport_1' => 'sapiente',
            'infant_surname_as_per_id_or_passport_1' => 'adipisci',
            'infant_date_of_birth_day_1' => 22,
            'infant_date_of_birth_month_1' => 9,
            'infant_date_of_birth_year_1' => 1988,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/flight/reserve-flight-trip"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "session_id": "JUSTGO-112-5f0df4fc95605",
    "primary_email": "tester@test.co.za",
    "primary_mobile_number": "0653463078",
    "outbound_results_id": 455,
    "inbound_results_id": 455,
    "adult_title_id_1": 1,
    "adult_name_as_per_id_or_passport_1": "qui",
    "adult_surname_as_per_id_or_passport_1": "nobis",
    "adult_date_of_birth_day_1": 22,
    "adult_date_of_birth_month_1": 9,
    "adult_date_of_birth_year_1": 1988,
    "child_title_id_1": 1,
    "child_name_as_per_id_or_passport_1": "dolor",
    "child_surname_as_per_id_or_passport_1": "et",
    "child_date_of_birth_day_1": 22,
    "child_date_of_birth_month_1": 9,
    "child_date_of_birth_year_1": 1988,
    "infant_title_id_1": 1,
    "infant_name_as_per_id_or_passport_1": "sapiente",
    "infant_surname_as_per_id_or_passport_1": "adipisci",
    "infant_date_of_birth_day_1": 22,
    "infant_date_of_birth_month_1": 9,
    "infant_date_of_birth_year_1": 1988
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "booking_id": "5",
    "outbound_booking_reference": "BUS21182",
    "inbound_booking_reference": "BUS21183"
}

HTTP Request

POST api/flight/reserve-flight-trip

URL Parameters

Parameter Status Description
token optional string required Access Token

Body Parameters

Parameter Type Status Description
session_id string required
primary_email string required Booking Email
primary_mobile_number string required Booking contact number
outbound_results_id integer required Search outbound result_id
inbound_results_id integer optional Search inbound result_id
adult_title_id_1 integer required (1 = Mr, 2 = Mrs, 4 = Ms)
adult_name_as_per_id_or_passport_1 string required Name
adult_surname_as_per_id_or_passport_1 string required Surname
adult_date_of_birth_day_1 integer optional Day of birth
adult_date_of_birth_month_1 integer optional Month of birth
adult_date_of_birth_year_1 integer optional Year of birth
child_title_id_1 integer required (1 = Mr, 2 = Mrs, 4 = Ms)
child_name_as_per_id_or_passport_1 string required Name
child_surname_as_per_id_or_passport_1 string required Surname
child_date_of_birth_day_1 integer optional Day of birth
child_date_of_birth_month_1 integer optional Month of birth
child_date_of_birth_year_1 integer optional Year of birth
infant_title_id_1 integer required (1 = Mr, 2 = Mrs, 4 = Ms)
infant_name_as_per_id_or_passport_1 string required Name
infant_surname_as_per_id_or_passport_1 string required Surname
infant_date_of_birth_day_1 integer optional Day of birth (dd)
infant_date_of_birth_month_1 integer optional Month of birth (mm)
infant_date_of_birth_year_1 integer optional Year of birth (YYYY)
(Adult = age 11+)
(Children = age 2-11 years)
(Infant = age 0-2 years)

Pay Flight Trip

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.justgo.co.za/api/flight/pay-flight-trip',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'session_id' => 'JUSTGO-112-5f0df4fc95605',
            'booking_id' => 5,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/flight/pay-flight-trip"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "session_id": "JUSTGO-112-5f0df4fc95605",
    "booking_id": 5
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "outbound_payment_response": {
        "status": true,
        "Data": {
            "tickets": [
                {
                    "description": "Johannesburg-O.R. Tambo Intl, South Africa (JNB) - Durban-King Shaka Intl, South Africa (DUR)",
                    "reference": "JG0000015",
                    "reference2": "K8ONDC",
                    "provider_logo": "https:\/\/justgolive.zerobox.co.za\/\/upload\/setup_files\/justgo-carrier-logo.png",
                    "supplier_name": "Mango",
                    "flight_number": "JE243",
                    "trip": "Outbound",
                    "depart_from": "Johannesburg-O.R. Tambo Intl, South Africa (JNB)",
                    "departure_date_time": "2020-08-10T06:45:00",
                    "depature_date": "Monday, 10 August 2020",
                    "depature_time": "06:45am",
                    "destination": "Durban-King Shaka Intl, South Africa (DUR)",
                    "arrival_date_time": "2020-08-10T07:55:00",
                    "arrival_date": "Monday, 10 August 2020",
                    "arrival_time": "07:55am",
                    "cabin": "Economy"
                }
            ],
            "tax_amount": "190.48",
            "fare_price": "1303.47",
            "booking_cost": 1493.95,
            "legOptions": [
                {
                    "segments": [
                        {
                            "airportFromCode": "JNB",
                            "airportFromName": "Johannesburg-O.R. Tambo Intl, South Africa",
                            "airportToCode": "DUR",
                            "airportToName": "Durban-King Shaka Intl, South Africa",
                            "operatingAirlineCode": "JE",
                            "operatingAirlineName": "Mango",
                            "marketingAirlineCode": "JE",
                            "marketingAirlineName": "Mango",
                            "flightNumber": "243",
                            "departureDateTime": "2020-08-10T06:45:00",
                            "arrivalDateTime": "2020-08-10T07:55:00",
                            "stopQuantity": "0",
                            "equipmentType": "738",
                            "equipmentName": "BOEING 737-800 JET",
                            "journeyDuration": "01:10",
                            "cabin": "Economy",
                            "resBookDesigCode": "X",
                            "RPH": "1",
                            "numberInParty": "1",
                            "ticketTimeLimit": "2020-08-02T23:59:00",
                            "ticketType": "eTicket",
                            "LFID": "0"
                        }
                    ]
                }
            ]
        }
    },
    "inbound_payment_response": {
        "status": true,
        "Data": {
            "tickets": [
                {
                    "description": "Durban-King Shaka Intl, South Africa (DUR) - Johannesburg-O.R. Tambo Intl, South Africa (JNB)",
                    "reference": "JG0000015",
                    "reference2": "K8ONDC",
                    "provider_logo": "https:\/\/justgolive.zerobox.co.za\/\/upload\/setup_files\/justgo-carrier-logo.png",
                    "supplier_name": "Mango",
                    "flight_number": "JE242",
                    "trip": "Inbound",
                    "depart_from": "Durban-King Shaka Intl, South Africa (DUR)",
                    "departure_date_time": "2020-08-30T07:30:00",
                    "depature_date": "Sunday, 30 August 2020",
                    "depature_time": "07:30am",
                    "destination": "Johannesburg-O.R. Tambo Intl, South Africa (JNB)",
                    "arrival_date_time": "2020-08-30T08:35:00",
                    "arrival_date": "Sunday, 30 August 2020",
                    "arrival_time": "08:35am",
                    "cabin": "Economy"
                }
            ],
            "tax_amount": "197.98",
            "fare_price": "1295.97",
            "booking_cost": 1493.95,
            "legOptions": [
                {
                    "segments": [
                        {
                            "airportFromCode": "DUR",
                            "airportFromName": "Durban-King Shaka Intl, South Africa",
                            "airportToCode": "JNB",
                            "airportToName": "Johannesburg-O.R. Tambo Intl, South Africa",
                            "operatingAirlineCode": "JE",
                            "operatingAirlineName": "Mango",
                            "marketingAirlineCode": "JE",
                            "marketingAirlineName": "Mango",
                            "flightNumber": "242",
                            "departureDateTime": "2020-08-30T07:30:00",
                            "arrivalDateTime": "2020-08-30T08:35:00",
                            "stopQuantity": "0",
                            "equipmentType": "738",
                            "equipmentName": "BOEING 737-800 JET",
                            "journeyDuration": "01:05",
                            "cabin": "Economy",
                            "resBookDesigCode": "X",
                            "RPH": "1",
                            "numberInParty": "1",
                            "ticketTimeLimit": "2020-08-02T23:59:00",
                            "ticketType": "eTicket",
                            "LFID": "0"
                        }
                    ]
                }
            ]
        }
    },
    "passengers": [
        {
            "passen_type": "Adult",
            "title": "Mr",
            "name": "Tester",
            "surname": "justGo",
            "email": "tester2@deta.co.za",
            "dob": "2000-05-31"
        }
    ]
}

HTTP Request

POST api/flight/pay-flight-trip

URL Parameters

Parameter Status Description
token optional string required Access Token

Body Parameters

Parameter Type Status Description
session_id string required
booking_id integer required Booking ID

Maintenance Data

Get Person Titles

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.justgo.co.za/api/maintenance/get-person-titles',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api/maintenance/get-person-titles"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": "true",
    "title_options": [
        {
            "titleId": 1,
            "titleName": "Mr"
        },
        {
            "titleId": 2,
            "titleName": "Mrs"
        },
        {
            "titleId": 4,
            "titleName": "Ms"
        }
    ]
}

HTTP Request

GET api/maintenance/get-person-titles

URL Parameters

Parameter Status Description
token optional string required Access Token

Other

api.json

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.justgo.co.za/api.json',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.justgo.co.za/api.json"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "variables": [],
    "info": {
        "name": "Laravel API",
        "_postman_id": "5a6858ec-c04f-4230-b413-5f043c598156",
        "description": "",
        "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.0.0\/collection.json"
    },
    "item": [
        {
            "name": "User Authentication",
            "description": "",
            "item": [
                {
                    "name": "Login",
                    "request": {
                        "url": {
                            "protocol": "http",
                            "host": "127.0.0.1:8000",
                            "path": "api\/user\/login",
                            "query": []
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"email\": \"molestiae\",\n    \"password\": \"mollitia\"\n}"
                        },
                        "description": "",
                        "response": []
                    }
                }
            ]
        },
        {
            "name": "User Management",
            "description": "",
            "item": [
                {
                    "name": "Display a listing of the resource.",
                    "request": {
                        "url": {
                            "protocol": "http",
                            "host": "127.0.0.1:8000",
                            "path": "api\/user\/all",
                            "query": []
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "[]"
                        },
                        "description": "",
                        "response": []
                    }
                }
            ]
        },
        {
            "name": "general",
            "description": "",
            "item": [
                {
                    "name": "api.json",
                    "request": {
                        "url": {
                            "protocol": "http",
                            "host": "127.0.0.1:8000",
                            "path": "api.json",
                            "query": []
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "[]"
                        },
                        "description": "",
                        "response": []
                    }
                }
            ]
        }
    ]
}

HTTP Request

GET api.json