Skip to content

Ramp: Edit a procurement request

Ramp unifiedRequest.patchUnifiedRequestPatchResource: arguments, response, policy and SDK examples.

← Unified request operations · Get started

Operation ramp.patch_unified_request_patch_resource

Provider route: PATCH /developer/v1/unified-requests/{unified_request_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["unifiedRequest"]["patchUnifiedRequestPatchResource"]>[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.unifiedRequest.patchUnifiedRequestPatchResource(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.unified_request.patch_unified_request_patch_resource(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.unified_request_idstringRequired within parentFormat: uuid
headersobjectOptionalAdditional keys: not allowed
headers.X-Idempotency-KeystringOptionalMaximum length: 255
Minimum length: 1
bodyModelRequired within parentExpand Edit a procurement request — request body — body

Referenced models: Edit a procurement request — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get a unified request — response body

Referenced models: Get a unified request — response body

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

Edit a procurement request — request body — body
FieldTypePresenceDescription and constraints
$objectRootSparse scalar edits and complete collection replacements for draft or submitted requests.
Additional keys: not allowed
accounting_field_selectionsarrayOptionalComplete replacement of request-level accounting selections: omit to preserve, unlisted enabled fields are cleared, [] clears all.
accounting_field_selections[]ModelEach itemExpand Edit a procurement request — request body — body accounting field selections item
currencyModelOptionalExpand Edit a procurement request — request body — body currency
ISO 4217 currency code for the request. Omit to keep the saved value.
end_dateJSONOptional
end_date (anyOf 1)stringAlternativeSpend period end, YYYY-MM-DD. Null clears it.
Format: date
end_date (anyOf 2)nullAlternative
entity_idstringOptionalID of the business entity for the request. Omit to keep the saved value.
Format: uuid
field_answersarrayOptionalComplete replacement of API-editable answers. Omit to preserve answers; omitted supported field IDs are cleared, and [] clears all supported answers. Unexposed answers, including file uploads, are preserved.
field_answers[]JSONEach itemdiscriminator: {"mapping": {"address": "#/components/schemas/ApiAddressFieldAnswerRequestBody", "boolean": "#/components/schemas/ApiBooleanFieldAnswerRequestBody", "contact": "#/components/schemas/ApiContactFieldAnswerRequestBody", "date": "#/components/schemas/ApiDateFieldAnswerRequestBody", "department": "#/components/schemas/ApiDepartmentFieldAnswerRequestBody", "email": "#/components/schemas/ApiEmailFieldAnswerRequestBody", "link": "#/components/schemas/ApiLinkFieldAnswerRequestBody", "merchant": "#/components/schemas/ApiMerchantFieldAnswerRequestBody", "merchant_category": "#/components/schemas/ApiMerchantCategoryFieldAnswerRequestBody", "monetary_amount": "#/components/schemas/ApiMonetaryAmountFieldAnswerRequestBody", "multi_select": "#/components/schemas/ApiMultiSelectFieldAnswerRequestBody", "number": "#/components/schemas/ApiNumberFieldAnswerRequestBody", "paragraph": "#/components/schemas/ApiParagraphFieldAnswerRequestBody", "single_select": "#/components/schemas/ApiSingleSelectFieldAnswerRequestBody", "text": "#/components/schemas/ApiTextFieldAnswerRequestBody", "user": "#/components/schemas/ApiUserFieldAnswerRequestBody", "vendor": "#/components/schemas/ApiVendorFieldAnswerRequestBody"}, "propertyName": "answer_type"}
field_answers[] (oneOf 1)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type address
field_answers[] (oneOf 2)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type boolean
field_answers[] (oneOf 3)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type contact
field_answers[] (oneOf 4)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type date
field_answers[] (oneOf 5)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type department
field_answers[] (oneOf 6)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type email
field_answers[] (oneOf 7)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type link
field_answers[] (oneOf 8)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type merchant category
field_answers[] (oneOf 9)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type merchant
field_answers[] (oneOf 10)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type monetary amount
field_answers[] (oneOf 11)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type multi select
field_answers[] (oneOf 12)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type number
field_answers[] (oneOf 13)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type paragraph
field_answers[] (oneOf 14)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type single select
field_answers[] (oneOf 15)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type text
field_answers[] (oneOf 16)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type user
field_answers[] (oneOf 17)ModelAlternativeExpand Edit a procurement request — request body — body field answers item answer type vendor
line_itemsarrayOptionalComplete replacement set. Omit to preserve all lines; omitted existing IDs are deleted, and [] removes all source lines. Every item requires unit_price and unit_quantity. Omitted or null description clears it. Retained lines preserve unexposed metadata and omitted coding.
line_items[]ModelEach itemExpand Edit a procurement request — request body — body line items item
namestringOptionalName of the request. Omit to keep the saved value.
start_dateJSONOptional
start_date (anyOf 1)stringAlternativeSpend period start, YYYY-MM-DD. Null clears it.
Format: date
start_date (anyOf 2)nullAlternative

Referenced models: Edit a procurement request — request body — body accounting field selections item, Edit a procurement request — request body — body field answers item answer type address, Edit a procurement request — request body — body field answers item answer type boolean, Edit a procurement request — request body — body field answers item answer type contact, Edit a procurement request — request body — body field answers item answer type date, Edit a procurement request — request body — body field answers item answer type department, Edit a procurement request — request body — body field answers item answer type email, Edit a procurement request — request body — body field answers item answer type link, Edit a procurement request — request body — body field answers item answer type merchant category, Edit a procurement request — request body — body field answers item answer type merchant, Edit a procurement request — request body — body field answers item answer type monetary amount, Edit a procurement request — request body — body field answers item answer type multi select, Edit a procurement request — request body — body field answers item answer type number, Edit a procurement request — request body — body field answers item answer type paragraph, Edit a procurement request — request body — body line items item, Edit a procurement request — request body — body field answers item answer type single select, Edit a procurement request — request body — body field answers item answer type text, Edit a procurement request — request body — body field answers item answer type user, Edit a procurement request — request body — body field answers item answer type vendor, Edit a procurement request — request body — body currency

Get a unified request — response body
FieldTypePresenceDescription and constraints
$JSONRootdiscriminator: {"mapping": {"SPEND_REQUEST": "#/components/schemas/UnifiedSpendRequestDetail"}, "propertyName": "unified_request_type"}
$ (anyOf 1)ModelAlternativeExpand Get a unified request — response body — value

Referenced models: Get a unified request — response body — value

Edit a procurement request — request body — body accounting field selections item
FieldTypePresenceDescription and constraints
$objectRootOne accounting field selection, identified by Ramp UUIDs.
Additional keys: not allowed
accounting_field_idstringRequired within parentID of the accounting field: `id` in the spend program's `line_item_accounting_fields`, or `ramp_id` on GET /accounting/fields.
Format: uuid
accounting_field_option_idstringRequired within parentID of an option of that field: `ramp_id` on GET /accounting/field-options (GET /accounting/accounts for GL accounts).
Format: uuid

SDK function policy ID: ramp.patch_unified_request_patch_resource. Catalog operation: patch_unified_request_patch_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: ["unified_requests:write"]

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.