Ramp: Create a spend program
Ramp spendProgram.postSpendProgramResource: arguments, response, policy and SDK examples.
← Spend program operations · Get started
Operation ramp.post_spend_program_resource
Provider route: POST /developer/v1/spend-programs. 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"]["postSpendProgramResource"]>[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.postSpendProgramResource(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.post_spend_program_resource(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | Model | Required within parent | Expand Create a spend program — request body — body |
Referenced models: Create a spend program — request body — body
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 Create a spend program — response body |
Referenced models: Create a spend program — response body
Schemas
Section titled “Schemas”3 more schemas are linked from the tables above, on the schema pages.
Create a spend program — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
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. One of: 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 |
is_shareable | boolean | Optional | Dictates whether the spend program is shareable among multiple users. Default: false |
issuance_rules | JSON | Optional | |
issuance_rules (anyOf 1) | Model | Alternative | Expand Create a spend program — request body — body issuance rules automatic, requestable Spend Program Issuance Rules can be set for requests or default issuance of Limits from a program. Set whether a program is requestable or issued by default for a given set of users and their attributes (department, locations, and custom fields). If you'd like to give these permissions to all employees, you can set `applies_to_all` to `True`. Feel free to ignore this if you don't want any custom requestability or issuance logic. Default: null |
issuance_rules (anyOf 2) | null | Alternative | |
issue_physical_card_if_needed | boolean | Optional | Dictates whether the spend program should issue a physical card if the user does not have one. Default: false |
permitted_spend_types | Model | Required within parent | Expand Create a spend program — request body — body permitted spend types Specifies the permitted spend types for the spend program. |
spending_restrictions | Model | Required within parent | Expand Create a spend program — request body — body spending restrictions A set of restrictions imposed on the spend program. |
Referenced models: Create a spend program — request body — body permitted spend types, Create a spend program — request body — body issuance rules automatic, requestable, Create a spend program — request body — body spending restrictions
Create a spend program — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
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. |
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 — 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
Create a spend program — request body — body permitted spend types
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
primary_card_enabled | boolean | Required within parent | Dictates whether the user's physical card can be linked to this limit. |
reimbursements_enabled | boolean | Required within parent | Dictates whether reimbursements can be submitted against this limit. |
Create a spend program — request body — body issuance rules automatic, requestable
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
automatic | JSON | Optional | |
automatic (anyOf 1) | Model | Alternative | Expand Create a spend program — request body — body issuance rules automatic, requestable automatic applies to all, department ids, location ids, user custom field ids Set of rules for having spend programs issued by default to users |
automatic (anyOf 2) | null | Alternative | |
requestable | JSON | Optional | |
requestable (anyOf 1) | Model | Alternative | Expand Create a spend program — request body — body issuance rules automatic, requestable automatic applies to all, department ids, location ids, user custom field ids Set of rules for users requesting spend programs. |
requestable (anyOf 2) | null | Alternative |
Referenced models: Create a spend program — request body — body issuance rules automatic, requestable automatic applies to all, department ids, location ids, user custom field ids
Create a spend program — request body — body spending restrictions
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
allowed_categories | array | Optional | List of Ramp category codes allowed for the limit. |
allowed_categories[] | integer | Each item | 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 |
allowed_vendors | array | Optional | List of merchants allowed for the limit. |
allowed_vendors[] | string | Each item | Format: uuid |
blocked_categories | array | Optional | List of Ramp category codes blocked for the limit. |
blocked_categories[] | integer | Each item | 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 |
blocked_mcc_codes | array | Optional | |
blocked_mcc_codes[] | string | Each item | |
blocked_vendors | array | Optional | List of merchants blocked for the limit. |
blocked_vendors[] | string | Each item | Format: uuid |
interval | string | Required within parent | Time interval to apply limit to. One of: ANNUAL, DAILY, MONTHLY, QUARTERLY, TERTIARY, TOTAL, WEEKLY, YEARLY |
limit | Model | Required within parent | Expand Create a fund — request body — body spending restrictions limit Total amount limit per interval denominated in the smallest currency unit (e.g. cents for USD). |
lock_date | string | Optional | Date to automatically lock the card. If lock date has passed, set to a future date or to null to unlock the card. Format: date-time |
transaction_amount_limit | Model | Optional | Expand Create a fund — request body — body spending restrictions limit Max amount per transaction denominated in the smallest currency unit (e.g. cents for USD). |
Referenced models: Create a fund — request body — body spending restrictions 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. |
Create a fund — request body — body spending restrictions limit
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
amount | integer | Required within parent | 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. |
currency_code | string | Optional | The type of currency, in ISO 4217 format. e.g. USD for US dollars Default: USD |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: ramp.post_spend_program_resource. Catalog operation: post_spend_program_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:write"]