Ramp: Fetch a bill
Ramp bill.getBillResource: arguments, response, policy and SDK examples.
← Bill operations · Get started
Operation ramp.get_bill_resource
Provider route: GET /developer/v1/bills/{bill_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["bill"]["getBillResource"]>[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.bill.getBillResource(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.bill.get_bill_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.bill_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 Hold Bill — response body |
Referenced models: Hold Bill — response body
Schemas
Section titled “Schemas”15 more schemas are linked from the tables above, on the schema pages.
Hold Bill — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
accounting_date | string | Required within parent | The date for the bill for accounting purposes. If not specified, falls back to the bill issue date. Format: date-time Read only: true |
accounting_field_selections | array | Required within parent | List of accounting field options selected to code the bill. |
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 bill, represented in the lowest denomination of the currency (e.g., cents for USD). Read only: true |
applied_vendor_credits | array | Required within parent | Vendor Credits that have been applied to this Bill Read only: true |
applied_vendor_credits[] | Model | Each item | Expand Hold Bill — response body — applied vendor credits item |
approval_status | JSON | Required within parent | |
approval_status (anyOf 1) | string | Alternative | Approval status of the bill. Note that this is separate from the approval status for payment release. Known values: APPROVED, INITIALIZED, PENDING, REJECTED, TERMINATED |
approval_status (anyOf 2) | null | Alternative | |
archived_at | JSON | Required within parent | |
archived_at (anyOf 1) | string | Alternative | The datetime the bill was archived. Format: date-time |
archived_at (anyOf 2) | null | Alternative | |
attachments | array | Required within parent | Business-visible bill attachments with their types and download URLs. Read only: true |
attachments[] | Model | Each item | Expand Hold Bill — response body — attachments item |
bill_owner | Model | Required within parent | Expand Hold Bill — response body — bill owner Information about the bill owner. |
created_at | string | Required within parent | Format: date-time |
deep_link_url | string | Optional | Link to bill in ERP, if exists. |
draft_bill_created_at | JSON | Required within parent | |
draft_bill_created_at (anyOf 1) | string | Alternative | The date the draft bill was created if this bill was created from a draft bill, otherwise None. Format: date-time |
draft_bill_created_at (anyOf 2) | null | Alternative | |
draft_bill_id | JSON | Required within parent | |
draft_bill_id (anyOf 1) | string | Alternative | Unique identifier of the draft bill this bill was created from, if one exists. Format: uuid |
draft_bill_id (anyOf 2) | null | Alternative | |
due_at | string | Required within parent | Format: date-time |
enable_accounting_sync | boolean | Optional | Flag specifying whether the bill should sync to the ERP |
entity_id | string | Required within parent | Associated business entity. Format: uuid |
fx_conversion_rate | string | Required within parent | FX conversion rate from bill invoice currency to payer currency. Format: decimal Read only: true |
id | string | Required within parent | Format: uuid |
inventory_line_items | array | Required within parent | List of inventory line items related to the bill. |
inventory_line_items[] | Model | Each item | Expand Hold Bill — response body — inventory line items item |
invoice_number | string | Optional | The invoice number on the bill. |
invoice_urls | array | Required within parent | Pre-signed URLs for all business-visible bill attachments, including supporting files. Use attachments and filter by attachment_type INVOICE to identify the invoice document. Read only: true |
invoice_urls[] | string | Each item | |
is_payment_sync_ready | boolean | Required within parent | Whether the bill is ready for payment accounting export. Can be true while status is OPEN. For bills with multiple payments, one eligible ready payment is sufficient; this field does not identify which payments are ready. Excludes manual payments, fully synced bills, and bills paid entirely with vendor credits. Read only: true |
is_withholding_release | JSON | Optional | |
is_withholding_release (anyOf 1) | boolean | Alternative | Whether this bill is a retainage withholding release bill, if applicable. Read only: true |
is_withholding_release (anyOf 2) | null | Alternative | |
issued_at | string | Required within parent | The date the bill was issued on invoice. Format: date-time |
item_receipt_ids | array | Required within parent | List of unique identifiers for item receipts associated with this bill through matched purchase orders. Read only: true |
item_receipt_ids[] | string | Each item | Format: uuid |
line_items | array | Required within parent | List of line items related to the bill. |
line_items[] | Model | Each item | Expand Hold Bill — response body — line items item |
memo | string | Optional | Memo of the bill. |
paid_at | string | Optional | The datetime the bill's payment status is set to PAID. None if the bill's payment status is OPEN Format: date-time |
payment | JSON | Required within parent | |
payment (anyOf 1) | Model | Alternative | Expand Hold Bill — response body — payment amount, bank debit trace id, customer friendly payment id, details, effective date, id, payment date, payment method, trace id Payment information for the bill. For bills with multiple payments, this is the first non-vendor-credit payment. Read only: true |
payment (anyOf 2) | null | Alternative | |
posting_date | string | Optional | The date the bill was posted to the ERP. Alternatively known as accounting date, accounting sync date. Format: date-time |
purchase_order_id | string | Optional | Unique identifier of matched purchase order, if one exists. Format: uuid Read only: true |
related_bills | array | Optional | Bills associated with this bill, labelled from this bill's side (e.g. the insurance bill for a rental). Only returned when bill associations are enabled for the business. Read only: true |
related_bills[] | Model | Each item | Expand Hold Bill — response body — related bills item |
remote_id | string | Optional | The external ID that identifies the bill on the client's side. |
status | string | Required within parent | Known values: OPEN, PAID |
status_summary | string | Required within parent | Status summary of the bill. Known values: APPROVAL_PENDING, APPROVAL_REJECTED, ARCHIVED, AWAITING_PAYMENT, AWAITING_RELEASE, BLOCKED, HELD_BY_PROVIDER, ON_HOLD, PAYMENT_COMPLETED, PAYMENT_DETAILS_MISSING, PAYMENT_ERROR, PAYMENT_NOT_INSTRUCTED, PAYMENT_PROCESSING, PAYMENT_READY, PAYMENT_SCHEDULED, PENDING_VENDOR_APPROVAL, WAITING_FOR_TRANSACTION_MATCH, WAITING_FOR_TRANSFER_MATCH, WAITING_FOR_VENDOR Read only: true |
sync_status | string | Required within parent | Sync status of the bill. Known values: BILL_AND_PAYMENT_SYNCED, BILL_SYNCED, NOT_SYNCED Read only: true |
vendor | Model | Required within parent | Expand Hold Bill — response body — vendor Vendor information of the bill. |
vendor_contact_id | JSON | Required within parent | |
vendor_contact_id (anyOf 1) | string | Alternative | Unique identifier of associated vendor contact. Format: uuid |
vendor_contact_id (anyOf 2) | null | Alternative | |
vendor_memo | string | Optional | Memo to the vendor. |
Referenced models: Hold Bill — response body — bill owner, Hold Bill — response body — accounting field selections item, Hold Bill — response body — attachments item, Hold Bill — response body — inventory line items item, Hold Bill — response body — line items item, Hold Bill — response body — payment amount, bank debit trace id, customer friendly payment id, details, effective date, id, payment date, payment method, trace id, Hold Bill — response body — vendor, Hold Bill — response body — related bills item, Hold Bill — response body — applied vendor credits item, Hold Bill — response body — amount
Hold Bill — response body — bill owner
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
first_name | string | Optional | Bill owner's first name. |
id | string | Required within parent | Bill owner's ID. Format: uuid |
last_name | string | Optional | Bill owner's last name. |
Hold Bill — response body — attachments item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
attachment_type | string | Required within parent | Type of attachment. Known values: EMAIL, FILE, INVOICE, VENDOR_CREDIT |
id | string | Required within parent | Unique identifier of the bill attachment. Format: uuid |
url | string | Required within parent | Pre-signed URL to download the attachment. Read only: true |
Hold Bill — response body — vendor
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
id | string | Required within parent | Unique identifier of the vendor. Format: uuid |
name | string | Required within parent | Name of the vendor. |
remote_code | string | Optional | Code of the vendor; usually it is a unique identifier for the vendor in the remote ERP system. |
remote_id | string | Optional | External ID that uniquely identifies the vendor on the client's side. |
remote_name | string | Optional | Name of the vendor. |
type | string | Optional | Known values: BUSINESS, INDIVIDUAL |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: ramp.get_bill_resource. Catalog operation: get_bill_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: ["bills:read"]