Subscriptions

Set up recurring billing to collect payments automatically on a schedule—perfect for SaaS, memberships, and content subscriptions.

What is Subscription

Subscription is a payment service that continuously collects payments from users. Unlike one-time payments, subscriptions support automatically charging users at set intervals, suitable for business scenarios that require ongoing service provision.

Subscription vs One-time Payment

Comparison DimensionOne-time PaymentSubscription Payment
Billing FrequencyOne-timePeriodic (daily/monthly/yearly)
User AuthorizationRequires user confirmation each timeAutomatic billing after initial authorization
Applicable ScenariosProduct purchase, one-time servicesMemberships, content subscriptions, ongoing services
Revenue PredictabilityLowHigh (stable recurring revenue)

Value of Subscriptions

For Merchants:

  • Build stable recurring revenue
  • Reduce user churn, increase customer lifetime value (LTV)
  • Simplify billing process, reduce operational costs

For Users:

  • No need for repeated payment operations, more convenient experience
  • Continuous service enjoyment, avoid service interruptions

Core Capabilities

Automatic Billing

The core of subscription is automatic billing capability, supporting two modes:

ModeDescriptionApplicable Scenarios
Managed SubscriptionOnerway automatically bills according to the cycle, merchants only need to handle billing result notificationsMerchants wanting to simplify operations
Self-managed SubscriptionMerchants control billing timing themselves, manually trigger billing requestsMerchants needing flexible control over billing logic

Flexible Billing Cycles

Supports multiple billing cycle configurations:

  • By Day (D) — e.g., bill every 7 days
  • By Month (M) — e.g., bill monthly (managed subscription only)
  • By Year (Y) — e.g., bill annually (managed subscription only)
Self-managed subscriptions only support daily (D) billing.

Subscription Lifecycle Management

Manage each user's subscription status through Subscription Contract (contractId):

  • Create Subscription — User completes initial purchase/signing
  • Recurring Billing — Automatic/manual renewal according to set cycle
  • Upgrade/Downgrade — Change subscription plan, system calculates price difference (managed subscription only)
  • Pause/Resume — Temporarily pause billing (via management page)
  • Cancel Subscription — Terminate subscription relationship

Subscription Status Description:

StatusDescription
trialingIn trial period
activeSubscription active
paymentduePayment due
pastduePayment overdue
pausedPaused
canceledCanceled
endedEnded (expired)

Trial Period Support

Supports setting trial periods for subscriptions:

  • Set by number of days (e.g., 7-day trial)
  • Set by end date
  • Configurable whether trial period counts toward subscription cycle

Billing Result Notifications

Notify merchants of billing results asynchronously via Webhook. Merchants need to:

  • Verify notification signature
  • Update local subscription status
  • Handle billing failures

Customer Subscription Management

Supports sending subscription-related email notifications to customers. Customers can view and manage their subscription services via email, including:

  • View subscription details
  • Manage payment methods
  • Cancel subscription

Core Concepts

Initial Purchase and Renewal

ConceptDescriptionrequestType
Initial PurchaseUser's first subscription, creates subscription contract, completes first payment or signs only0
RenewalSubsequent recurring billing (managed subscription executes automatically, self-managed subscription initiated by merchant)1
Upgrade/DowngradeChange subscription plan, requires price difference amount (managed subscription only)2

Subscription Contract and Payment Token

  • Subscription Contract (contractId) — Represents the subscription relationship between user and merchant, uniquely identifies a subscription
  • Payment Token (tokenId) — User-authorized payment method credential, used for subsequent automatic billing
Merchants should properly save contractId and tokenId for subsequent renewals and subscription management.

Subscription Product Name

  • If not providing productName: Each customer can only create one subscription
  • If providing productName: Same customer can subscribe to multiple different products

Subscription Validity Configuration

Managed subscriptions require setting subscription validity, choose one:

ParameterDescriptionExample
cycleCountNumber of billing cycles (1-99)12 times
expireDateSubscription end date2025-12-31

Billing Modes

Modemode ValueDescription
Sign Only1User authorizes but no immediate billing, suitable for scenarios starting with trial period
Sign and Bill2User authorizes and completes first billing simultaneously (default)

Subscription Cycle

Subscription cycle determines the time interval for automatic billing, consisting of two parameters:

ParameterDescriptionOptions
frequencyTypeCycle typeD (day), M (month), Y (year)
frequencyPointCycle interval valueNumber, e.g., 1, 7, 30

Cycle Examples:

frequencyTypefrequencyPointMeaning
D1Bill once per day
D7Bill every 7 days
M1Bill monthly
Y1Bill annually

Cycle Restrictions:

Subscription TypeSupported Cycle Types
Managed SubscriptionD (day), M (month), Y (year)
Self-managed SubscriptionD (day) only

Billing Time Points:

  • Managed Subscription — Onerway automatically initiates billing according to set cycle
  • Self-managed Subscription — Merchant controls billing timing, frequencyPoint serves only as suggested interval

Subscription Updates (Upgrade/Downgrade)

Subscription updates allow customers to change subscription plans during the subscription period (e.g., upgrade from basic to premium).

Only managed subscriptions support upgrade/downgrade functionality.

Update Parameters:

ParameterDescriptionOptions
requestTypeRequest type2 (indicates upgrade/downgrade)
changeModeEffective method1 immediate effect, 2 effective next billing cycle
prorationPrice difference amountUpgrade requires additional payment, downgrade requires refund handling

Effective Method Description:

changeModeDescriptionApplicable Scenarios
1Immediate effectCustomer wants to use new plan benefits immediately
2Effective next billing cycleContinue using original plan for current cycle, switch next cycle

Price Difference Handling:

  • Upgrade — When effective immediately (changeMode=1), calculate price difference based on remaining days and collect
  • Downgrade — When effective immediately (changeMode=1), merchant needs to call refund API to handle price difference refund

Object Relationships

Applicable Scenarios

ScenarioExamples
SaaS Software ServicesMonthly/annual software usage fees
Membership SubscriptionsE-commerce memberships, VIP privileges
Content SubscriptionsStreaming, knowledge payment, news subscriptions
Recurring ServicesInsurance renewals, gym memberships, online education
Scheduled PurchasesRegular delivery of daily necessities, food

Not Applicable Scenarios

  • One-time large transactions
  • Variable amount pay-per-use (e.g., usage-based billing)
  • Payment scenarios requiring user confirmation each time

How to Integrate Subscriptions

Prerequisites

Integration Method Selection

Integration MethodDescriptionDevelopment Cost
Managed SubscriptionPlatform bills automatically, simple integrationLow
Self-managed SubscriptionMerchant controls billing, high flexibilityMedium

Integration Process Overview

  1. Preparation — Obtain merchant number, signing key, configure callback URL
  2. Create Initial Purchase Request — Call checkout interface, pass subProductType=SUBSCRIBE and subscription configuration
  3. User Completes Payment/Signing — Redirect to checkout, user completes authorization
  4. Obtain Subscription Credentials — Get contractId, tokenId from sync return/async notification
  5. Handle Subsequent Billing
    • Managed Subscription: Wait for platform automatic billing notification
    • Self-managed Subscription: Merchant initiates billing request per cycle
  6. Subscription Management — Handle upgrade/downgrade, cancellation operations

Appendix

Glossary

TermDescription
contractIdSubscription contract ID, uniquely identifies a subscription
tokenIdPayment token, used for subsequent billing
selfExecuteManaged mode: 1=managed subscription, 2=self-managed subscription
requestTypeRequest type: 0=initial purchase, 1=renewal, 2=upgrade/downgrade
modeBilling mode: 1=sign only, 2=sign and bill
frequencyTypeCycle type: D=day, M=month, Y=year
frequencyPointCycle interval value

Supported Payment Methods

Subscriptions support the following payment methods:

TypePayment MethodsDescription
Card PaymentVisa, Mastercard, etc.Supports managed and self-managed subscriptions
Local PaymentDANA, WeChat, GCash, Touch'n GoSelf-managed subscription only, requires zero-amount signing first
Local payment method subscriptions need to use sign-only mode (mode=1), establishing the contract through a zero-amount initial transaction.