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.
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["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 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.purchase_order.delete_purchase_order_line_item_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.line_item_id | string | Required within parent | |
path.purchase_order_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 purchase order — response body |
Referenced models: Fetch a purchase order — response body
Schemas
Section titled “Schemas”130 more schemas are linked from the tables above, on the schema pages.
Fetch a purchase order — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
accounting_field_selections | array | Required within parent | List of accounting field options selected to code the purchase order. Read only: true |
accounting_field_selections[] | Model | Each item | Expand Hold Bill — response body — accounting field selections item |
amount | Model | Required within parent | Expand Hold Bill — response body — amount Amount of the purchse order. Read only: true |
archived_at | JSON | Required within parent | |
archived_at (anyOf 1) | string | Alternative | Format: date-time |
archived_at (anyOf 2) | null | Alternative | |
bill_ids | array | Required within parent | List of unique identifiers for attached bills. Read only: true |
bill_ids[] | string | Each item | Format: uuid |
billing_status | JSON | Optional | |
billing_status (anyOf 1) | string | Alternative | Known values: CLOSED, DELETED, FULLY_BILLED, OPEN, PARTIALLY_BILLED Read only: true |
billing_status (anyOf 2) | null | Alternative | |
created_at | string | Required within parent | Format: date-time |
creation_source | string | Required within parent | Known values: ACCOUNTING_PROVIDER, DEVELOPER_API, EXTERNAL_IMPORT, RAMP |
custom_form_collection_response | JSON | Required within parent | |
custom_form_collection_response (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
entity_id | string | Required within parent | Associated business entity. Format: uuid |
external_id | JSON | Required within parent | |
external_id (anyOf 1) | string | Alternative | An 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) | null | Alternative | |
id | string | Required within parent | Format: uuid |
item_receipt_ids | array | Required within parent | List of unique identifiers for item receipts matched to the purchase order. Read only: true |
item_receipt_ids[] | string | Each item | Format: uuid |
line_items | array | Required within parent | List of line items on the purchase order. |
line_items[] | Model | Each item | Expand Fetch a purchase order — response body — line items item |
memo | JSON | Required within parent | |
memo (anyOf 1) | string | Alternative | Memo of the purchase order. |
memo (anyOf 2) | null | Alternative | |
name | JSON | Required within parent | |
name (anyOf 1) | string | Alternative | The name of the spend request associated with the purchase order. |
name (anyOf 2) | null | Alternative | |
net_payment_terms | JSON | Required within parent | |
net_payment_terms (anyOf 1) | JSON | Alternative | |
net_payment_terms (anyOf 1) (anyOf 1) | integer | Alternative | The required time an invoice needs to be paid after receipt. |
net_payment_terms (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
net_payment_terms (anyOf 2) | null | Alternative | |
owner_id | JSON | Required within parent | |
owner_id (anyOf 1) | string | Alternative | Unique 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) | null | Alternative | |
promise_date | JSON | Required within parent | |
promise_date (anyOf 1) | string | Alternative | The date the vendor will deliver the goods or services. Format: date-time |
promise_date (anyOf 2) | null | Alternative | |
purchase_order_number | JSON | Required within parent | |
purchase_order_number (anyOf 1) | string | Alternative | |
purchase_order_number (anyOf 2) | null | Alternative | |
ramp_url | string | Required within parent | A stable URL that links to the purchase order in the Ramp web application. Read only: true |
receipt_status | string | Required within parent | Known values: FULLY_RECEIVED, NOT_RECEIVED, OVER_RECEIVED, PARTIALLY_RECEIVED |
remote_id | JSON | Required within parent | |
remote_id (anyOf 1) | string | Alternative | The accounting remote identifier of the purchase order. Read only: true |
remote_id (anyOf 2) | null | Alternative | |
ship_to_address | JSON | Required within parent | |
ship_to_address (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
ship_to_company_name | JSON | Required within parent | |
ship_to_company_name (anyOf 1) | string | Alternative | Company name associated with the delivery address. |
ship_to_company_name (anyOf 2) | null | Alternative | |
shipping_contact_email | JSON | Required within parent | |
shipping_contact_email (anyOf 1) | string | Alternative | Email address of the delivery contact. |
shipping_contact_email (anyOf 2) | null | Alternative | |
shipping_contact_first_name | JSON | Required within parent | |
shipping_contact_first_name (anyOf 1) | string | Alternative | First name of the delivery contact. |
shipping_contact_first_name (anyOf 2) | null | Alternative | |
shipping_contact_last_name | JSON | Required within parent | |
shipping_contact_last_name (anyOf 1) | string | Alternative | Last name of the delivery contact. |
shipping_contact_last_name (anyOf 2) | null | Alternative | |
shipping_contact_phone_number | JSON | Required within parent | |
shipping_contact_phone_number (anyOf 1) | string | Alternative | Phone number of the delivery contact. |
shipping_contact_phone_number (anyOf 2) | null | Alternative | |
spend_end_date | JSON | Required within parent | |
spend_end_date (anyOf 1) | string | Alternative | The date when spending for this purchase order ends. Format: date-time |
spend_end_date (anyOf 2) | null | Alternative | |
spend_program_id | JSON | Required within parent | |
spend_program_id (anyOf 1) | string | Alternative | Unique 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) | null | Alternative | |
spend_request_id | JSON | Required within parent | |
spend_request_id (anyOf 1) | string | Alternative | Unique 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) | null | Alternative | |
spend_start_date | JSON | Required within parent | |
spend_start_date (anyOf 1) | string | Alternative | The date when spending for this purchase order begins. Format: date-time |
spend_start_date (anyOf 2) | null | Alternative | |
spend_total_amount | JSON | Required within parent | |
spend_total_amount (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
three_way_match_enabled | boolean | Required within parent | Whether three-way match is enabled for the purchase order. Read only: true |
transaction_ids | array | Required within parent | List of unique identifiers for attached transactions. This does not include transactions on attached bills. Read only: true |
transaction_ids[] | string | Each item | Format: uuid |
user_id | JSON | Required within parent | |
user_id (anyOf 1) | string | Alternative | Unique 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) | null | Alternative | |
vendor_id | JSON | Required within parent | |
vendor_id (anyOf 1) | string | Alternative | Unique identifier for the vendor. Format: uuid Read only: true |
vendor_id (anyOf 2) | null | Alternative | |
withholding_default_rate | JSON | Required within parent | |
withholding_default_rate (anyOf 1) | string | Alternative | Default 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) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
display_name | string | Required within parent | |
type | string | Required within parent | Must equal: boolean |
value | boolean | Required within parent |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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"]