Ramp: Fetch a spend program
Ramp spendProgram.getSpendProgramSingleResource: arguments, response, policy and SDK examples.
← Spend program operations · Get started
Operation ramp.get_spend_program_single_resource
Provider route: GET /developer/v1/spend-programs/{spend_program_id}. 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["spendProgram"]["getSpendProgramSingleResource"]>[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.spendProgram.getSpendProgramSingleResource(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.spend_program.get_spend_program_single_resource(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.spend_program_id | string | Required within parent |
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 Fetch a spend program — response body |
Referenced models: Fetch a spend program — response body
Schemas
Section titled “Schemas”105 more schemas are linked from the tables above, on the schema pages.
Fetch a spend program — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
custom_form_collection | JSON | Required within parent | |
custom_form_collection (anyOf 1) | Model | Alternative | Expand Fetch a spend program — response body — custom form collection custom form collection log entry Custom form collection for the resource, e.g. form questions required to create a request against a spend program. Read only: true |
custom_form_collection (anyOf 2) | null | Alternative | |
description | string | Required within parent | Description of the spend program. |
display_name | string | Required within parent | Display name of the spend program. |
icon | string | Required within parent | The template icon for the spend program. Known values: AccountingServicesIcon, AdvertisingIcon, CONTRACTORS_AND_PROFESSIONAL_SERVICES, CUSTOM, CardIcon, EducationStipendIcon, EmployeeRewardsIcon, GroundTransportationIcon, LegalFeesIcon, LodgingIcon, LunchOrderingIcon, OnboardingIcon, PerDiemCardIcon, SOFTWARE, SaasSubscriptionIcon, SoftwareTrialIcon, SuppliesIcon, TeamSocialIcon, TravelExpensesIcon, VirtualEventIcon, WellnessIcon, WorkFromHomeIcon, advertising, airlines, bills, business, car_services, contractor, education, entertainment, event_balloons, event_virtual, food, fuel_and_gas, general_expense, general_merchandise, gift, government_services, internet_and_phone, legal, lodging, lodging_room, newspaper, office, physical_card, procurement_checklist, procurement_intake, professional_services, restaurants, reward, saas_software, shipping, travel_misc, wellness |
id | string | Required within parent | Unique identifier of the spend program. Format: uuid |
is_shareable | boolean | Required within parent | Whether this spend program is shareable. |
issue_physical_card_if_needed | boolean | Required within parent | Indicates whether the spend program should issue a physical card if the user does not have one. |
line_item_accounting_fields | array | Required within parent | Custom accounting fields enabled for line items in this spend program. Read only: true |
line_item_accounting_fields[] | Model | Each item | Expand Fetch a spend program — response body — line item accounting fields item |
line_item_custom_fields | array | Required within parent | Custom fields enabled for line items in this spend program. Read only: true |
line_item_custom_fields[] | Model | Each item | Expand Fetch a spend program — response body — line item custom fields item |
permitted_spend_types | JSON | Required within parent | |
permitted_spend_types (anyOf 1) | Model | Alternative | Expand Fetch a spend program — response body — permitted spend types primary card enabled, reimbursements enabled Permitted spend types for the spend program. |
permitted_spend_types (anyOf 2) | null | Alternative | |
restrictions | JSON | Required within parent | |
restrictions (anyOf 1) | Model | Alternative | Expand Fetch a spend program — response body — restrictions allowed categories, allowed vendors, auto lock date, blocked categories, blocked vendors, interval, limit, next interval reset, start of interval, temporary limit, transaction amount limit A set of restrictions imposed on the spend program. Read only: true |
restrictions (anyOf 2) | null | Alternative |
Referenced models: Fetch a spend program — response body — permitted spend types primary card enabled, reimbursements enabled, Fetch a spend program — response body — custom form collection custom form collection log entry, Fetch a spend program — response body — line item accounting fields item, Fetch a spend program — response body — line item custom fields item, Fetch a spend program — response body — restrictions allowed categories, allowed vendors, auto lock date, blocked categories, blocked vendors, interval, limit, next interval reset, start of interval, temporary limit, transaction amount limit
Fetch a spend program — response body — permitted spend types primary card enabled, reimbursements enabled
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
primary_card_enabled | boolean | Required within parent | Indicates whether the user's physical card can be linked to this limit. |
reimbursements_enabled | boolean | Required within parent | Indicates whether reimbursements can be submitted against this limit. |
Fetch a spend program — response body — custom form collection custom form collection log entry
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
custom_form_collection_log_entry | JSON | Required within parent | |
custom_form_collection_log_entry (anyOf 1) | Model | Alternative | Expand Fetch a spend program — response body — custom form collection custom form collection log entry custom form collection log entry forms, label Latest log entry for the custom form collection. |
custom_form_collection_log_entry (anyOf 2) | null | Alternative |
Referenced models: Fetch a spend program — response body — custom form collection custom form collection log entry custom form collection log entry forms, label
Fetch a spend program — response body — line item accounting fields item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
external_id | string | Required within parent | External ID that uniquely identifies this field in the ERP. |
id | string | Required within parent | ID that uniquely identifies an accounting field within Ramp Format: uuid |
is_required | boolean | Required within parent | Whether this accounting field is required for line items in the spend program. |
name | string | Required within parent | Display name of the custom accounting field. |
type | string | Required within parent | Type of the custom accounting field. 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 |
Fetch a spend program — response body — line item custom fields item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
description | JSON | Required within parent | |
description (anyOf 1) | string | Alternative | Description of the custom field. |
description (anyOf 2) | null | Alternative | |
display_name | string | Required within parent | Display name of the custom field. |
field_type | string | Required within parent | Type of the custom field. Known values: boolean, category, currency, date, email, multi_select, number, numeric_id, paragraph, percentage, phone, select, text, url |
id | string | Required within parent | ID that uniquely identifies the custom field within Ramp. |
is_required | boolean | Required within parent | Whether this custom field is required for line items in the spend program. |
Fetch a spend program — response body — custom form collection custom form collection log entry custom form collection log entry forms, label
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
forms | array | Required within parent | The collection of custom forms for the custom form collection log entry. |
forms[] | Model | Each item | Expand Fetch a spend program — response body — custom form collection custom form collection log entry custom form collection log entry forms, label forms item |
label | JSON | Required within parent | |
label (anyOf 1) | string | Alternative | The label or name for the custom form collection log entry. |
label (anyOf 2) | null | Alternative |
Referenced models: Fetch a spend program — response body — custom form collection custom form collection log entry custom form collection log entry forms, label forms item
Hold Bill — response body — amount
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
amount | JSON | Required within parent | |
amount (anyOf 1) | integer | Alternative | the amount of money represented in the smallest denomination of the currency. For example, when the currency is USD, then the amount is expressed in cents. |
amount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
currency_code | string | Required within parent | The type of currency, in ISO 4217 format. e.g. USD for US dollars Default: USD |
minor_unit_conversion_rate | JSON | Required within parent | |
minor_unit_conversion_rate (anyOf 1) | JSON | Alternative | |
minor_unit_conversion_rate (anyOf 1) (anyOf 1) | integer | Alternative | The conversion factor to convert from the integer amount to the actual currency value. Divide amount by this value to get the real currency amount. For USD, this is 100 (e.g., 12034 / 100 = 120.34 USD). See https://docs.ramp.com/developer-api/v1/monetary-values for more information. Read only: true |
minor_unit_conversion_rate (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
minor_unit_conversion_rate (anyOf 2) | null | Alternative |
Fetch a spend program — response body — custom form collection custom form collection log entry custom form collection log entry forms, label forms item fields item document category string
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | Known values: ADDENDUM_OR_RIDER, AMENDMENT, BANK_LETTER, CAIQ_LITE, CERTIFICATE_OF_INSURANCE, CONTRACT_OTHER, DATA_PROTECTION_AGREEMENT, ECOVADIS, ENGAGEMENT_LETTER, FAQ, FORM_1099, GDPR, HIPAA, INVOICE, ISO_27001, ISO_9001, MSA, NDA, NMSDC_CERTIFICATION, ORDER_FORM, OTHER, PAYMENT_INSTRUCTIONS, PCI_DSS, PEN_TEST_REPORT, PRIVACY_POLICY, PURCHASE_ORDER, QUESTIONNAIRE, QUOTE, SECURITY_DOCUMENT, SECURITY_EXHIBIT, SIG, SLA, SOC_1_TYPE_1, SOC_1_TYPE_2, SOC_2, SOW, TAX_DOCUMENT, TAX_DOCUMENT_INTL_COR, TAX_DOCUMENT_INTL_GOV_FORM, TAX_DOCUMENT_INTL_OTHER, TAX_DOCUMENT_INTL_STATUTORY_FORM, TOS, VENDOR_CONTRACT, VENDOR_CREDIT, VOIDED_CHECK, W8, W9 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: ramp.get_spend_program_single_resource. Catalog operation: get_spend_program_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: ["spend_programs:read"]