Create Recurring Plan
Use this interface to create a new recycling plan
- If there are identical reference_numbers when creating a recycling plan, you will be informed: “plan has been created”
- Multiple recurring_cycle can be created with this API in succession
Header Parameters
random 16 bytes alphanumerics
Please follow the OpenAPI authentication section
Please follow the OpenAPI authentication section
Request Body
- Every new order created under this recurring plan will have the same “reference number” with incremental suffix
- Array [
- Array [
- ]
- ]
plan object required
This is name of the recurring plan (ex: Plan A)
This field is to generate the reference number for the connecting orders created by the recurring plan
Single option choice: [charge_automatically] - automatically charge the customer provided card details
This is to set the limit how many attempts to be executed. Once the count limit has reached, then the system will change the status to recurring_cycles.state = uncollectible
Once the initial payment request attempt is unsuccessful, the system will wait until the next given period data specified in payment_retry_day_period (ex: 1 day). Once the specified day period has reached, then the system will pose another charge attempt to the recurring order.
This field is to count the day period that after the final attempt of payment charge is unsuccessful, then how many more days until the system will void the recurring_order record. Then change the status to recurring_cycles.state = uncollectible. If grace_period = NULL , then the system will never void the recurring_orders record
Any description to remark about this record
recurring_cycles object[] required
This is to count how long will the recurring cycle run for. If data is null, then consider this recurring_cycles record will run forerver.
This is for the system to know the billing date of a cycle, once the cycle has started
recurring_items object[] required
- 200
Response Headers
Schema
- Array [
- Array [
- ]
- ]
data object required
plan object required
recurring_cycles object[] required
recurring_billing_config object required
recurring_items object[] required
customer object
current_order object
{
"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"
}
}
}