Skip to content

Invoice.collected

Emitted each time an Invoice is collected.

Invoice.collect emits Invoice.collected when it completes on an Invoice.

PropertyValue
Emitted byInvoice.collect
NounInvoice
MovesCustomer atRisk to activated when the overdue Invoice is this Customer’s; Invoice open to paid; Subscription incomplete to active when the Invoice bills this Subscription’s first period; Subscription pastDue to active when the Invoice bills this Subscription
WakesNone.

Payload

Each delivery is an Event record. data holds what Invoice.collect returns, and previous holds the state it left.

FieldTypeRequiredDescription
namestringrequiredInvoice.collected.
atdatetimerequiredWhen it happened.
seqintegerIts position in the namespace, one more than the Event before; any seq is a cursor into the history.
datajsonrequiredThe Thing as the Action left it.
data.invoiceInvoicerequiredThe paid Invoice.
data.invoice.totalmoneyrequiredThe amount due.
data.invoice.duedaterequiredWhen payment is due.
data.invoice.paidAtdatetimeWhen it was paid.
data.invoice.statusstringOne of draft, open, paid, void, or uncollectible.
data.invoice.collectionstringcharge charges the saved payment method; send sends the Invoice and waits for a transfer. charge by default.
data.invoice.termsintegerDays from issue until a send Invoice is due, such as 30; sets due.
data.invoice.purchaseOrderstringThe Customer’s purchase order number, printed on the Invoice.
data.invoice.refundedmoneyThe total returned to the Customer, from zero up to the amount paid.
data.invoice.numberstringThe Invoice number, sequential per Startup and never reused, voided Invoices included.
data.invoice.linesjsonEach Offer billed: its quantity, Period and amount, with any Coupon or Credit Grant applied.
data.invoice.pdfurlThe Invoice, or its receipt once paid, as a PDF on the Startup’s Domain that names the seller of record.
data.invoice.payUrlurlThe page on the Startup’s Domain where the Customer pays it by card or bank transfer.
data.previous.statusstringrequiredThe status before this Event: open.

Example

JSON
{
  "$id": "https://api.sb/patentpad.com/events/event_1",
  "$type": "Event",
  "name": "Invoice.collected",
  "at": "2026-10-22T12:00:00Z",
  "data": {
    "invoice": {
      "$id": "https://api.sb/patentpad.com/invoices/invoice_1",
      "$type": "Invoice",
      "total": {
        "amount": 499,
        "currency": "USD"
      },
      "due": "2026-10-22",
      "paidAt": "2026-10-22T12:00:00Z",
      "status": "paid",
      "collection": "charge",
      "terms": 1,
      "purchaseOrder": "PO-48213",
      "refunded": {
        "amount": 499,
        "currency": "USD"
      },
      "number": "LEDG-0042",
      "lines": {},
      "pdf": "https://patentpad.com",
      "payUrl": "https://patentpad.com"
    },
    "previous": {
      "status": "open"
    }
  },
  "seq": 1
}