Bills

Overview

Bills represent amounts you owe to vendors. They track expenses, vendor payments, and can be exported for accounting purposes. Bills support draft, finalized, and paid states for workflow management.


How it works

  1. Create a bill - Record an expense owed to a vendor
  2. Review and finalize - Verify details and finalize the bill
  3. Mark as paid - Record when payment is made to the vendor
  4. Export for accounting - Download bills for your accounting system

Example: You receive an invoice from a content provider for $5,000. Create a bill in draft, verify the amount matches the invoice, finalize it, and mark as paid when you send payment.


API Endpoints

MethodEndpointDescription
GET/billsList bills
POST/billsCreate bill
GET/bills/{id}Get bill
PUT/bills/{id}Update bill
DELETE/bills/{id}Delete bill
POST/bills/{id}/finalizeFinalize bill
POST/bills/{id}/mark-as-paidMark bill as paid
GET/bills/exportExport bills

Important Behaviors

  • Soft delete: Bills are soft-deleted, but only draft bills can be deleted.
  • Required on update: period_start and period_end are required on every update.
  • Line items replaced: On update, line items are replaced entirely (not merged).
  • Status workflow: Bills follow a lifecycle: draftfinalizedpaid. Only draft bills can be edited or deleted.
  • Events: BillCreated and BillDeleted events are fired.

Bill workflow

StatusDescription
DraftBill is being prepared, can still be edited or deleted
OpenBill is finalized and locked, ready for payment
PaidPayment has been made to the vendor

Bill object

AttributeTypeDescription
idintegerUnique identifier for the bill
bill_numberstringBill number (alias for number)
numberstringBill number
statusstringBill status: Draft, Open, or Paid
user_idintegerID of the vendor (user record)
userobjectVendor details (id, first_name, last_name, email). Always included.
amount_duenumberAmount due
amount_paidnumberAmount paid
amount_remainingnumberRemaining amount
currencystringThree-letter ISO currency code
paidbooleanWhether the bill has been paid
metadataobjectKey-value pairs for storing additional data
subtotalnumberSubtotal before tax
totalnumberTotal amount
footerstringAdditional notes/footer
purchase_orderstringPurchase order reference number (max 20 chars)
descriptionstringBill description
period_startstringBilling period start date (YYYY-MM-DD)
period_endstringBilling period end date (YYYY-MM-DD)
line_itemsarrayArray of line item objects (id, description, quantity, unit_price, total, currency)
finalized_atintegerUnix timestamp when finalized
paid_atintegerUnix timestamp when paid
created_atintegerUnix timestamp of creation
updated_atintegerUnix timestamp of last update