---
id: SVC-MBR-MEM-billing
title: Membership Billing Service Module
product_area: membership
module: memberships
repository: services-membership
source_module: modules/billing
revision: 1
status: draft
design_intent: proposed
implementation_evidence: partially-observed
inference: []
source_sha:
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
owns:
  - DOM-MBR-MEM-005
does_not_own:
  - Commerce owns the renewal purchases requested by execution.
  - Platform owns communication requests and delivery of renewal messages.
  - >-
    Memberships retains the periods selected here and applies drops through
    staff termination.
operations:
  - operation_id: listBillingTemplates
    intent: Find reusable renewal configurations by their supported filters.
    access: console
    permission: membership.billing.read
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: createBillingTemplate
    intent: Define reusable selection and action settings for a program’s renewals.
    access: console
    permission: membership.billing.manage
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: getBillingTemplate
    intent: Read a reusable renewal configuration.
    access: console
    permission: membership.billing.read
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: updateBillingTemplate
    intent: Merge supplied template changes at its read version.
    access: console
    permission: membership.billing.manage
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: deleteBillingTemplate
    intent: Remove an unreferenced template after checking its version.
    access: console
    permission: membership.billing.manage
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: listBillingRuns
    intent: Page the workspace’s renewal batches.
    access: console
    permission: membership.billing.read
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: createBillingRun
    intent: >-
      Create a draft batch using a template or supplied settings over
      ending-term dates.
    access: console
    permission: membership.billing.manage
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: getBillingRun
    intent: Read a renewal batch’s state and counted results.
    access: console
    permission: membership.billing.read
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: listBillingRunActions
    intent: Page the reviewed actions and recorded outcomes of a batch.
    access: console
    permission: membership.billing.read
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: planBillingRun
    intent: Select candidates and persist action proposals for a chosen business date.
    access: console
    permission: membership.billing.manage
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: executeBillingRun
    intent: >-
      Submit the reviewed batch to durable execution and return its job
      reference.
    access: console
    permission: membership.billing.manage
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: cancelBillingRun
    intent: Stop a draft or planned batch while retaining its proposed work.
    access: console
    permission: membership.billing.manage
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: listRecurringBillingRuns
    intent: Page recurring renewal configuration.
    access: console
    permission: membership.billing.read
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: createRecurringBillingRun
    intent: Schedule a template using local occurrence dates and selection offsets.
    access: console
    permission: membership.billing.manage
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: getRecurringBillingRun
    intent: Read one recurring renewal configuration.
    access: console
    permission: membership.billing.read
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
  - operation_id: updateRecurringBillingRun
    intent: >-
      Version-check a recurring configuration before pause, resume or schedule
      changes.
    access: console
    permission: membership.billing.manage
    realises:
      - CAP-MBR-MEM-013
    published_to_submissions: >-
      not published: staff renewal operations expose no applicant capture
      contract
events: []
jobs:
  - name: billing run execution job
    kind: durable job
    when: >-
      Execute creates the assigned job before commit and requests startup
      afterward.
    standard: >-
      The durable workflow processes action slices and applies its conditional
      failure consequence.
  - name: recurring billing run occurrence
    kind: schedule
    when: >-
      Local due occurrences deliver recurring billing work through Membership
      schedules.
    standard: The shared schedules library computes and claims occurrence work.
integrations:
  - system: Commerce
    direction: outbound
    contract: >-
      Reuse Membership checkout preparation before requesting Commerce placement
      through its currently refusing port.
  - system: Platform communications
    direction: outbound
    contract: >-
      Create communication requests for notices and reminders; their sending
      purposes remain unconnected.
consistency:
  - rule: >-
      Version-checked run operations use transactional row locking for planning,
      submission and cancellation.
    kind: transactional
    compensation: Reject invalid requests and roll back their local writes.
  - rule: >-
      Database effects settle with actions; Commerce order placement happens
      between the check and settlement transactions.
    kind: eventual
    compensation: >-
      The failure consequence retains settled actions and returns eligible runs
      to planned; absent startup recovery can leave a run executing.
evidence:
  - >-
    services-membership at 5994c270: modules/billing/aws/api/billing.routes.ts;
    aws/api/configuration-routes.ts; services/**;
    aws/logic/billing-run.step-function.ts; aws/lambda/BILLING_RUN.handler.ts.
controls: [TC-AVL-002, TC-AVL-003, TC-AVL-004, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-CHG-001, TC-CHG-002, TC-CHG-003, TC-CHG-004, TC-CRY-001, TC-CRY-002, TC-CRY-003, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-007, TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-MON-002, TC-MON-003, TC-MON-004, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-SEC-001, TC-SEC-004, TC-TEN-001, TC-TEN-002, TC-TEN-003]
---

# Membership Billing Service Module

## What This Service Is For

Billing turns renewal selection into reviewed action plans and executes those plans in durable slices. Recurring configuration repeats a template using the association’s local dates.

## Boundary

Templates, batches, actions, recurring records and execution jobs belong here. Coverage belongs to Memberships, orders to Commerce and sending to Platform communications. Preparation reuses the checkout participant before placement.

## Operations in Words

Console readers inspect templates, batches, actions and schedules. Billing managers create and edit configuration, plan batches, request execution and cancel work that has not started. These routes do not provide officer-scoped billing administration.

## Events and Jobs

Durable execution processes reviewed actions and scheduled occurrences create their dated batches. Drops publish membership termination through the ordinary closure path rather than a separate billing event family.

## Consistency Guarantees

Run changes check versions and allowed states under lock. Notices and drops settle in their local transactions, while order placement and settlement are separated by a partner call. The failure consequence can return the assigned run to planned, but missing startup recovery and disconnected order and sending adapters prevent complete operational readiness.
