Subscription
A recurring agreement to bill (receivable) or be billed (payable) for Prices, period after period. Each period's charge is an Invoice that points back at it.
| Pack | Billing |
| Version | v1 (latest) |
| URN | urn:postware:billing:subscription |
| Identity | identifiers |
| Status categories | pending, trialing, active, past_due, paused, cancelled |
Fields
| Field | Type | Req | Notes |
|---|---|---|---|
direction | enum(receivable| | yes | receivable = our customer; payable = a vendor we pay; default receivable |
counterparty | Ref<Organization | | yes | |
items | object[] | yes | {price: Ref<Price>, quantity: decimal} |
status | Status(pending| | yes | |
current_period | Period | no | the period being billed now; absent while pending |
started_at | datetime | no | |
trial_end | datetime | no | |
cancel_at | datetime | no | scheduled end; when set the subscription does not renew |
ended_at | datetime | no | |
reference | string | no | the customer's PO or reference, copied onto generated invoices |
Events
subscription.cancelled when status.category becomes cancelled; subscription.activated when status.category becomes active; subscription.past_due when status.category becomes past_due.