Skip to content

Ramp: Fetch a trip

Ramp trips.getTripSingleResource: arguments, response, policy and SDK examples.

← Trips operations · Get started

Operation ramp.get_trip_single_resource

Provider route: GET /developer/v1/trips/{trip_id}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/ramp with npm, or alter-sdk-ramp with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { RampIntegration } from "@alter-ai/ramp";
async function execute(input: Parameters<RampIntegration["trips"]["getTripSingleResource"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new RampIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.trips.getTripSingleResource(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_ramp import RampIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = RampIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.trips.get_trip_single_resource(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.trip_idstringRequired within parentFormat: uuid

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Fetch a trip — response body

Referenced models: Fetch a trip — response body

Fetch a trip — response body
FieldTypePresenceDescription and constraints
$objectRoot
created_atstringRequired within parentThe date the trip was created
Format: date-time
descriptionJSONRequired within parent
description (anyOf 1)stringAlternativeThe description for the trip
description (anyOf 2)nullAlternative
end_datestringRequired within parentThe date the trip ends
Format: date-time
idstringRequired within parentUnique identifier for the trip
Format: uuid
length_in_daysJSONRequired within parent
length_in_days (anyOf 1)integerAlternativeNumber of days for the trip
length_in_days (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
locationsarrayRequired within parentDestinations and location segments for the trip
locations[]ModelEach itemExpand Fetch a trip — response body — locations item
namestringRequired within parentThe name of the trip
spend_eventsarrayRequired within parentSpend events for the trip
spend_events[]ModelEach itemExpand Fetch a trip — response body — spend events item
start_datestringRequired within parentThe date the trip starts
Format: date-time
statusstringRequired within parentCurrent trip status
Known values: cancelled, completed, ongoing, upcoming
total_spendJSONRequired within parent
total_spend (anyOf 1)numberAlternativeTotal spend for the trip. Deprecated: use `total_spend_amount` instead.
Read only: true
total_spend (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
total_spend_amountJSONRequired within parent
total_spend_amount (anyOf 1)ModelAlternativeExpand Fetch a transaction — response body — entity amount currency, value
Total spend for the trip in minor units with an explicit ISO 4217 currency code. May be negative for refund-dominated trips. `null` when the trip has no spend events or its spend events do not share a single recognized currency.
Read only: true
total_spend_amount (anyOf 2)nullAlternative
travel_typesarrayRequired within parentTypes of travel for this trip (flights, hotels, cars)
Read only: true
travel_types[]stringEach itemKnown values: CAR, FLIGHT, HOTEL
updated_atstringRequired within parentThe date the trip was last updated
Format: date-time
user_idstringRequired within parentUser/traveler's ID
Format: uuid

Referenced models: Fetch a transaction — response body — entity amount currency, value, Fetch a trip — response body — locations item, Fetch a trip — response body — spend events item

Fetch a transaction — response body — entity amount currency, value
FieldTypePresenceDescription and constraints
$objectRoot
currencystringRequired within parentThe currency of the amount in ISO 4217 format (e.g. USD).
Known values: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BOV, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHE, CHF, CHW, CLF, CLP, CNH, CNY, COP, COU, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, EURC, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MXV, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, OPEN_USD, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDB, USDC, USDG, USDT, USN, UYI, UYU, UYW, UZS, VED, VES, VND, VUV, WST, XAD, XAF, XAG, XAU, XBA, XBB, XBC, XBD, XCD, XCG, XDR, XOF, XPD, XPF, XPT, XSU, XTS, XUA, XXX, YER, ZAR, ZMW, ZWG, ZWL
valueJSONRequired within parent
value (anyOf 1)integerAlternativeThe amount in the smallest denomination of the currency (e.g. cents for USD). May be negative for refunds or credits.
value (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
Fetch a trip — response body — locations item
FieldTypePresenceDescription and constraints
$objectRoot
end_datestringRequired within parentThe date the trip segment ends
Format: date-time
locationModelRequired within parentExpand Fetch a trip — response body — locations item location
The location of the trip segment
start_datestringRequired within parentThe date the trip segment starts
Format: date-time

Referenced models: Fetch a trip — response body — locations item location

Fetch a trip — response body — spend events item
FieldTypePresenceDescription and constraints
$objectRoot
idstringRequired within parentThe ID of the spend event
Format: uuid
Read only: true
spend_typestringRequired within parentThe type of the spend event
Known values: BILL, REIMBURSEMENT, TRANSACTION
Fetch a trip — response body — locations item location
FieldTypePresenceDescription and constraints
$objectRoot
cityJSONRequired within parent
city (anyOf 1)stringAlternative
city (anyOf 2)nullAlternative
countryJSONRequired within parent
country (anyOf 1)stringAlternative
country (anyOf 2)nullAlternative
latitudeJSONRequired within parent
latitude (anyOf 1)JSONAlternative
latitude (anyOf 1) (anyOf 1)numberAlternative
latitude (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
latitude (anyOf 2)nullAlternative
longitudeJSONRequired within parent
longitude (anyOf 1)JSONAlternative
longitude (anyOf 1) (anyOf 1)numberAlternative
longitude (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
longitude (anyOf 2)nullAlternative
stateJSONRequired within parent
state (anyOf 1)stringAlternative
state (anyOf 2)nullAlternative

SDK function policy ID: ramp.get_trip_single_resource. Catalog operation: get_trip_single_resource. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["trips:read"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.