Skip to content

Pay a supplier

Say "pay this bill when it is due" and get the bill read and filed, an approval, a bank payment on the due date and the payment matched in your books.

Pay a supplier's Bill from the operating account on its due date, once an approver accepts it.

Needs Open a bank account

What you get

  • 1bill read from the supplier’s invoice and filed to the right accountBill
  • 1supplier on record with its bankOrganization
  • 1approval from whoever may approve that amountApproval
  • 1payment on the due date, by bank transfer or wireTransaction
  • 2lines in your books: money you owe, then cash out once paidEntry
  • 1bank payment matched to the billTransaction

Your agent does

Bill.create → Bill.approve → Bill.pay
You, to your agent

Pay a supplier’s bill on its due date.

Pay Northwind’s $29 invoice for hosting.

Approve and pay the supplier bills due this week.

# 1. Bill.create
BILL=$(curl -X POST https://api.sb/leaseline.app/bills \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"organization":"organization_northwind","amount":{"amount":29,"currency":"USD"},"dueOn":"2026-11-15","account":"expense.hosting"}' | jq -r '.bill["$id"] | split("/") | last')

# 2. Bill.approve
curl -X POST https://api.sb/leaseline.app/bills/$BILL/approve \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"

# 3. Bill.pay
curl -X POST https://api.sb/leaseline.app/bills/$BILL/pay \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
import { $ } from 'startup-builder'

const bill = await $.Bill.create({ organization: 'organization_northwind', amount: { amount: 29, currency: 'USD' }, dueOn: '2026-11-15', account: 'expense.hosting' })
await $.Bill.approve({ bill: bill.$id })
await $.Bill.pay({ bill: bill.$id })
BILL=$(npx startup-builder do Bill.create --json '{"organization":"organization_northwind","amount":{"amount":29,"currency":"USD"},"dueOn":"2026-11-15","account":"expense.hosting"}' | jq -r '.bill["$id"] | split("/") | last')
npx startup-builder do Bill.approve --json '{"bill":"'"$BILL"'"}'
npx startup-builder do Bill.pay --json '{"bill":"'"$BILL"'"}'
{
  "name": "do",
  "arguments": {
    "code": "const bill = await $.Bill.create({ organization: 'organization_northwind', amount: { amount: 29, currency: 'USD' }, dueOn: '2026-11-15', account: 'expense.hosting' })\nawait $.Bill.approve({ bill: bill.$id })\nreturn await $.Bill.pay({ bill: bill.$id })"
  }
}

Change it

  • Pay it today.
  • Pay every Northwind bill under $500 without asking me.
  • Pay half now and half next month.

Under the hood

Systems
Spend management, Treasury, Ledger, Work queue
Nouns
Bill, Organization, Approval, Entry, Transaction
Events
Bill.created, Bill.approved, Bill.paid, Transaction.reconciled
Stripe objects
Treasury OutboundPayment, Treasury Transaction

The supplier is an Organization on record with its bank. Bill.pay holds any Bill whose bank differs from that record, whatever its amount, until the change is confirmed through a second channel.