Skip to main content
Bills represent your customers’ accounts payable: amounts they owe to vendors for goods or services received. Importing bills lets Layer track outstanding payables, recognize expenses, and reconcile the bank transactions that pay those bills. A typical accounts payable flow has three steps:
  1. Create a vendor, the party the bill is owed to.
  2. Create a bill with its line items, terms, and due date.
  3. 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 own external_id so you can reference it later without storing Layer’s IDs.
Request
The API responds with a Vendor object. You can later look up vendors with List Vendors.

Create a bill

Create a bill with the Create Bill endpoint. Each bill references a vendor (by vendor_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
The API responds with a Bill object. The bill’s 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 a payments 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
The method is one of CASH, CHECK, CREDIT_CARD, ACH, CREDIT_BALANCE, or OTHER. All amounts are in cents.

Vendor credits and refunds

Layer also supports reducing payables through vendor credits (credits a vendor issues that can be applied to future bills) and vendor refunds (money a vendor returns). See the API reference for details.

Expenses

An expense is a type of bill for a purchase paid immediately. Use Create expense when you want to record the purchase and payment together. See the Expense object for details.