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

Simulate cycle payment

Prev Next
Post
/recurring/plans/{plan_id}/cycles/{id}/simulate

Simulate cycle payment only for test mode

Header parameters
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.

Path parameters
plan_id
stringRequired

The ID of the recurring plan associated with the cycle.

id
stringRequired

The ID of the recurring cycle.

Responses
200

Successfully simulate cycle payment

object
id
string

Xendit-generated recurring cycle ID.

plan_id
string

ID of the associated recurring plan.

status
string

Status of the recurring cycle.

Valid values[ "PENDING", "RETRYING", "FAILED", "SUCCEEDED" ]
amount
number

Amount charged in the cycle.

400

Validation errors occurred. Safe to retry.

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."
}
object
error_code
string

Error code identifying the issue.

message
string

Description of the error.

401

Invalid API key or unauthorized access. Safe to retry.

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

Ineligible request

INELIGIBLE_CYCLE_REQUEST

Request cannot be processed.

{
  "error_code": "INELIGIBLE_CYCLE_REQUEST",
  "message": "Requested changes to cycle cannot be processed. Only cycles in \"SCHEDULED\" status can be simulated"
}
object
error_code
string
message
string
404

Resource not found. Safe to retry.

DATA_NOT_FOUND

Customer not found.

{
  "error_code": "DATA_NOT_FOUND",
  "message": "Recurring cycle_id not found. Please check your query again."
}
object
error_code
string
message
string
415

Unsupported content type. Safe to retry.

object
Example{ "error_code": "UNSUPPORTED_CONTENT_TYPE", "message": "The content type requested is not supported." }
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