Skip to main content

Documentation Index

Fetch the complete documentation index at: https://86d.app/docs/llms.txt

Use this file to discover all available pages before exploring further.

The subscriptions module manages the recurring-billing lifecycle on top of the products and payments modules. Customers can subscribe to a product, choose a billing interval, pause and resume, swap variants, and cancel. The module schedules renewal charges through whichever payment provider is configured under @86d-app/payments. Source: modules/subscriptions · npm: @86d-app/subscriptions

Installation

86d module add subscriptions
The module requires @86d-app/products, @86d-app/orders, and @86d-app/payments to be enabled.

Configuration

subscriptions({
  defaultBillingDay: "1",          // 1-28, day of month for renewals
  retryAttempts: "3",              // retries on failed renewal charge
  cancelOnFailure: "true",         // cancel after exhausting retries
  trialDaysDefault: "0",           // default trial period in days
});

Store endpoints

MethodPathDescription
POST/subscriptionsCreate a subscription
GET/subscriptions/meList the customer’s subscriptions
GET/subscriptions/me/:idGet a single subscription
POST/subscriptions/me/:id/pausePause renewals
POST/subscriptions/me/:id/resumeResume
POST/subscriptions/me/:id/swapSwap variant
POST/subscriptions/me/:id/cancelCancel

Admin endpoints

MethodPathDescription
GET/admin/subscriptionsList subscriptions (filter by status, customerId)
GET/admin/subscriptions/:idDetail
POST/admin/subscriptions/:id/refundRefund a renewal charge
GET/admin/subscriptions/upcomingRenewals due in the next N days

Lifecycle

trial -> active -> active (renews each cycle)
active -> paused -> active
active -> past_due -> active (after retry success) | cancelled (after retry exhaustion)
active -> cancelled

Components

  • <SubscriptionPlanCard plan={...} />: storefront upsell card.
  • <SubscriptionsList />: customer self-service list.
  • <SubscriptionDetail id={...} />: management UI with pause / cancel actions.
  • Payments: processes renewal charges.
  • Customers: owns the customer record.
  • Memberships: for paid access plans rather than per-product subscriptions.