Ramp: List transactions
Ramp transaction.getTransactionsCanonicalListWithPagination: arguments, response, policy and SDK examples.
← Transaction operations · Get started
Operation ramp.get_transactions_canonical_list_with_pagination
Provider route: GET /developer/v1/transactions. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”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"]["getTransactionsCanonicalListWithPagination"]>[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.getTransactionsCanonicalListWithPagination(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom 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_transactions_canonical_list_with_pagination(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Optional | Additional keys: not allowed |
query.sk_category_id | integer | Optional | One of: 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 23, 24, 25, 26, 27, 28, 29, 3, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 4, 40, 41, 42, 43, 44, 5, 6, 7, 8, 9 |
query.department_id | string | Optional | Format: uuid |
query.limit_id | string | Optional | Format: uuid |
query.location_id | string | Optional | Format: uuid |
query.merchant_id | string | Optional | Format: uuid |
query.card_id | string | Optional | Format: uuid |
query.spend_program_id | string | Optional | Format: uuid |
query.statement_id | string | Optional | Format: uuid |
query.approval_status | string | Optional | One of: AWAITING_EMPLOYEE, AWAITING_EMPLOYEE_CHANGES_REQUESTED, AWAITING_EMPLOYEE_MISSING_ITEMS, AWAITING_EMPLOYEE_REPAYMENT_FAILED, AWAITING_EMPLOYEE_REPAYMENT_REQUESTED, AWAITING_REVIEWER, FULLY_APPROVED |
query.state | string | Optional | One of: ALL, CLEARED, COMPLETION, DECLINED, ERROR, PENDING, PENDING_INITIATION |
query.user_id | string | Optional | Format: uuid |
query.awaiting_approval_by_user_id | string | Optional | Format: uuid |
query.sync_status | string | Optional | One of: NOT_SYNC_READY, SYNCED, SYNC_READY |
query.has_been_approved | boolean | Optional | |
query.all_requirements_met_and_approved | boolean | Optional | |
query.has_statement | boolean | Optional | |
query.synced_after | string | Optional | Format: date-time |
query.min_amount | JSON | Optional | |
query.min_amount (oneOf 1) | string | Alternative | Format: decimal |
query.min_amount (oneOf 2) | number | Alternative | |
query.has_no_sync_commits | boolean | Optional | |
query.max_amount | JSON | Optional | |
query.max_amount (oneOf 1) | string | Alternative | Format: decimal |
query.max_amount (oneOf 2) | number | Alternative | |
query.from_date | string | Optional | Format: date-time |
query.to_date | string | Optional | Format: date-time |
query.trip_id | string | Optional | Format: uuid |
query.accounting_field_selection_id | string | Optional | Format: uuid |
query.entity_id | string | Optional | Format: uuid |
query.requires_memo | boolean | Optional | |
query.include_count | boolean | Optional | Default: false |
query.include_merchant_data | boolean | Optional | |
query.order_by_date_asc | boolean | Optional | |
query.order_by_date_desc | boolean | Optional | |
query.order_by_amount_asc | boolean | Optional | |
query.order_by_amount_desc | boolean | Optional | |
query.start | string | Optional | |
query.page_size | integer | Optional | Default: 20 |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand List transactions — response body |
Referenced models: List transactions — response body
Schemas
Section titled “Schemas”12 more schemas are linked from the tables above, on the schema pages.
List transactions — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | array | Required within parent | Resources returned in this page. |
data[] | Model | Each item | Expand List transactions — response body — data item |
page | Model | Required within parent | Expand List transactions — response body — page Pagination details for this response. |
Referenced models: List transactions — response body — page, List transactions — response body — data item
List transactions — response body — page
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Pagination details for a Developer API response, with an optional total count. |
next | JSON | Required within parent | |
next (anyOf 1) | string | Alternative | the query to get to the next page; it is in the format of <BASE_URL>?<new_params> |
next (anyOf 2) | null | Alternative | |
total_count | JSON | Required within parent | |
total_count (anyOf 1) | JSON | Alternative | |
total_count (anyOf 1) (anyOf 1) | integer | Alternative | Total number of results matching the query, at most 10,000. Null when include_count is not set, or when the count could not be computed in time. |
total_count (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
total_count (anyOf 2) | null | Alternative | |
total_count_capped | JSON | Required within parent | |
total_count_capped (anyOf 1) | boolean | Alternative | Whether more than 10,000 results match, in which case total_count is 10,000. Null whenever total_count is null. |
total_count_capped (anyOf 2) | null | Alternative |
Fetch a transaction — response body — accounting categories item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
category_id | string | Optional | User-selected category id for transaction. |
category_name | string | Optional | User-selected category name for transaction. |
tracking_category_remote_id | string | Optional | |
tracking_category_remote_name | string | Optional | |
tracking_category_remote_type | string | Optional |
Fetch a transaction — response body — merchant location city, country, postal code, state
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
city | JSON | Required within parent | |
city (anyOf 1) | string | Alternative | |
city (anyOf 2) | null | Alternative | |
country | JSON | Required within parent | |
country (anyOf 1) | string | Alternative | |
country (anyOf 2) | null | Alternative | |
postal_code | JSON | Required within parent | |
postal_code (anyOf 1) | string | Alternative | |
postal_code (anyOf 2) | null | Alternative | |
state | JSON | Required within parent | |
state (anyOf 1) | string | Alternative | |
state (anyOf 2) | null | Alternative |
Fetch a transaction — response body — attendees item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
name | string | Required within parent | Full name of the attendee |
user_id | JSON | Required within parent | |
user_id (anyOf 1) | string | Alternative | User 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) | null | Alternative |
Fetch a transaction — response body — card holder
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
department_id | string | Optional | ID of the card holder's department. Format: uuid |
department_name | string | Optional | Name of the card holder's deparment. |
employee_id | string | Optional | User-defined employee ID of the card holder. |
first_name | string | Optional | Card holder's first name. |
last_name | string | Optional | Card holder's last name. |
location_id | string | Optional | ID of the card holder's location. Format: uuid |
location_name | string | Optional | Name of the card holder's location. |
user_id | string | Optional | Card holder's ID. Format: uuid |
Fetch a transaction — response body — disputes item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
created_at | string | Optional | Time at which the dispute is created, presented in ISO8601 format. Format: date-time |
id | string | Optional | Uniquely identifies a transaction dispute. Format: uuid |
memo | string | Optional | Free form text regarding the dispute. |
type | string | Optional | The 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
created_at | string | Optional | Time at which the policy violation is created, presented in ISO8601 format. Format: date-time |
id | string | Optional | Uniquely identifies a policy violation. Format: uuid |
memo | string | Optional | Free form text regarding the policy violation. |
type | string | Optional | Type of the policy violation. |
Fetch a transaction — response body — entity amount currency, value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
currency | string | Required within parent | The 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 |
value | JSON | Required within parent | |
value (anyOf 1) | integer | Alternative | The amount in the smallest denomination of the currency (e.g. cents for USD). May be negative for refunds or credits. |
value (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Fetch a transaction — response body — accounting field selections item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
category_info | Model | Optional | Expand Fetch a transaction — response body — accounting field selections item category info Information about the accounting category (or accounting field). |
display_name | JSON | Required within parent | |
display_name (anyOf 1) | string | Alternative | Customer-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) | null | Alternative | |
external_code | string | Optional | External code of accounting field option; Code field displayed on the ERP. |
external_id | string | Optional | External ID of accounting field option; It should uniquely identify an accounting field option on the ERP. |
id | string | Optional | ID that uniquely identifies an accounting field option within Ramp Format: uuid |
name | string | Optional | Name of accounting field option |
provider_name | string | Required within parent | Name of accounting field provider Read only: true |
source | Model | Optional | Expand Fetch a transaction — response body — accounting field selections item source Describes the source of the accounting coding selection. |
type | string | Optional | Accounting 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 — accounting field selections item source
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
type | string | Optional | Describes the type of source that added this selection. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: ramp.get_transactions_canonical_list_with_pagination. Catalog operation: get_transactions_canonical_list_with_pagination. 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"]