- Create a vendor, the party the bill is owed to.
- Create a bill with its line items, terms, and due date.
- Record a bill payment against one or more bills.
Bill / AP support may need to be enabled for your platform. Reach out to your Layer contact for access.
Create a vendor
A bill must be associated with a vendor. Create one with the Create Vendor endpoint, supplying your ownexternal_id so you can reference it later without storing Layer’s IDs.
Request
Create a bill
Create a bill with the Create Bill endpoint. Each bill references a vendor (byvendor_id or vendor_external_id), one or more line_items, and either a due_at date or bill_terms (one of DUE_ON_RECEIPT, NET_10, NET_15, NET_30, NET_60).
Each line item requires a product_name and unit_price (in cents) and may include a quantity, description, discounts, sales taxes, and an account_identifier to control which expense account the line posts to.
Request
status reflects how much has been paid (RECEIVED, PARTIALLY_PAID, PAID, or VOIDED), and outstanding_balance tracks what remains owed.
external_id is your idempotency key. Re-posting a bill with the same external_id updates the existing bill rather than creating a duplicate. To create many bills at once, use Batch Create Bills.
Record a bill payment
When a customer pays a bill, record the payment so Layer can mark the bill paid and reconcile it against bank activity. For a payment made at the same time the bill is created, include apayments array directly in the Create Bill request. To record a payment against an existing bill, or a single payment that covers several bills, use the Create Bill Payment endpoint and allocate the amount across bills with bill_payment_allocations.
Request
method is one of CASH, CHECK, CREDIT_CARD, ACH, CREDIT_BALANCE, or OTHER. All amounts are in cents.