Skip to content

ffl_core.membership

Source: apps/ffl_core/ffl_core/membership.py · 12 endpoint(s)

Generated by make api-docs — do not edit by hand.

cancel_membership

POST /api/method/ffl_core.membership.cancel_membership

Auth (derived from code): Roles: Sales Manager / System Manager

Cancel a membership. By default it runs to the end of the period it is paid for and is not

renewed. end_now ends it today: the current invoice's deferred lines get today as their service stop date, so what is still deferred becomes income today. The invoice itself is never cancelled; a refund is a credit note.

arg type required default description
membership string yes — Membership name (Active, Past Due or Suspended).
reason string yes — Why (kept on the membership).
end_now — no 0 1 to end it today instead of at the period end.

Returns: The membership's panel row.

apps/ffl_core/ffl_core/membership.py:607

change_card

POST /api/method/ffl_core.membership.change_card

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager

Charge a membership's renewals to another of the customer's cards saved for recurring

charges.

arg type required default description
membership string yes — Membership name.
saved_card string yes — Saved Card name: the customer's, active, saved for recurring charges.

Returns: The membership's panel row.

apps/ffl_core/ffl_core/membership.py:581

discard_membership

POST /api/method/ffl_core.membership.discard_membership

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager

Drop a Pending membership the customer did not pay for. Its unpaid invoice is cancelled —

refused once any payment or card charge touched it.

arg type required default description
membership string yes — Membership name (Pending).
reason string yes — Why (kept on the membership).

Returns: The membership's panel row (status Cancelled).

apps/ffl_core/ffl_core/membership.py:681

get_memberships

POST /api/method/ffl_core.membership.get_memberships

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager / Accounts User / Accounts Manager

A customer's memberships and the plans on sale, for the Customer form's Memberships panel.

A membership whose invoice has since been paid another way is settled here.

arg type required default description
customer string yes — Customer name (document id).

Returns: {plans: [{name, price, billing_period, registration_fee, auto_renew_default, terms_template}], memberships: [panel rows, live first; a row says whether its renewal is overdue, can be retried on the card, or has a card charge waiting], cards: the customer's active recurring-use saved cards [{name, card_summary}], can_cancel: whether the caller may cancel}.

apps/ffl_core/ffl_core/membership.py:468

invoice_membership

POST /api/method/ffl_core.membership.invoice_membership

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager

Build and submit the Pending membership's first Sales Invoice (or hand back the unpaid one

already made), after the plan's terms are signed. The counter takes payment against it.

arg type required default description
membership string yes — Membership name (Pending).

Returns: {sales_invoice, outstanding, customer, auto_renew}.

apps/ffl_core/ffl_core/membership.py:239

invoice_renewal

POST /api/method/ffl_core.membership.invoice_renewal

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager

The overdue renewal's invoice (the open one, else a new one for the next period from the

original due date), for the counter to take payment by any tender. Paid: Active again.

arg type required default description
membership string yes — Membership name (Past Due, Suspended, or Active past its period end).

Returns: {sales_invoice, outstanding, customer, auto_renew: 0 (no card charge from this flow)}.

apps/ffl_core/ffl_core/membership.py:1179

needs_attention

POST /api/method/ffl_core.membership.needs_attention

Auth (derived from code): Roles: Sales Manager / System Manager

Memberships a manager should look at: Past Due, Suspended, a renewal charge the gateway never

confirmed, a renewal the job could not charge, and sign-ups still unpaid after a few days.

Returns: {renewals_on: whether the daily renewal job runs, rows: [{membership, customer, customer_name, plan, status, reason, detail, current_period_end, sales_invoice, outstanding, can_retry, can_cancel, can_drop}]}.

apps/ffl_core/ffl_core/membership.py:1229

page_members

POST /api/method/ffl_core.membership.page_members

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager / Accounts User / Accounts Manager

One page of the Memberships page's member list, by customer name.

arg type required default description
plan string | null no None Membership Plan name; blank = every plan.
status string | null no None Membership status; blank = every status.
search string | null no None Part of the customer's name, id or mobile number; blank = everyone.
start integer no 0 Rows to skip (paging, 50 a page).

Returns: {rows: [{name, customer, customer_name, plan, status, next_charge_date, ends_on, auto_renew, card_summary}], more: whether another page follows}.

apps/ffl_core/ffl_core/membership.py:1419

page_overview

POST /api/method/ffl_core.membership.page_overview

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager / Accounts User / Accounts Manager

Everything the Memberships page shows above the member list, in one round trip.

Returns: {plans: [{name, active, billing_period, price, registration_fee, auto_renew_default, grace_enabled, grace_days, terms_template, description, members, benefits: one line per member benefit}], totals: {active, monthly, renewing_soon, attention}, attention: the Needs attention answer (managers only, else null), can_manage: may act on memberships, can_edit_plans: may create and change plans}. monthly is what the Active and Past Due members bill per month (a yearly price counts a twelfth); renewing_soon counts auto-renewing Active members charged in the next 7 days.

apps/ffl_core/ffl_core/membership.py:1372

retry_renewal

POST /api/method/ffl_core.membership.retry_renewal

Auth (derived from code): Roles: Sales Manager / System Manager

Charge a membership's saved card now for its overdue renewal (Past Due, Suspended, or Active

past its period end). Paid: Active again, the new period starting at the original due date. A card charge still waiting for the gateway's answer is looked up, never sent again.

arg type required default description
membership string yes — Membership name.

Returns: {outcome: renewed / declined / unknown / not_started, message: what happened, row: the membership's panel row}.

apps/ffl_core/ffl_core/membership.py:1150

set_auto_renew

POST /api/method/ffl_core.membership.set_auto_renew

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager

Turn a membership's auto-renew on or off. On needs a card saved for recurring charges

(the membership's own, else the customer's default one); a membership ending at period end is a manager's cancellation and stays off.

arg type required default description
membership string yes — Membership name.
enabled — yes — 1 to renew automatically, 0 not to.

Returns: The membership's panel row.

apps/ffl_core/ffl_core/membership.py:539

start_membership

POST /api/method/ffl_core.membership.start_membership

Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager

Start selling a membership: the customer's Pending membership of the plan (a Pending one

already there is picked up again, with the new auto-renew choice).

arg type required default description
customer string yes — Customer name (document id); not the walk-in customer.
plan string yes — Membership Plan name; must be active.
auto_renew — no None 1 / 0; blank = the plan's default.

Returns: The panel row of the membership ({name, plan, status, auto_renew, terms_template, terms_state, ...}).

apps/ffl_core/ffl_core/membership.py:181