Calculate Add Recurring Plan Cycles
- Only applicable for activate_type = immediate and process_credit = true
- The next_billing_amount of the first recurring_cycles is the total amount of the order to be generated, with discount and proration deduction alrerady included.
Path Parameters
Header Parameters
random 16 bytes alphanumerics
Please follow the OpenAPI authentication section
Please follow the OpenAPI authentication section
from zh-HK, zh-CN, or en
Request Body
Possible values: [immediate
, next_billing_date
, as_last_cycle
]
Immediate: The cycle to be added will start immediately and all previously-active recurring_cycles.state from the recurring plan will be updated to cancelled.
Next Billing Date: The cycle to be added will start on the next billing date of the current recurring cycle. The recurring_cycles.state will be updated to completed, and all the succession recurring_cycles.state of it will be updated to cancelled.
As Last Cycle: The cycle to be added will start once the current last recurring_cycles.state of recurring plan is changed to completed. If that recurring_cycles.billing_count and hence recurring_cycles.estimated_end_date are empty, the new cycle would not be added. If activate_type is not provided, the cycle would automatically be added as this value.
Only applicable for activate_type = immediate. By default, we will process the current recurring billing's remaining credit and add to/ subtract from recurring_plan.credit
cycles object[] required
- 200
Response Headers
Schema
data object required
{
"code": 0,
"message": "string",
"data": {
"plan": {
"id": "string",
"name": "string",
"reference_number": "string",
"default_payment_token": "string",
"default_collection_method": "string",
"payment_retry_count": 0,
"payment_retry_day_period": 0,
"grace_period": 0,
"credit": 0,
"description": "string",
"created_at": "string",
"updated_at": "string",
"deleted_at": "string",
"recurring_cycles": [
{
"id": "string",
"state": "string",
"recurring_plan_id": "string",
"billing_count": 0,
"billing_count_created": 0,
"recurring_billing_config": {
"id": "string",
"billing_interval": "string",
"billing_type": "string",
"billing_month": 0,
"billing_day_of_month": 0,
"billing_proration_enabled": true,
"description": "string",
"created_at": "string",
"updated_at": "string",
"deleted_at": "string"
},
"recurring_items": [
{
"id": "string",
"label": "string",
"price": 0,
"quantity": 0,
"currency": "string",
"reference_id": "string",
"description": "string",
"created_at": "string",
"updated_at": "string",
"deleted_at": "string"
}
],
"billing_amount": 0,
"discount_amount": 0,
"discount_type": "string",
"previous_cycle": "string",
"next_cycle": "string",
"estimated_start_date": "string",
"start_date": "string",
"estimated_end_date": "string",
"end_date": "string",
"next_execute_time": "string",
"description": "string",
"created_at": "string",
"updated_at": "string",
"deleted_at ": "string"
}
],
"customer": {
"name": "string",
"email": "string",
"phone": "string",
"reference_number": "string",
"default_payment_method": "string",
"uuid": "string"
},
"current_order": {
"amount": 0,
"paid_total": 0,
"currency": "string",
"order_number": "string",
"reference_number": "string",
"state": "string",
"correspondence_state": "string",
"auth_code": "string",
"default_payment_token": "string",
"default_collection_method": "string"
},
"current_payment_link": "string"
}
}
}
PUT /svc/payment/api/v1/openapi/recurring_payments/plan/:id/cycles/calculate
Request
Request
curl -L -X PUT 'https://developer.wonder.today/svc/payment/api/v1/openapi/recurring_payments/plan/:id/cycles/calculate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"activate_type": "immediate",
"process_credit": true,
"cycles": [
{
"billing_count": 0,
"recurring_billing_config": "string",
"recurring_items": [
{
"quantity": 0,
"recurring_item_id": "string"
}
],
"discount_amount": 0,
"discount_type": "string",
"description": "string"
}
]
}'
curl -L -X PUT 'https://developer.wonder.today/svc/payment/api/v1/openapi/recurring_payments/plan/:id/cycles/calculate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"activate_type": "immediate",
"process_credit": true,
"cycles": [
{
"billing_count": 0,
"recurring_billing_config": "string",
"recurring_items": [
{
"quantity": 0,
"recurring_item_id": "string"
}
],
"discount_amount": 0,
"discount_type": "string",
"description": "string"
}
]
}'
curl -L -X PUT 'https://developer.wonder.today/svc/payment/api/v1/openapi/recurring_payments/plan/:id/cycles/calculate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"activate_type": "immediate",
"process_credit": true,
"cycles": [
{
"billing_count": 0,
"recurring_billing_config": "string",
"recurring_items": [
{
"quantity": 0,
"recurring_item_id": "string"
}
],
"discount_amount": 0,
"discount_type": "string",
"description": "string"
}
]
}'
curl -L -X PUT 'https://developer.wonder.today/svc/payment/api/v1/openapi/recurring_payments/plan/:id/cycles/calculate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"activate_type": "immediate",
"process_credit": true,
"cycles": [
{
"billing_count": 0,
"recurring_billing_config": "string",
"recurring_items": [
{
"quantity": 0,
"recurring_item_id": "string"
}
],
"discount_amount": 0,
"discount_type": "string",
"description": "string"
}
]
}'
curl -L -X PUT 'https://developer.wonder.today/svc/payment/api/v1/openapi/recurring_payments/plan/:id/cycles/calculate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"activate_type": "immediate",
"process_credit": true,
"cycles": [
{
"billing_count": 0,
"recurring_billing_config": "string",
"recurring_items": [
{
"quantity": 0,
"recurring_item_id": "string"
}
],
"discount_amount": 0,
"discount_type": "string",
"description": "string"
}
]
}'
curl -L -X PUT 'https://developer.wonder.today/svc/payment/api/v1/openapi/recurring_payments/plan/:id/cycles/calculate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"activate_type": "immediate",
"process_credit": true,
"cycles": [
{
"billing_count": 0,
"recurring_billing_config": "string",
"recurring_items": [
{
"quantity": 0,
"recurring_item_id": "string"
}
],
"discount_amount": 0,
"discount_type": "string",
"description": "string"
}
]
}'
curl -L -X PUT 'https://developer.wonder.today/svc/payment/api/v1/openapi/recurring_payments/plan/:id/cycles/calculate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"activate_type": "immediate",
"process_credit": true,
"cycles": [
{
"billing_count": 0,
"recurring_billing_config": "string",
"recurring_items": [
{
"quantity": 0,
"recurring_item_id": "string"
}
],
"discount_amount": 0,
"discount_type": "string",
"description": "string"
}
]
}'
curl -L -X PUT 'https://developer.wonder.today/svc/payment/api/v1/openapi/recurring_payments/plan/:id/cycles/calculate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"activate_type": "immediate",
"process_credit": true,
"cycles": [
{
"billing_count": 0,
"recurring_billing_config": "string",
"recurring_items": [
{
"quantity": 0,
"recurring_item_id": "string"
}
],
"discount_amount": 0,
"discount_type": "string",
"description": "string"
}
]
}'
curl -L -X PUT 'https://developer.wonder.today/svc/payment/api/v1/openapi/recurring_payments/plan/:id/cycles/calculate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"activate_type": "immediate",
"process_credit": true,
"cycles": [
{
"billing_count": 0,
"recurring_billing_config": "string",
"recurring_items": [
{
"quantity": 0,
"recurring_item_id": "string"
}
],
"discount_amount": 0,
"discount_type": "string",
"description": "string"
}
]
}'