Subscription is a solution for managing recurring payments using Xendit's scheduler. It offers an easy and flexible integration, allowing you to configure and automate recurring payment cycles based on your setup. By using the Subscriptions product, you eliminate the need to build your own scheduling system, including handling failed payment recovery. Xendit optimizes the success rate of payments through features designed specifically for subscription management.
High level data objects

Data object name | Description | Created by |
|---|---|---|
Plan | The primary data object for managing your subscription logic. It contains details such as the customer object, the amount to be deducted for each cycle, the schedule object, payment token(s) and the basic subscription plan configurations, including optional features. | You |
Schedule | Defines when subscription actions should occur. It includes merchant-defined timing details, such as intervals (e.g., daily, monthly, yearly) and retry logic. The schedule object can be created simultaneously with the subscription plan to enable plan customization for each customer. | You |
Cycle | Automatically generated based on the subscription plan object. Each subscription cycle represents an individual billing instance (e.g., a monthly plan for a year generates 12 cycles). Ad hoc changes can be made to specific cycles without affecting the base subscription plan. The subscription plan has a one-to-many relationship with its cycles. | Xendit |
Attempt | Represents each action taken to complete a subscription cycle (e.g., payments). Multiple attempts may occur within a single cycle depending on the retry configuration (e.g., a cycle with two retries can have up to three attempts). All attempts are stored within the corresponding cycle object. Each subscription cycle has a one-to-many relationship with its attempts. A single attempt can involve multiple | Xendit |
Integration flow
Example of integration flow if you are about to set up Subscriptions payment for your end user

Use this flow when you want Xendit to handle the payment method collection and initial authentication through a hosted page or component.
Initiate subscription: Once the end user selects a subscription plan on your system, create the corresponding payment session with type
SUBSCRIPTIONin Xendit with required informationReturn response: Xendit returns a session object containing the
payment_link_urlorcomponent_sdk_key.Redirect user: Redirect the end to xendit-hosted page via payment link or component
Authenticate & link: The end user proceed the payment method
Subscription plan activated: Once the subscription plan has been created, you will receive these webhooks:
payment_token.activation: Payment token has been createdpayment_session.completed: Payment session has been completedrecurring_plan.activated: The subscription plan becomes active. See the Plan lifecycle below.recurring.cycle.created: A new cycle createdIf you set
immediate_payment: trueyou may receive additional webhookspayment.captureandrecurring_cycle.succeededto indicate the immediate payment after the subscription plan has been created
Recurring schedule: Xendit processes subscription cycles based on the
anchor_dateandinterval. On each cycle, you will receive webhooks indicating status updates:recurring.cycle.created: A new cycle is createdrecurring.cycle.retrying: A payment attempt failed, but a retry is scheduled onnext_retry_timestampalongside thepayment.failurewebhookrecurring.cycle.failed: All retry attempts have failed alongside thepayment.failurewebhookrecurring.cycle.succeeded: Payment for the following cycle was successful alongside thepayment.succeededwebhook

Initiate subscription: Once the end user selects a subscription plan on your system, create the corresponding subscription request in Xendit with required information, including the intended payment tokens
Subscription plan activated: Once the subscription plan has been created, you will receive these webhooks:
payment_token.activation: Payment token has been createdpayment_session.completed: Payment session has been completedrecurring_plan.activated: The subscription plan becomes active. See the Plan lifecycle below.recurring.cycle.created: A new cycle createdIf you set
immediate_payment: trueyou may receive additional webhookspayment.captureandrecurring_cycle.succeededto indicate the immediate payment after the subscription plan has been created
Recurring schedule: Xendit processes subscription cycles based on the
anchor_dateandinterval. On each cycle, you will receive webhooks indicating status updates:recurring.cycle.created: A new cycle is createdrecurring.cycle.retrying: A payment attempt failed, but a retry is scheduled onnext_retry_timestampalongside thepayment.failurewebhookrecurring.cycle.failed: All retry attempts have failed alongside thepayment.failurewebhookrecurring.cycle.succeeded: Payment for the following cycle was successful alongside thepayment.succeededwebhook
Plan lifecycle

Status | Description | Webhook event |
|---|---|---|
Pending | If | |
Active | The plan is |
|
Inactive | The plan becomes |
|
Cycle lifecycle

Status | Description | Webhook event |
|---|---|---|
Created | The cycle has been created and is ready to execute based on the |
|
Retrying | If the first attempt fails and the plan has a retry configuration, you will receive the |
|
Succeeded | The cycle payment succeeded. You will receive the |
|
Failed | The cycle payment failed. You will receive the |
|