Skip to content

Ramp: Delete a single line item from an existing purchase order

Ramp purchaseOrder.deletePurchaseOrderLineItemSingleResource: arguments, response, policy and SDK examples.

← Purchase order operations · Get started

Operation ramp.delete_purchase_order_line_item_single_resource

Provider route: DELETE /developer/v1/purchase-orders/{purchase_order_id}/line-items/{line_item_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["purchaseOrder"]["deletePurchaseOrderLineItemSingleResource"]>[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.purchaseOrder.deletePurchaseOrderLineItemSingleResource(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.purchase_order.delete_purchase_order_line_item_single_resource(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.line_item_idstringRequired within parent
path.purchase_order_idstringRequired within parent

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

FieldTypePresenceDescription and constraints
$ModelRootExpand Fetch a purchase order — response body

Referenced models: Fetch a purchase order — response body

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

Fetch a purchase order — response body
FieldTypePresenceDescription and constraints
$objectRoot
accounting_field_selectionsarrayRequired within parentList of accounting field options selected to code the purchase order.
Read only: true
accounting_field_selections[]ModelEach itemExpand Hold Bill — response body — accounting field selections item
amountModelRequired within parentExpand Hold Bill — response body — amount
Amount of the purchse order.
Read only: true
archived_atJSONRequired within parent
archived_at (anyOf 1)stringAlternativeFormat: date-time
archived_at (anyOf 2)nullAlternative
bill_idsarrayRequired within parentList of unique identifiers for attached bills.
Read only: true
bill_ids[]stringEach itemFormat: uuid
billing_statusJSONOptional
billing_status (anyOf 1)stringAlternativeKnown values: CLOSED, DELETED, FULLY_BILLED, OPEN, PARTIALLY_BILLED
Read only: true
billing_status (anyOf 2)nullAlternative
created_atstringRequired within parentFormat: date-time
creation_sourcestringRequired within parentKnown values: ACCOUNTING_PROVIDER, DEVELOPER_API, EXTERNAL_IMPORT, RAMP
custom_form_collection_responseJSONRequired within parent
custom_form_collection_response (anyOf 1)ModelAlternativeExpand Fetch a custom form collection response by ID — response body — custom form collection response
Custom form collection with an associated response log entry.
Read only: true
custom_form_collection_response (anyOf 2)nullAlternative
entity_idstringRequired within parentAssociated business entity.
Format: uuid
external_idJSONRequired within parent
external_id (anyOf 1)stringAlternativeAn ID that uniquely identifies the purchase order on the client's side. Must be unique per business and cannot be updated after creation.
external_id (anyOf 2)nullAlternative
idstringRequired within parentFormat: uuid
item_receipt_idsarrayRequired within parentList of unique identifiers for item receipts matched to the purchase order.
Read only: true
item_receipt_ids[]stringEach itemFormat: uuid
line_itemsarrayRequired within parentList of line items on the purchase order.
line_items[]ModelEach itemExpand Fetch a purchase order — response body — line items item
memoJSONRequired within parent
memo (anyOf 1)stringAlternativeMemo of the purchase order.
memo (anyOf 2)nullAlternative
nameJSONRequired within parent
name (anyOf 1)stringAlternativeThe name of the spend request associated with the purchase order.
name (anyOf 2)nullAlternative
net_payment_termsJSONRequired within parent
net_payment_terms (anyOf 1)JSONAlternative
net_payment_terms (anyOf 1) (anyOf 1)integerAlternativeThe required time an invoice needs to be paid after receipt.
net_payment_terms (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
net_payment_terms (anyOf 2)nullAlternative
owner_idJSONRequired within parent
owner_id (anyOf 1)stringAlternativeUnique identifier for the owner of the spend request. This value will only be present for Ramp-created purchase orders.
Format: uuid
owner_id (anyOf 2)nullAlternative
promise_dateJSONRequired within parent
promise_date (anyOf 1)stringAlternativeThe date the vendor will deliver the goods or services.
Format: date-time
promise_date (anyOf 2)nullAlternative
purchase_order_numberJSONRequired within parent
purchase_order_number (anyOf 1)stringAlternative
purchase_order_number (anyOf 2)nullAlternative
ramp_urlstringRequired within parentA stable URL that links to the purchase order in the Ramp web application.
Read only: true
receipt_statusstringRequired within parentKnown values: FULLY_RECEIVED, NOT_RECEIVED, OVER_RECEIVED, PARTIALLY_RECEIVED
remote_idJSONRequired within parent
remote_id (anyOf 1)stringAlternativeThe accounting remote identifier of the purchase order.
Read only: true
remote_id (anyOf 2)nullAlternative
ship_to_addressJSONRequired within parent
ship_to_address (anyOf 1)ModelAlternativeExpand Fetch a purchase order — response body — ship to address address1, address2, city, country, postal code, state
Delivery address for the purchase order.
ship_to_address (anyOf 2)nullAlternative
ship_to_company_nameJSONRequired within parent
ship_to_company_name (anyOf 1)stringAlternativeCompany name associated with the delivery address.
ship_to_company_name (anyOf 2)nullAlternative
shipping_contact_emailJSONRequired within parent
shipping_contact_email (anyOf 1)stringAlternativeEmail address of the delivery contact.
shipping_contact_email (anyOf 2)nullAlternative
shipping_contact_first_nameJSONRequired within parent
shipping_contact_first_name (anyOf 1)stringAlternativeFirst name of the delivery contact.
shipping_contact_first_name (anyOf 2)nullAlternative
shipping_contact_last_nameJSONRequired within parent
shipping_contact_last_name (anyOf 1)stringAlternativeLast name of the delivery contact.
shipping_contact_last_name (anyOf 2)nullAlternative
shipping_contact_phone_numberJSONRequired within parent
shipping_contact_phone_number (anyOf 1)stringAlternativePhone number of the delivery contact.
shipping_contact_phone_number (anyOf 2)nullAlternative
spend_end_dateJSONRequired within parent
spend_end_date (anyOf 1)stringAlternativeThe date when spending for this purchase order ends.
Format: date-time
spend_end_date (anyOf 2)nullAlternative
spend_program_idJSONRequired within parent
spend_program_id (anyOf 1)stringAlternativeUnique identifier for the spend program associated with the purchase order. This value will only be null for purchase orders imported from an accounting provider.
Format: uuid
Read only: true
spend_program_id (anyOf 2)nullAlternative
spend_request_idJSONRequired within parent
spend_request_id (anyOf 1)stringAlternativeUnique identifier for the spend request associated with the purchase order. This value will only be null for purchase orders imported from an accounting provider.
Format: uuid
spend_request_id (anyOf 2)nullAlternative
spend_start_dateJSONRequired within parent
spend_start_date (anyOf 1)stringAlternativeThe date when spending for this purchase order begins.
Format: date-time
spend_start_date (anyOf 2)nullAlternative
spend_total_amountJSONRequired within parent
spend_total_amount (anyOf 1)ModelAlternativeExpand Hold Bill — response body — amount
Total amount of the purchase order, calculated based on frequency and date range for recurring purchases.
Read only: true
spend_total_amount (anyOf 2)nullAlternative
three_way_match_enabledbooleanRequired within parentWhether three-way match is enabled for the purchase order.
Read only: true
transaction_idsarrayRequired within parentList of unique identifiers for attached transactions. This does not include transactions on attached bills.
Read only: true
transaction_ids[]stringEach itemFormat: uuid
user_idJSONRequired within parent
user_id (anyOf 1)stringAlternativeUnique identifier for the user who created the spend request. This value will only be present for Ramp-created purchase orders.
Format: uuid
user_id (anyOf 2)nullAlternative
vendor_idJSONRequired within parent
vendor_id (anyOf 1)stringAlternativeUnique identifier for the vendor.
Format: uuid
Read only: true
vendor_id (anyOf 2)nullAlternative
withholding_default_rateJSONRequired within parent
withholding_default_rate (anyOf 1)stringAlternativeDefault retainage withholding rate for the purchase order, expressed as a fractional decimal. For example, 0.10 means 10%.
Format: decimal
Maximum: 1
Minimum: 0
withholding_default_rate (anyOf 2)nullAlternative

Referenced models: Hold Bill — response body — accounting field selections item, Fetch a custom form collection response by ID — response body — custom form collection response, Fetch a purchase order — response body — line items item, Hold Bill — response body — amount, Fetch a purchase order — response body — ship to address address1, address2, city, country, postal code, state

Get a business entity — response body — custom record fields item value type boolean
FieldTypePresenceDescription and constraints
$objectRoot
display_namestringRequired within parent
typestringRequired within parentMust equal: boolean
valuebooleanRequired within parent

SDK function policy ID: ramp.delete_purchase_order_line_item_single_resource. Catalog operation: delete_purchase_order_line_item_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: ["purchase_orders: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.