Skip to main content

Introduction

The Subscriptions module lets you set up recurring user payments for a fixed set of products in your project. A subscription consists of a set of products and a period: every N days, the user is charged automatically (or manually) for the sum of the prices of the products it includes.

The module has two main parts:

  • The "Subscriptions" module in the left menu: a catalog of all subscriptions in the project. Here you create, edit, and delete subscriptions and configure their payment account, period, and products. For details, see subscription settings (opens in a new tab).
  • The "Subscriptions" tab in the user card: a list of a specific user's subscriptions with their statuses, end dates, and manual actions (for custom subscriptions). For details, see user subscriptions (opens in a new tab).

Client applications work with subscriptions through the API. For details, see Subscriptions API (opens in a new tab).

How a subscription works​

When you create a subscription in the admin panel, you select:

  • Payment account: determines how payment is made. For account types, see payment accounts (opens in a new tab).
  • Period in days: how often the user must pay to renew the subscription.
  • List of products in the subscription: their current prices add up to the subscription's total cost.

When a user subscribes through the API, the system:

  1. Creates a subscription record for the user.
  2. Returns a payment link (for stripe and midtrans) or, for custom, activates the subscription immediately.
  3. When the period ends, charges the next payment automatically (stripe, midtrans) or waits for manual renewal (custom).

Supported payment accounts​

You can connect one of the following payment account types to a subscription:

  • Stripe: automatic recurring charges through Stripe. After the subscription is created, the API returns a link for the initial payment.
  • Midtrans: automatic recurring charges through Midtrans. Like Stripe, it returns a payment link.
  • Custom: a manual subscription. Charges are not made automatically; an administrator renews and cancels the subscription from the user card.
info

The payment account type determines which actions are available for a subscription and whether it can be canceled through the API. custom subscriptions can be canceled only in the admin panel, in the user's section.

Price changes​

A subscription's cost is the sum of the prices of the products it includes. If you change the price of one of those products, active subscriptions recalculate their cost automatically, and the new cost applies from the next billing period.

info

The current period is always charged at the price in effect when it started. This lets you change products and their prices without affecting periods the user has already paid for.