Documentation Index

Fetch the complete documentation index at: https://docs.xendit.co/llms.txt

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

For archived content, access the previous documentation here or the previous API reference here.

Subscription Webhook

Prev Next
Post
/your_subscription_webhook_url

Endpoint to receive webhook notifications for subscription events. Xendit will send webhooks to this URL when plan or cycle status changes occur.

Plan Events:

  • recurring.plan.activated - Plan successfully activated
  • recurring.plan.inactivated - Plan deactivated

Cycle Events:

  • recurring.cycle.created - New cycle created
  • recurring.cycle.retrying - Cycle payment failed, retry scheduled
  • recurring.cycle.succeeded - Cycle payment completed
  • recurring.cycle.failed - Cycle payment failed after all retries
  • recurring.cycle.force_attempt_failed - Forced payment attempt failed
Body parameters

Webhook payload containing either a plan or cycle event.

Expand All
OneOf
Xendit_Subscriptions_API_RecurringPlanWebhook
object (Xendit_Subscriptions_API_RecurringPlanWebhook)
event
string Required

Webhook event names for recurring plan status updates.

Valid values[ "recurring.plan.activated", "recurring.plan.inactivated" ]
Examplerecurring.plan.activated
business_id
string Required

Business ID of Xendit.

Example62440e322008e87fb29c1fd0
created
string (date-time) Required

Timestamp of webhook delivery attempt in ISO 8601 date-time format.

Example2021-12-31T23:59:59Z
api_version
string

API version used for this webhook.

Example2026-01-01
data
object Required
reference_id
string Required

Merchant-provided identifier for the recurring plan.

Min length1
Examplemy-plan-01
customer_id
string Required

Xendit-generated customer ID.

currency
string Required

ISO 4217 currency code (e.g., IDR, PHP).

ExampleIDR
amount
number Required

Amount to be charged in each recurring cycle.

Minimum0
schedule
object (Xendit_Subscriptions_API_RecurringScheduleCreate) Required
interval
string Required

Frequency of the recurring cycles.

Valid values[ "DAY", "WEEK", "MONTH", "YEAR" ]
interval_count
integer Required

Number of intervals between consecutive cycles.

Minimum1
Maximum365
total_recurrence
integer | null

Total number of cycles (optional; runs indefinitely if null).

Minimum1
Maximum32000
anchor_date
string (date-time) Required

Start date for the recurring schedule (ISO 8601 format), max allowed day of the month is 28. Supports time offset and UTC zero.

Example2020-11-20T16:23:52Z
retry_interval
string | null

Interval between retry attempts for failed payments.

Valid values[ "DAY", null ]
retry_interval_count
integer | null

Number of retry intervals between consecutive retries.

Minimum1
Maximum365
total_retry
integer | null

Maximum number of retries for failed cycles.

Minimum1
Maximum10
failed_attempt_notifications
Array of integer

Notifications triggered at specific retry attempts.

Example[ 1, 3, 5 ]
integer
Minimum1
Maximum10
payment_tokens
Array of object Required
Min items0
Max items5
object
payment_token_id
string Required

ID for payment token.

Examplept-f8429206-f3ea-49f0-abb4-eaa89064056e
rank
integer Required

Order in which payment tokens will be attempted (1 to 5).

Minimum1
Maximum5
immediate_payment
boolean

Payment taken upon recurring plan creation. Failing the payment will inactivate the plan.

Defaultfalse
failed_cycle_action
string

Determines if the plan should be terminated when a cycle fails. RESUME continues, STOP inactivates the plan.

Valid values[ "RESUME", "STOP" ]
Default"RESUME"
notification_channels
Array of string

Channels to notify end user.

string
Valid values[ "WHATSAPP", "EMAIL" ]
locale
string

ISO 639-1 two-letter codes for language of notifications to be sent to end user

Default"en"
payment_link_for_failed_attempt
boolean

Whether a payment link is generated for failed cycle attempts.

Defaultfalse
metadata
object | null

Additional JSON properties. Max 20 keys, with key names up to 40 characters and values up to 80 characters.

Example{ "customKey": "customValue" }
property*
string additionalProperties
description
string | null

Custom description of the recurring plan.

Max length1000
ExampleMy newspaper subscription 01
items
Array of object (Xendit_Subscriptions_API_BasketItem) | null

Details of items included in the recurring plan.

object
type
string Required

Type of item.

Valid values[ "DIGITAL_PRODUCT", "PHYSICAL_PRODUCT", "DIGITAL_SERVICE", "PHYSICAL_SERVICE", "FEE" ]
reference_id
string Required
Min length1
Max length255
Examplemy-plan-01
name
string Required

Name of the item.

Min length1
Max length255
ExampleGranny Smith Apple
net_unit_amount
number Required

Net amount charged per unit. Negative values for discounts.

quantity
integer Required

Number of units of the item.

url
string | null

URL of the item, must be HTTPS or HTTP.

Pattern^https?:\/\/.+
category
string Required

Merchant category for the item.

Max length255
ExampleFood
subcategory
string | null

Subcategory for the item.

Max length255
ExampleFruits
description
string | null

Description of the item.

Max length255
ExampleGreen apple that is a little sour.
metadata
object | null

Additional JSON properties. Max 20 keys, with key names up to 40 characters and values up to 80 characters.

property*
string additionalProperties
id
string

Xendit-generated recurring plan ID.

Examplerepl_4e66b458-00b7-4ddd-9859-cce153dda097
status
string

Status of the recurring plan.

Valid values[ "ACTIVE", "INACTIVE", "PENDING", "REQUIRES_ACTION" ]
failure_code
string | null

Failure code for failed plan creation

ExampleUNPROCESSABLE_ENTITY_ERROR
country
string | null

Country code for the plan

ExampleID
payment_session_id
string | null

Payment session ID for plans that require account linking

Exampleps-661f87c614802d6c402cd82d
recurring_cycle_count
integer

Number of cycles generated for this plan.

actions
Array of object

Array of objects containing URLs for end users to complete the recurring plan.

object
action
string Required

Describes the purpose of the action. AUTH triggers payment account linking.

url_type
string

Type of URL, optimized for desktop or web interface.

Valid values[ "WEB" ]
url
string (uri)

Generated URL to perform the action.

method
string

HTTP method for calling the URL.

Valid values[ "GET", "POST" ]
created
string (date-time)

ISO 8601 date time format

Example2017-07-21T17:32:28Z
updated
string (date-time)

ISO 8601 date time format

Example2017-07-21T17:32:28Z
Xendit_Subscriptions_API_RecurringCycleWebhook
object (Xendit_Subscriptions_API_RecurringCycleWebhook)
event
string Required

Webhook event names for recurring cycle status updates.

Valid values[ "recurring.cycle.created", "recurring.cycle.retrying", "recurring.cycle.succeeded", "recurring.cycle.failed", "recurring.cycle.force_attempt_failed" ]
Examplerecurring.cycle.succeeded
business_id
string Required

Business ID of Xendit.

Example62440e322008e87fb29c1fd0
created
string (date-time) Required

Timestamp of webhook delivery attempt in ISO 8601 date-time format.

Example2021-12-31T23:59:59Z
api_version
string

API version used for this webhook.

Example2026-01-01
data
object (Xendit_Subscriptions_API_RecurringCycle) Required
id
string

Xendit-generated recurring cycle ID.

Examplerecy_4e66b458-00b7-4ddd-9859-cce153dda097
type
string

Indicates whether the cycle was charged as part of plan creation

Valid values[ "SCHEDULED", "IMMEDIATE" ]
reference_id
string

Inherited from Plan reference_id

plan_id
string

ID of the associated recurring plan.

Examplerepl_4e66b458-00b7-4ddd-9859-cce153dda097
customer_id
string

Xendit-generated customer ID.

cycle_number
integer

The order of the current cycle within the plan

status
string

Status of the recurring cycle.

Valid values[ "SCHEDULED", "PENDING", "RETRYING", "FAILED", "SUCCEEDED", "CANCELLED" ]
attempt_details
Array of object

Details of any attempt actions made on the cycle.

object
attempt_number
integer Required

Order of the attempt within the cycle. The current action belongs to this attempt.

action_number
integer Required

Order of the action within an attempt. An attempt can have multiple actions. In general, one action corresponds to one unique payment token within the same attempt.

type
string Required

The type of payment attempt made on the cycle. INITIAL represents the first system generated attempt on the cycle. RETRY represents all subsequent system generated attempt after first attempt failed. FORCED represents explicit request made by the merchant to perform a payment attempt on the cycle. PAYMENT_LINK represents a payment link sent to the end user to solicit payment.

Valid values[ "INITIAL", "RETRY", "FORCED", "PAYMENT_LINK" ]
created
string (date-time) Required

The date time that the payment action was performed.

payment_id
string | null Required

This field used to indicate the payment ID created from cycle

Examplepy-5cd39c23-89da-45f9-b316-f1e865b71b46
payment_token_id
string | null

The payment token ID used for this payment action.

Examplept-f8429206-f3ea-49f0-abb4-eaa89064056e
status
string Required

The status of the action

Valid values[ "SUCCEEDED", "FAILED", "PENDING" ]
failure_code
string | null Required

If payment action encounters an error, the failure reason will be shown here.

next_retry_timestamp
string (date-time) | null Required

The date time that the next RETRY attempt should be created for this cycle.

payment_session
object | null

Contains details of payment links sent to the end user.

session_id
string

Payment session id created when the cycle attempt failed

Exampleps-661f87c614802d6c402cd82d
payment_link_url
string

This URL will lead the end user to a checkout page to complete the payment.

attempt_count
integer

number of attempts made on the cycle so far

forced_attempt_count
integer

number of forced attempts made on the cycle so far

scheduled_timestamp
string (date-time)

The scheduled date and time that the cycle will be executed. Always in UTC zero.

Example2020-11-20T16:23:52Z
currency
string

ISO 4217 currency code (e.g., IDR, PHP).

ExampleIDR
amount
number

Amount charged in the cycle.

Minimum0
metadata
object | null
created
string (date-time)

ISO 8601 date time format

Example2017-07-21T17:32:28Z
updated
string (date-time)

ISO 8601 date time format

Example2017-07-21T17:32:28Z
Responses
200

Webhook received successfully. Return 200 to acknowledge receipt.

500

Server error - webhook will be retried.