Skip to content

Ramp: Fetch a transaction

Ramp transaction.getTransactionCanonicalResource: arguments, response, policy and SDK examples.

← Transaction operations · Get started

Operation ramp.get_transaction_canonical_resource

Provider route: GET /developer/v1/transactions/{transaction_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["transaction"]["getTransactionCanonicalResource"]>[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.transaction.getTransactionCanonicalResource(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.transaction.get_transaction_canonical_resource(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.transaction_idstringRequired within parent
queryobjectOptionalAdditional keys: not allowed
query.include_merchant_databooleanOptional

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 transaction — response body

Referenced models: Fetch a transaction — response body

10 more schemas are linked from the tables above, on the schema pages.

Fetch a transaction — response body — accounting categories item
FieldTypePresenceDescription and constraints
$objectRoot
category_idstringOptionalUser-selected category id for transaction.
category_namestringOptionalUser-selected category name for transaction.
tracking_category_remote_idstringOptional
tracking_category_remote_namestringOptional
tracking_category_remote_typestringOptional
Fetch a transaction — response body — merchant location city, country, postal code, state
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
postal_codeJSONRequired within parent
postal_code (anyOf 1)stringAlternative
postal_code (anyOf 2)nullAlternative
stateJSONRequired within parent
state (anyOf 1)stringAlternative
state (anyOf 2)nullAlternative
Fetch a transaction — response body — attendees item
FieldTypePresenceDescription and constraints
$objectRoot
namestringRequired within parentFull name of the attendee
user_idJSONRequired within parent
user_id (anyOf 1)stringAlternativeUser ID of the attendee, if linked to a Ramp user. Missing if the attendee is not a Ramp user
Format: uuid
user_id (anyOf 2)nullAlternative
Fetch a transaction — response body — card holder
FieldTypePresenceDescription and constraints
$objectRoot
department_idstringOptionalID of the card holder's department.
Format: uuid
department_namestringOptionalName of the card holder's deparment.
employee_idstringOptionalUser-defined employee ID of the card holder.
first_namestringOptionalCard holder's first name.
last_namestringOptionalCard holder's last name.
location_idstringOptionalID of the card holder's location.
Format: uuid
location_namestringOptionalName of the card holder's location.
user_idstringOptionalCard holder's ID.
Format: uuid
Fetch a transaction — response body — disputes item
FieldTypePresenceDescription and constraints
$objectRoot
created_atstringOptionalTime at which the dispute is created, presented in ISO8601 format.
Format: date-time
idstringOptionalUniquely identifies a transaction dispute.
Format: uuid
memostringOptionalFree form text regarding the dispute.
typestringOptionalThe dispute type; It could be one of the following values: RESOLVED_BY_RAMP, CANCELLED_BY_CUSTOMER, CANCELLED_BY_RAMP, CREATED_MERCHANT_ERROR and CREATED_UNRECOGNIZED_CHARGE.
Fetch a transaction — response body — policy violations item
FieldTypePresenceDescription and constraints
$objectRoot
created_atstringOptionalTime at which the policy violation is created, presented in ISO8601 format.
Format: date-time
idstringOptionalUniquely identifies a policy violation.
Format: uuid
memostringOptionalFree form text regarding the policy violation.
typestringOptionalType of the policy violation.
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 transaction — response body — accounting field selections item
FieldTypePresenceDescription and constraints
$objectRoot
category_infoModelOptionalExpand Fetch a transaction — response body — accounting field selections item category info
Information about the accounting category (or accounting field).
display_nameJSONRequired within parent
display_name (anyOf 1)stringAlternativeCustomer-set display name for the accounting field option in Ramp. When the customer renames an option inside Ramp, this returns the new label while `name` continues to return the ERP-source name. May be null if no Ramp-side override is set.
display_name (anyOf 2)nullAlternative
external_codestringOptionalExternal code of accounting field option; Code field displayed on the ERP.
external_idstringOptionalExternal ID of accounting field option; It should uniquely identify an accounting field option on the ERP.
idstringOptionalID that uniquely identifies an accounting field option within Ramp
Format: uuid
namestringOptionalName of accounting field option
provider_namestringRequired within parentName of accounting field provider
Read only: true
sourceModelOptionalExpand Fetch a transaction — response body — accounting field selections item source
Describes the source of the accounting coding selection.
typestringOptionalAccounting field type
Known values: AMORTIZATION_TEMPLATE, BILLABLE, COST_CENTER, CUSTOMERS_JOBS, DEFERRAL_CODE, EXPENSE_ENTITY, GL_ACCOUNT, INVENTORY_ITEM, JOURNAL, MERCHANT, NON_ERP, OTHER, PAYROLL_PROVIDER, PROJECT, REPORTING_TAG, SALES_TAX_CODE, SUBSIDIARY, TAX_CODE, UNIT_OF_MEASURE

Referenced models: Fetch a transaction — response body — accounting field selections item source, Fetch a transaction — response body — accounting field selections item category info

Fetch a transaction — response body — line items item
FieldTypePresenceDescription and constraints
$objectRoot
accounting_field_selectionsarrayOptionalList of accounting field options selected to code the line item.
accounting_field_selections[]ModelEach itemExpand Fetch a transaction — response body — accounting field selections item
amountJSONRequired within parent
amount (anyOf 1)ModelAlternativeExpand Hold Bill — response body — amount
Amount of the line item, denominated in the currency that the transaction was settled in.
amount (anyOf 2)nullAlternative
converted_amountJSONRequired within parent
converted_amount (anyOf 1)ModelAlternativeExpand Hold Bill — response body — amount
Amount of the split line item, converted to the currency of the card on which the transaction occurred.
converted_amount (anyOf 2)nullAlternative
idJSONOptional
id (anyOf 1)stringAlternativeStable Ramp identifier for a persisted split line. Null for generated lines.
Format: uuid
id (anyOf 2)nullAlternative
memostringOptionalMemo associated with the line item.

Referenced models: Fetch a transaction — response body — accounting field selections item, Hold Bill — response body — amount

Fetch a transaction — response body — accounting field selections item source
FieldTypePresenceDescription and constraints
$objectRoot
typestringOptionalDescribes the type of source that added this selection.
Fetch a transaction — response body — accounting field selections item category info
FieldTypePresenceDescription and constraints
$objectRoot
external_idstringOptionalExternal ID of accounting field; It should uniquely identify an accounting field on the ERP.
idstringOptionalID that uniquely identifies an accounting field within Ramp
Format: uuid
namestringOptionalName of accounting field
typestringOptionalAccounting field type
Known values: AMORTIZATION_TEMPLATE, BILLABLE, COST_CENTER, CUSTOMERS_JOBS, DEFERRAL_CODE, EXPENSE_ENTITY, GL_ACCOUNT, INVENTORY_ITEM, JOURNAL, MERCHANT, NON_ERP, OTHER, PAYROLL_PROVIDER, PROJECT, REPORTING_TAG, SALES_TAX_CODE, SUBSIDIARY, TAX_CODE, UNIT_OF_MEASURE

SDK function policy ID: ramp.get_transaction_canonical_resource. Catalog operation: get_transaction_canonical_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: ["transactions: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.