> ## Documentation Index
> Fetch the complete documentation index at: https://code.dcycle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Business Travel

> Retrieve a specific business travel record by ID

# Get Business Travel

Retrieve detailed information about a specific business travel record by its unique identifier.

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication

  **Example:** `sk_live_1234567890abcdef`
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID

  **Example:** `a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

### Path Parameters

<ParamField path="business_travel_id" type="string" required>
  The unique identifier (UUID) of the business travel record

  **Example:** `550e8400-e29b-41d4-a716-446655440000`
</ParamField>

## Response

<ResponseField name="id" type="string">
  Unique identifier (UUID)
</ResponseField>

<ResponseField name="organization_id" type="string">
  Organization UUID
</ResponseField>

<ResponseField name="name" type="string | null">
  Travel record label
</ResponseField>

<ResponseField name="email" type="string | null">
  Traveler email
</ResponseField>

<ResponseField name="transport_type" type="string">
  Mode of transport: `car`, `metro`, `train`, `trolleybus`, `bus`, `motorbike`, `aircraft`, `ferry`
</ResponseField>

<ResponseField name="start_date" type="date">
  Start date of travel
</ResponseField>

<ResponseField name="end_date" type="date">
  End date of travel
</ResponseField>

<ResponseField name="distance_km" type="number | null">
  Distance traveled in kilometers
</ResponseField>

<ResponseField name="distance_source" type="string | null">
  How the distance was obtained: `manual` (provided directly), `geodesic` (great-circle for aircraft), or `google_maps` (other transport types with origin/destination)
</ResponseField>

<ResponseField name="origin" type="string | null">
  Starting location address
</ResponseField>

<ResponseField name="destination" type="string | null">
  Ending location address
</ResponseField>

<ResponseField name="origin_geocode" type="object | null">
  Geocoded origin location details (when available)

  <Expandable title="geocode fields">
    <ResponseField name="origin_geocode.country_code" type="string">ISO country code</ResponseField>
    <ResponseField name="origin_geocode.place_id" type="string">Place identifier</ResponseField>
    <ResponseField name="origin_geocode.address_formatted" type="string">Formatted address</ResponseField>
    <ResponseField name="origin_geocode.latitude" type="number">Latitude coordinate</ResponseField>
    <ResponseField name="origin_geocode.longitude" type="number">Longitude coordinate</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="destination_geocode" type="object | null">
  Geocoded destination location details (when available). Same structure as `origin_geocode`.
</ResponseField>

<ResponseField name="travel_type" type="string">
  Trip type: `one_way` or `round`
</ResponseField>

<ResponseField name="travel_number" type="integer">
  Number of trips
</ResponseField>

<ResponseField name="passenger_number" type="integer">
  Number of passengers per trip
</ResponseField>

<ResponseField name="vehicle_size" type="string | null">
  Vehicle size (car only): `small`, `medium`, `large`
</ResponseField>

<ResponseField name="fuel_type" type="string | null">
  Fuel type (car only): `diesel`, `petrol`, `natural_gas`, `lpg`, `electric`, `hybrid`, `not_fuel_based`, `do_not_know`
</ResponseField>

<ResponseField name="renewable_energy" type="string | null">
  Renewable energy usage: `yes`, `no`, `do_not_know`
</ResponseField>

<ResponseField name="status" type="string">
  Current status: `active`, `pending`, `loading`, `completed`, `error`
</ResponseField>

<ResponseField name="source" type="string">
  Record source: `api`, `manual`, `bulk_upload`, `form`
</ResponseField>

<ResponseField name="co2e" type="number | null">
  Calculated CO2 equivalent emissions in kg. `null` or `0` while calculation is pending.
</ResponseField>

<ResponseField name="file_id" type="string | null">
  File UUID if created via bulk upload
</ResponseField>

<ResponseField name="file_name" type="string | null">
  File name if created via bulk upload
</ResponseField>

<ResponseField name="uploaded_by" type="object | null">
  The user who created this record

  <Expandable title="user fields">
    <ResponseField name="uploaded_by.id" type="string">User UUID</ResponseField>
    <ResponseField name="uploaded_by.first_name" type="string | null">First name</ResponseField>
    <ResponseField name="uploaded_by.last_name" type="string | null">Last name</ResponseField>
    <ResponseField name="uploaded_by.profile_img_url" type="string | null">Profile image URL</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="created_at" type="datetime">
  Creation timestamp
</ResponseField>

<ResponseField name="updated_at" type="datetime | null">
  Last update timestamp
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X GET "https://api.dcycle.io/v1/business-travels/550e8400-e29b-41d4-a716-446655440000" \
    -H "x-api-key: ${DCYCLE_API_KEY}" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests
  import os

  travel_id = "550e8400-e29b-41d4-a716-446655440000"

  response = requests.get(
      f"https://api.dcycle.io/v1/business-travels/{travel_id}",
      headers={
          "x-api-key": os.getenv("DCYCLE_API_KEY"),
          "x-organization-id": os.getenv("DCYCLE_ORG_ID"),
      },
  )

  travel = response.json()
  print(f"Travel: {travel['origin']} -> {travel['destination']}")
  print(f"Distance: {travel['distance_km']} km ({travel['distance_source']})")
  print(f"Type: {travel['travel_type']}, Status: {travel['status']}")
  print(f"Emissions: {travel['co2e']} kg CO2e")
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const axios = require('axios');

  const travelId = '550e8400-e29b-41d4-a716-446655440000';

  axios.get(
    `https://api.dcycle.io/v1/business-travels/${travelId}`,
    {
      headers: {
        'x-api-key': process.env.DCYCLE_API_KEY,
        'x-organization-id': process.env.DCYCLE_ORG_ID,
      },
    }
  )
  .then(({ data: travel }) => {
    console.log(`Travel: ${travel.origin} -> ${travel.destination}`);
    console.log(`Distance: ${travel.distance_km} km (${travel.distance_source})`);
    console.log(`Type: ${travel.travel_type}, Status: ${travel.status}`);
    console.log(`Emissions: ${travel.co2e} kg CO2e`);
  })
  .catch(error => console.error(error));
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
  "name": null,
  "email": null,
  "transport_type": "train",
  "start_date": "2024-12-01",
  "end_date": "2024-12-01",
  "distance_km": 621.5,
  "distance_source": "google_maps",
  "origin": "Madrid, Spain",
  "destination": "Barcelona, Spain",
  "origin_geocode": {
    "country_code": "ES",
    "place_id": "ChIJgTwKgJcpQg0RaSKMYcHeNsQ",
    "address_formatted": "Madrid, Spain",
    "latitude": 40.4168,
    "longitude": -3.7038
  },
  "destination_geocode": {
    "country_code": "ES",
    "place_id": "ChIJ5TCOcRaYpBIRCmZHTz37sEQ",
    "address_formatted": "Barcelona, Spain",
    "latitude": 41.3874,
    "longitude": 2.1686
  },
  "travel_type": "one_way",
  "travel_number": 2,
  "passenger_number": 1,
  "vehicle_size": null,
  "fuel_type": null,
  "renewable_energy": null,
  "status": "active",
  "source": "api",
  "co2e": 24.86,
  "file_id": null,
  "file_name": null,
  "uploaded_by": {
    "id": "user-123",
    "first_name": "Maria",
    "last_name": "García",
    "profile_img_url": null
  },
  "created_at": "2024-12-01T10:30:00Z",
  "updated_at": "2024-12-01T10:30:00Z"
}
```

## Common Errors

### 401 Unauthorized

**Cause:** Missing or invalid API key

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
```

### 403 Forbidden

**Cause:** The authenticated user is not a member of the organization

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
```

### 404 Not Found

**Cause:** Business travel not found or doesn't belong to your organization

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"detail": "BusinessTravel with id=550e8400-e29b-41d4-a716-446655440000 not found", "code": "BUSINESS_TRAVEL_NOT_FOUND"}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="List Business Travels" icon="list" href="/api-reference/business-travels/list">
    Retrieve all business travels
  </Card>

  <Card title="Create Business Travel" icon="plus" href="/api-reference/business-travels/create">
    Create a new business travel record
  </Card>

  <Card title="Update Business Travel" icon="pencil" href="/api-reference/business-travels/update">
    Modify business travel details
  </Card>

  <Card title="Delete Business Travel" icon="trash" href="/api-reference/business-travels/delete">
    Remove a business travel record
  </Card>
</CardGroup>
