Skip to content

Ramp: Create a draft bill

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

← Bill operations · Get started

Operation ramp.post_draft_bill_list_with_pagination

Provider route: POST /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"]["postDraftBillListWithPagination"]>[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.postDraftBillListWithPagination(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.post_draft_bill_list_with_pagination(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyModelRequired within parentExpand Create a draft bill — request body — body

Referenced models: Create a draft bill — 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 Fetch a draft bill — response body

Referenced models: Fetch a draft bill — response body

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

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

Create a draft bill — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
accounting_field_selectionsarrayOptionalList of accounting field options selected to code the bill.
accounting_field_selections[]ModelEach itemExpand Create a bill — request body — body accounting field selections item
due_atstringOptionalDue date of the bill.
Format: date
enable_accounting_syncbooleanOptionalA flag you can set to False to prevent this bill from syncing to your ERP.
entity_idstringOptionalAssociated business entity.
Format: uuid
inventory_line_itemsJSONOptional
inventory_line_items (anyOf 1)arrayAlternativeList of inventory line items associated with the bill. When provided, this will replace all existing inventory line items.
inventory_line_items (anyOf 1)[]ModelEach itemExpand Update a bill — request body — body inventory line items array item
inventory_line_items (anyOf 2)nullAlternative
invoice_currencystringOptionalCurrency of the invoice.
One of: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BOV, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHE, CHF, CHW, CLF, CLP, CNH, CNY, COP, COU, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, EURC, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MXV, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, OPEN_USD, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDB, USDC, USDG, USDT, USN, UYI, UYU, UYW, UZS, VED, VES, VND, VUV, WST, XAD, XAF, XAG, XAU, XBA, XBB, XBC, XBD, XCD, XCG, XDR, XOF, XPD, XPF, XPT, XSU, XTS, XUA, XXX, YER, ZAR, ZMW, ZWG, ZWL
invoice_numberstringOptionalThe invoice number on the bill.
Maximum length: 84
issued_atstringOptionalIssued date of the bill.
Format: date
line_itemsJSONOptional
line_items (anyOf 1)arrayAlternativeList of line items related to the bill. When provided, this will replace all existing line items.
line_items (anyOf 1)[]ModelEach itemExpand Update a bill — request body — body line items array item
line_items (anyOf 2)nullAlternative
memoJSONOptional
memo (anyOf 1)stringAlternativeMemo of the bill.
Maximum length: 1000
memo (anyOf 2)nullAlternative
payment_methodstringOptionalPayment method of the bill.
One of: ACH, CARD, CHECK, CRYPTO_WALLET_TRANSFER, DOMESTIC_WIRE, INTERNATIONAL, LOCAL_BANK_TRANSFER, ONE_TIME_CARD, ONE_TIME_CARD_DELIVERY, PAID_MANUALLY, SWIFT
posting_dateJSONOptional
posting_date (anyOf 1)stringAlternativeThe date the bill is posted to the accounting system.
Format: date
posting_date (anyOf 2)nullAlternative
purchase_order_idsarrayOptionalUnique identifiers of the purchase orders to match this bill to. When provided, this will replace all existing linked purchase orders.
purchase_order_ids[]stringEach itemFormat: uuid
remote_idJSONOptional
remote_id (anyOf 1)stringAlternativeAn ID that identifies the bill on client's side.
remote_id (anyOf 2)nullAlternative
use_default_payment_methodbooleanOptionalWhen set to true, create the draft bill using the default payment method configured for the vendor. If set to true, payment_method and payment_details should not be provided.
Default: false
vendor_contact_idstringOptionalUnique identifier of vendor contact, must be associated with passed vendor.
Format: uuid
vendor_idstringRequired within parentUnique identifier of bill vendor.
Format: uuid
vendor_memoJSONOptional
vendor_memo (anyOf 1)stringAlternativeMemo to the vendor.
Maximum length: 400
vendor_memo (anyOf 2)nullAlternative

Referenced models: Create a bill — request body — body accounting field selections item, Update a bill — request body — body inventory line items array item, Update a bill — request body — body line items array item

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.

SDK function policy ID: ramp.post_draft_bill_list_with_pagination. Catalog operation: post_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: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.