Skip to content

Ramp: List draft bills

Ramp bill.getDraftBillListWithPagination: arguments, response, policy and SDK examples.

← Bill operations · Get started

Operation ramp.get_draft_bill_list_with_pagination

Provider route: GET /developer/v1/bills/drafts. 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["bill"]["getDraftBillListWithPagination"]>[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.getDraftBillListWithPagination(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.bill.get_draft_bill_list_with_pagination(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
queryobjectOptionalAdditional keys: not allowed
query.entity_idstringOptionalFormat: uuid
query.invoice_numberstringOptional
query.remote_idstringOptional
query.vendor_idstringOptionalFormat: uuid
query.from_created_atstringOptionalFormat: date-time
query.to_created_atstringOptionalFormat: date-time
query.from_due_datestringOptionalFormat: date-time
query.to_due_datestringOptionalFormat: date-time
query.from_issued_datestringOptionalFormat: date-time
query.to_issued_datestringOptionalFormat: date-time
query.startstringOptional
query.page_sizeintegerOptionalDefault: 20

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

FieldTypePresenceDescription and constraints
$ModelRootExpand List draft bills — response body

Referenced models: List draft bills — response body

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

List draft bills — response body
FieldTypePresenceDescription and constraints
$objectRoot
dataarrayRequired within parentResources returned in this page.
data[]ModelEach itemExpand Fetch a draft bill — response body
pageModelRequired within parentExpand List bills — response body — page
Pagination details for this response.

Referenced models: List bills — response body — page, Fetch a draft bill — response body

List bills — response body — page
FieldTypePresenceDescription and constraints
$objectRootPagination details for a Developer API response.
nextJSONRequired within parent
next (anyOf 1)stringAlternativethe query to get to the next page; it is in the format of <BASE_URL>?<new_params>
next (anyOf 2)nullAlternative
Fetch a draft bill — response body
FieldTypePresenceDescription and constraints
$objectRoot
accounting_dateJSONRequired within parent
accounting_date (anyOf 1)stringAlternativeThe date for the bill for accounting purposes. If not specified, falls back to the bill issue date.
Format: date-time
Read only: true
accounting_date (anyOf 2)nullAlternative
accounting_field_selectionsarrayRequired within parentList of accounting field options selected to code the bill.
accounting_field_selections[]ModelEach itemExpand Hold Bill — response body — accounting field selections item
amountJSONRequired within parent
amount (anyOf 1)ModelAlternativeExpand 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
amount (anyOf 2)nullAlternative
bill_ownerJSONRequired within parent
bill_owner (anyOf 1)ModelAlternativeExpand Hold Bill — response body — bill owner
Information about the bill owner.
bill_owner (anyOf 2)nullAlternative
created_atstringRequired within parentThe date the bill was created.
Format: date-time
due_atJSONRequired within parent
due_at (anyOf 1)stringAlternativeThe date the bill is due.
Format: date-time
due_at (anyOf 2)nullAlternative
entity_idJSONRequired within parent
entity_id (anyOf 1)stringAlternativeAssociated business entity.
Format: uuid
entity_id (anyOf 2)nullAlternative
idstringRequired within parentFormat: uuid
inventory_line_itemsarrayRequired within parentList of inventory line items related to the bill.
inventory_line_items[]ModelEach itemExpand Fetch a draft bill — response body — inventory line items item
invoice_numberJSONRequired within parent
invoice_number (anyOf 1)stringAlternativeThe invoice number on the bill.
invoice_number (anyOf 2)nullAlternative
invoice_urlsarrayRequired within parentPre-signed urls to download invoice files.
Read only: true
invoice_urls[]stringEach item
issued_atJSONRequired within parent
issued_at (anyOf 1)stringAlternativeThe date the bill was issued on invoice.
Format: date-time
issued_at (anyOf 2)nullAlternative
line_itemsarrayRequired within parentList of line items related to the bill.
line_items[]ModelEach itemExpand Fetch a draft bill — response body — line items item
memoJSONRequired within parent
memo (anyOf 1)stringAlternativeMemo of the bill.
memo (anyOf 2)nullAlternative
posting_dateJSONRequired within parent
posting_date (anyOf 1)stringAlternativeThe date the bill was posted to the ERP. Alternatively known as accounting date, accounting sync date.
Format: date-time
posting_date (anyOf 2)nullAlternative
remote_idJSONRequired within parent
remote_id (anyOf 1)stringAlternativeThe external ID that identifies the bill on the client's side.
remote_id (anyOf 2)nullAlternative
statusJSONRequired within parentPayment status of the bill. Always DRAFT for provisional bills.
Default: DRAFT
sync_statusJSONRequired within parentSync status of the bill. Always NOT_SYNCED for drafts.
Default: NOT_SYNCED
vendorJSONRequired within parent
vendor (anyOf 1)ModelAlternativeExpand Hold Bill — response body — vendor
Vendor information of the bill.
vendor (anyOf 2)nullAlternative
vendor_memoJSONRequired within parent
vendor_memo (anyOf 1)stringAlternativeMemo to the vendor.
vendor_memo (anyOf 2)nullAlternative

Referenced models: Hold Bill — response body — bill owner, Hold Bill — response body — accounting field selections item, Hold Bill — response body — vendor, Fetch a draft bill — response body — inventory line items item, Fetch a draft bill — response body — line items item, Hold Bill — response body — amount

Hold Bill — response body — bill owner
FieldTypePresenceDescription and constraints
$objectRoot
first_namestringOptionalBill owner's first name.
idstringRequired within parentBill owner's ID.
Format: uuid
last_namestringOptionalBill owner's last name.
Hold Bill — response body — accounting field selections item
FieldTypePresenceDescription and constraints
$objectRoot
category_infoModelRequired within parentExpand Hold Bill — response body — accounting field selections item category info
information about the accounting category (or accounting field).
display_nameJSONRequired within parent
display_name (anyOf 1)stringAlternativeCustomer-set display name for the accounting field option in Ramp. When the customer renames an option inside Ramp, this returns the new label while `name` continues to return the ERP-source name. May be null if no Ramp-side override is set.
display_name (anyOf 2)nullAlternative
external_codeJSONOptional
external_code (anyOf 1)stringAlternativeexternal code of accounting field option; Code field displayed on the ERP.
external_code (anyOf 2)nullAlternative
external_idstringRequired within parentexternal id of accounting field option; It should uniquely identify an accounting field option on the client end.
idstringRequired within parentID that uniquely identifies an accounting field option within Ramp
namestringRequired within parentname of accounting field option
provider_nameJSONRequired within parent
provider_name (anyOf 1)stringAlternativeName of the accounting provider
Read only: true
provider_name (anyOf 2)nullAlternative

Referenced models: Hold Bill — response body — accounting field selections item category info

Hold Bill — response body — vendor
FieldTypePresenceDescription and constraints
$objectRoot
idstringRequired within parentUnique identifier of the vendor.
Format: uuid
namestringRequired within parentName of the vendor.
remote_codestringOptionalCode of the vendor; usually it is a unique identifier for the vendor in the remote ERP system.
remote_idstringOptionalExternal ID that uniquely identifies the vendor on the client's side.
remote_namestringOptionalName of the vendor.
typestringOptionalKnown values: BUSINESS, INDIVIDUAL
Hold Bill — response body — accounting field selections item category info
FieldTypePresenceDescription and constraints
$objectRoot
external_idstringRequired within parentexternal id of accounting field; It should uniquely identify an accounting field on the client end.
idstringRequired within parentID that uniquely identifies an accounting field within Ramp
namestringRequired within parentname of accounting field
typestringRequired within parentaccounting field type
Known values: AMORTIZATION_TEMPLATE, BILLABLE, COST_CENTER, CUSTOMERS_JOBS, DEFERRAL_CODE, EXPENSE_ENTITY, GL_ACCOUNT, INVENTORY_ITEM, JOURNAL, MERCHANT, NON_ERP, OTHER, PAYROLL_PROVIDER, PROJECT, REPORTING_TAG, SALES_TAX_CODE, SUBSIDIARY, TAX_CODE, UNIT_OF_MEASURE

SDK function policy ID: ramp.get_draft_bill_list_with_pagination. Catalog operation: get_draft_bill_list_with_pagination. 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"]

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.