Subscriptions

Recurring billing

MarketplaceCustomersVersion 0.1.0manifest

What it is for ​

Define recurring plans and track customer subscriptions with trial, active, past due and cancelled states, including the next invoice date. It does not create invoices by itself.

What the package does and does not do ​

Recurring plans and customer subscriptions with a trial, active, past due and cancelled flow. It records the next invoice date; it does not create invoices on its own.

Models ​

subscriptions_plan ​

A recurring offer customers can subscribe to

Read group: subscriptions.user. Write group: subscriptions.manager.

FieldKindData classPersonal dataGroupAgents seeDescription
nametextnonenosubscriptions.userin clearPlan name, for example Team yearly
codetextnonenosubscriptions.userin clearShort code of the plan
intervalselect (monthly, quarterly, yearly)nonenosubscriptions.userin clearHow often the customer is billed: monthly, quarterly, yearly
pricemoneynonenosubscriptions.userin clearStandard price per billing interval (minor currency units, e.g. cents)
trial_daysnumbernonenosubscriptions.userin clearLength of the free trial in days
activeboolnonenosubscriptions.userin clearWhether new customers can pick the plan

subscriptions_subscription ​

A customer's recurring subscription to a plan

Read group: subscriptions.user. Write group: subscriptions.manager.

FieldKindData classPersonal dataGroupAgents seeDescription
customer_idref → partynonenosubscriptions.userin clearThe customer who subscribed
plan_idref → subscriptions_plannonenosubscriptions.userin clearThe plan subscribed to
started_ondatenonenosubscriptions.userin clearDate the subscription began (YYYY-MM-DD)
trial_ends_ondatenonenosubscriptions.userin clearDate the free trial ends (YYYY-MM-DD)
next_invoice_ondatenonenosubscriptions.userin clearDate the next invoice is due (YYYY-MM-DD)
recurring_amountmoneynonenosubscriptions.userin clearAmount billed each interval after discounts (minor currency units, e.g. cents)
currencytextnonenosubscriptions.userin clearISO 4217 currency code, for example EUR
seatsnumbernonenosubscriptions.userin clearNumber of licences or users covered
cancel_reasonlongtextnonenosubscriptions.userin clearWhy the customer cancelled
stateselect (trial, active, past_due, cancelled)nonenosubscriptions.userin clearSubscription status: trial, active, past_due, cancelled

Workflows ​

subscriptions_subscription ​

ActionMovesWho may run itApproval
subscriptions_subscription.activatestate: trial → activesubscriptions.managerno
subscriptions_subscription.mark_past_duestate: active → past_duesubscriptions.managerno
subscriptions_subscription.recoverstate: past_due → activesubscriptions.managerno
subscriptions_subscription.cancel_trialstate: trial → cancelledsubscriptions.manageryes
subscriptions_subscription.cancelstate: active → cancelledsubscriptions.manageryes
subscriptions_subscription.cancel_overduestate: past_due → cancelledsubscriptions.manageryes

Permission groups ​

Groups used by this app:

  • subscriptions.manager
  • subscriptions.user

Approval steps ​

Steps an agent can only propose:

  • subscriptions_subscription.cancel_trial
  • subscriptions_subscription.cancel
  • subscriptions_subscription.cancel_overdue

What agents can and cannot do ​

An agent can read, search, create and update records of this app, and run the actions that need no approval, within the permission groups of its token.

It can only propose these steps, and a person must approve them: subscriptions_subscription.cancel_trial, subscriptions_subscription.cancel, subscriptions_subscription.cancel_overdue, subscriptions_plan.delete, subscriptions_subscription.delete.

Dependencies ​

  • base

Install ​

Install it from the Customize app (Marketplace), or from the command line:

bash
obop modules install-from subscriptions

Needs a database and administrator rights.

Build your own ​

The module guide shows how apps like this one are written