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

Create Subscription Plan

Prev Next
Post
/recurring/plans

Creates a new subscription plan for managing subscription payments.

Header parameters
api-version
string
Valid values[ "2026-01-01" ]
for-user-id
string

The sub-account user-id to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information.

with-split-rule
string

The XenPlatform split rule ID that will be applied to this transaction. This header is only used if you have access to xenPlatform.

Body parameters

JSON object containing recurring plan details.

Expand All
object
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.0
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.0
Maximum365.0
total_recurrence
integer | null

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

Minimum1.0
Maximum32000.0
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.0
Maximum365.0
total_retry
integer | null

Maximum number of retries for failed cycles.

Minimum1.0
Maximum10.0
failed_attempt_notifications
Array of integer

Notifications triggered at specific retry attempts.

Example[ 1, 3, 5 ]
integer
Minimum1.0
Maximum10.0
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.0
Maximum5.0
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", "FEES" ]
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
Responses
202

Successfully created a recurring plan. A webhook will follow to confirm plan activation.

Expand All
object
reference_id
string

Merchant-provided identifier for the recurring plan.

Min length1
Examplemy-plan-01
customer_id
string

Xendit-generated customer ID.

currency
string

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

ExampleIDR
amount
number

Amount to be charged in each recurring cycle.

Minimum0.0
schedule
object (Xendit_Subscriptions_API_RecurringScheduleCreate)
interval
string

Frequency of the recurring cycles.

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

Number of intervals between consecutive cycles.

Minimum1.0
Maximum365.0
total_recurrence
integer | null

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

Minimum1.0
Maximum32000.0
anchor_date
string (date-time)

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.0
Maximum365.0
total_retry
integer | null

Maximum number of retries for failed cycles.

Minimum1.0
Maximum10.0
failed_attempt_notifications
Array of integer

Notifications triggered at specific retry attempts.

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

ID for payment token.

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

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

Minimum1.0
Maximum5.0
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

Type of item.

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

Name of the item.

Min length1
Max length255
ExampleGranny Smith Apple
net_unit_amount
number

Net amount charged per unit. Negative values for discounts.

quantity
integer

Number of units of the item.

url
string | null

URL of the item, must be HTTPS or HTTP.

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

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
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

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
400

Validation errors occurred.

API_VALIDATION_ERROR

Fields or values in the payload body does not comply with our API specification.

{
  "error_code": "API_VALIDATION_ERROR",
  "message": "Check the specific error message for debugging."
}
INVALID_PAYMENT_TOKEN_ID

Payment token ID is not in eligible status for plan creation.

{
  "error_code": "INVALID_PAYMENT_TOKEN_ID",
  "message": "The payment_token_id provided has a mismatched currency or it is not \"ACTIVE\" because it has expired/ been unlinked/ linking has not been completed. Please retry with a valid payment_token_id."
}
object
error_code
string

Error code identifying the issue.

message
string

Description of the error.

401

Invalid API key or unauthorized access.

object
Example{ "error_code": "INVALID_API_KEY", "message": "API key format is invalid." }
error_code
string
message
string
403

Request forbidden error.

object
Example{ "error_code": "REQUEST_FORBIDDEN_ERROR", "message": "The request is forbidden." }
error_code
string
message
string
404

Resource not found.

CUSTOMER_NOT_FOUND

Customer not found.

{
  "error_code": "CUSTOMER_NOT_FOUND_ERROR",
  "message": "customer_id is invalid or not found. Please try again with a valid customer_id."
}
object
error_code
string
message
string
409

Idempotency error.

object
Example{ "error_code": "IDEMPOTENCY_ERROR", "message": "Idempotency key has been used before." }
error_code
string
message
string
500

Server error.

object
Example{ "error_code": "SERVER_ERROR", "message": "An unexpected error occurred. Our team has been notified and will troubleshoot the issue." }
error_code
string
message
string
503

Payment server error.

object
Example{ "error_code": "CHANNEL_UNAVAILABLE", "message": "The payment channel is currently unavailable. Please try again later." }
error_code
string
message
string
Callbacks
Post
/{merchant defined callback url}
Body parameters

Recurring plan webhook

Expand All
object

Recurring plan webhook to indentify status transition of plan

event
string

Webhook event names for recurring plan status updates.

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

Business ID of Xendit

Example62440e322008e87fb29c1fd0
created
string (date-time)

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

Example2021-12-31T23:59:59Z
data
object
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.0
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.0
Maximum365.0
total_recurrence
integer | null

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

Minimum1.0
Maximum32000.0
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.0
Maximum365.0
total_retry
integer | null

Maximum number of retries for failed cycles.

Minimum1.0
Maximum10.0
failed_attempt_notifications
Array of integer

Notifications triggered at specific retry attempts.

Example[ 1, 3, 5 ]
integer
Minimum1.0
Maximum10.0
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.0
Maximum5.0
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", "FEES" ]
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
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
Responses
200

OK