Skip to main content
GET
https://api.dcycle.io
/
v1
/
business-travels
/
{business_travel_id}
Get Business Travel
const options = {
  method: 'GET',
  headers: {Authorization: '<authorization>', 'x-organization-id': '<x-organization-id>'}
};

fetch('https://api.dcycle.io/v1/business-travels/{business_travel_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "<string>",
  "travel_date": "<string>",
  "transport_type": "<string>",
  "distance_km": 123,
  "origin": {},
  "destination": {},
  "travel_number": 123,
  "round_trip": true,
  "vehicle_size": {},
  "fuel_type": {},
  "flight_type": {},
  "cabin_class": {},
  "status": "<string>",
  "co2e": 123,
  "created_at": {},
  "updated_at": {}
}

Get Business Travel

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

Request

Headers

Authorization
string
required
Bearer token for authenticationExample: Bearer sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Path Parameters

business_travel_id
string
required
The unique identifier (UUID) of the business travel recordExample: 550e8400-e29b-41d4-a716-446655440000

Response

id
string
Unique identifier (UUID)
travel_date
date
Date of the business travel
transport_type
string
Mode of transport: car, metro, train, trolleybus, bus, motorbike, aircraft, ferry
distance_km
number
Distance traveled in kilometers
origin
string | null
Starting location address
destination
string | null
Ending location address
travel_number
integer
Number of travelers
round_trip
boolean
Whether this is a round trip
vehicle_size
string | null
Vehicle size (for car/motorbike): small, medium, large, average
fuel_type
string | null
Fuel type (for car/motorbike)
flight_type
string | null
Flight type (for aircraft): domestic, short_haul_international, long_haul_international
cabin_class
string | null
Cabin class (for aircraft): economy, premium_economy, business, first, average
status
string
Current status: active, pending, error
co2e
number
Calculated CO2 equivalent emissions in kg
created_at
datetime
Timestamp when the record was created
updated_at
datetime
Timestamp when the record was last updated

Example

curl -X GET "https://api.dcycle.io/v1/business-travels/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}"

Successful Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "travel_date": "2024-12-01",
  "transport_type": "train",
  "distance_km": 621.5,
  "origin": "Madrid, Spain",
  "destination": "Barcelona, Spain",
  "travel_number": 2,
  "round_trip": false,
  "vehicle_size": null,
  "fuel_type": null,
  "flight_type": null,
  "cabin_class": null,
  "status": "active",
  "co2e": 24.86,
  "created_at": "2024-12-01T10:30:00Z",
  "updated_at": "2024-12-01T10:30:00Z"
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{
  "detail": "Invalid API key",
  "code": "INVALID_API_KEY"
}

404 Not Found

Cause: Business travel not found or doesn’t belong to your organization
{
  "detail": "BusinessTravel with id=550e8400-e29b-41d4-a716-446655440000 not found",
  "code": "BUSINESS_TRAVEL_NOT_FOUND"
}
Solution: Verify that:
  1. The business travel ID is correct
  2. The business travel belongs to the organization specified in x-organization-id