Ramp: Link a spend request to a vendor agreement
Ramp vendor.postVendorAgreementSpendRequestLinkResource: arguments, response, policy and SDK examples.
← Vendor operations · Get started
Operation ramp.post_vendor_agreement_spend_request_link_resource
Provider route: POST /developer/v1/vendors/agreements/{agreement_id}/link-spend-request. 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["vendor"]["postVendorAgreementSpendRequestLinkResource"]>[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.vendor.postVendorAgreementSpendRequestLinkResource(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.vendor.post_vendor_agreement_spend_request_link_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.agreement_id | string | Required within parent | |
body | Model | Required within parent | Expand Link a spend request to a vendor agreement — request body — body |
Referenced models: Link a spend request to a vendor agreement — 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 Link a spend request to a vendor agreement — response body |
Referenced models: Link a spend request to a vendor agreement — response body
Schemas
Section titled “Schemas”44 more schemas are linked from the tables above, on the schema pages.
Link a spend request to a vendor agreement — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
source | string | Required within parent | Type of agreement relationship to create for the spend request. Supported values are RENEWAL and EXPANSION_REQUEST. One of: EXPANSION_REQUEST, RENEWAL |
spend_request_id | string | Required within parent | Unique identifier of the spend request to link to the agreement. Format: uuid |
Link a spend request to a vendor agreement — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
agreement | Model | Required within parent | Expand Fetch a vendor agreement — response body |
number_of_documents_linked | JSON | Required within parent | |
number_of_documents_linked (anyOf 1) | integer | Alternative | Number of documents linked to the agreement. |
number_of_documents_linked (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
number_of_purchase_orders_linked | JSON | Required within parent | |
number_of_purchase_orders_linked (anyOf 1) | integer | Alternative | Number of purchase orders linked to the agreement. |
number_of_purchase_orders_linked (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Referenced models: Fetch a vendor agreement — response body
Fetch a vendor agreement — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
archived_at | JSON | Optional | |
archived_at (anyOf 1) | string | Alternative | Format: date-time |
archived_at (anyOf 2) | null | Alternative | |
auto_renewal | boolean | Required within parent | Whether the agreement automatically renews. |
available_actions | Model | Required within parent | Expand Fetch a vendor agreement — response body — available actions |
comment_thread_uuid | JSON | Required within parent | |
comment_thread_uuid (anyOf 1) | string | Alternative | Unique identifier of the comment thread for this agreement. Default: null |
comment_thread_uuid (anyOf 2) | null | Alternative | |
contract_owners | array | Required within parent | |
contract_owners[] | Model | Each item | Expand Fetch a vendor agreement — response body — contract owners item |
created_at | string | Required within parent | Format: date-time |
currency | string | Required within parent | Currency code for the agreement amounts. |
custom_record_field_values | array | Required within parent | |
custom_record_field_values[] | Model | Each item | Expand Get a business entity — response body — custom record fields item |
days_remaining | Model | Required within parent | Expand Fetch a vendor agreement — response body — days remaining |
deleted_at | JSON | Optional | |
deleted_at (anyOf 1) | string | Alternative | Format: date-time |
deleted_at (anyOf 2) | null | Alternative | |
description | JSON | Required within parent | |
description (anyOf 1) | string | Alternative | Description of the vendor agreement. Default: null |
description (anyOf 2) | null | Alternative | |
draft_spend_requests | array | Required within parent | |
draft_spend_requests[] | Model | Each item | Expand Fetch a vendor agreement — response body — draft spend requests item |
end_date | JSON | Required within parent | |
end_date (anyOf 1) | string | Alternative | End date of the agreement. Default: null Format: date |
end_date (anyOf 2) | null | Alternative | |
has_approved_renewal_request | boolean | Required within parent | Whether an approved renewal request exists for this agreement. |
id | string | Required within parent | Format: uuid |
is_active | boolean | Required within parent | Whether the agreement is currently active. |
is_snoozed | boolean | Required within parent | Whether renewal notifications for this agreement are snoozed. |
is_up_for_renewal | boolean | Required within parent | Whether the agreement is currently up for renewal. |
last_date_to_terminate | JSON | Required within parent | |
last_date_to_terminate (anyOf 1) | string | Alternative | Last date by which the agreement can be terminated. Default: null Format: date |
last_date_to_terminate (anyOf 2) | null | Alternative | |
latest_rejected_renewal_request | JSON | Optional | |
latest_rejected_renewal_request (anyOf 1) | Model | Alternative | Expand Fetch a vendor agreement — response body — latest rejected renewal request can view, id, reason, rejected at, unified request id, user full name |
latest_rejected_renewal_request (anyOf 2) | null | Alternative | |
line_items | JSON | Optional | |
line_items (anyOf 1) | array | Alternative | |
line_items (anyOf 1)[] | object | Each item | |
line_items (anyOf 2) | null | Alternative | |
name | string | Required within parent | Name of the vendor agreement. |
notification_trigger_group | JSON | Optional | |
notification_trigger_group (anyOf 1) | Model | Alternative | Expand Fetch a vendor agreement — response body — notification_trigger_group / type: CUSTOM SETTING, DEFAULT BUSINESS SETTING |
notification_trigger_group (anyOf 2) | null | Alternative | |
notifications_on | boolean | Required within parent | Whether notifications are enabled for this agreement. |
payee | Model | Required within parent | Expand Fetch a vendor agreement — response body — payee |
pending_spend_requests | array | Required within parent | |
pending_spend_requests[] | Model | Each item | Expand Fetch a vendor agreement — response body — pending spend requests item |
purchase_orders | array | Required within parent | |
purchase_orders[] | Model | Each item | Expand Fetch a vendor agreement — response body — purchase orders item |
ramp_event_history_id | string | Required within parent | Format: uuid |
renewal_action | JSON | Optional | |
renewal_action (anyOf 1) | object | Alternative | |
renewal_action (anyOf 2) | null | Alternative | |
renewal_status | string | Required within parent | Known values: CANCELLED, EVALUATING, EXPIRED, INITIATED, NOT_STARTED, PLANNING, REJECTED, RENEWED, TERMINATED |
start_date | JSON | Required within parent | |
start_date (anyOf 1) | string | Alternative | Start date of the agreement. Default: null Format: date |
start_date (anyOf 2) | null | Alternative | |
total_value | Model | Required within parent | Expand Hold Bill — response body — amount |
updated_at | string | Required within parent | Format: date-time |
Referenced models: Fetch a vendor agreement — response body — contract owners item, Fetch a vendor agreement — response body — latest rejected renewal request can view, id, reason, rejected at, unified request id, user full name, Fetch a vendor agreement — response body — days remaining, Fetch a vendor agreement — response body — draft spend requests item, Fetch a vendor agreement — response body — notification_trigger_group / type: CUSTOM SETTING, DEFAULT BUSINESS SETTING, Fetch a vendor agreement — response body — pending spend requests item, Fetch a vendor agreement — response body — purchase orders item, Hold Bill — response body — amount, Get a business entity — response body — custom record fields item, Fetch a vendor agreement — response body — available actions, Fetch a vendor agreement — response body — payee
Fetch a vendor agreement — response body — contract owners item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
email | string | Required within parent | |
first_name | string | Required within parent | |
full_name | string | Required within parent | |
id | string | Required within parent | Format: uuid |
last_name | string | Required within parent | |
profile_picture_url | JSON | Optional | |
profile_picture_url (anyOf 1) | string | Alternative | |
profile_picture_url (anyOf 2) | null | Alternative |
Fetch a vendor agreement — response body — notification_trigger_group / type: CUSTOM SETTING, DEFAULT BUSINESS SETTING recipient users item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
full_name | string | Required within parent | Full name of the user. |
id | string | Required within parent | Format: uuid |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: ramp.post_vendor_agreement_spend_request_link_resource. Catalog operation: post_vendor_agreement_spend_request_link_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: ["vendors:write"]