Skip to main content

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
    id string required
Request Body
    activate_type string required

    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.

    process_credit boolean

    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
  • Array [
  • billing_count number 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.

    recurring_billing_config string required
    • This is for the system to know the billing date of a cycle, once the cycle has started
    • If the user changes the recurring plan of a customer (upgrade/downgrade etc.), then the
    recurring_items object[] required
  • Array [
  • quantity number required
    recurring_item_id string required
  • ]
  • discount_amount number
    • if trial_period is TRUE, it means the total amount of billing amount for this recurring_cycles record will be 0.00
    discount_type string
    description string
    • Any description to remark about this record
  • ]
Responses

Response Headers

    Schema
      code integer required
      message string required
      data object required
      plan object required
      id string required
      name string
      reference_number string
      default_payment_token string
      default_collection_method string
      payment_retry_count number
      payment_retry_day_period number
      grace_period number nullable
      credit number
      description string nullable
      created_at string required
      updated_at string required
      deleted_at string nullable
      recurring_cycles object[] required
    • Array [
    • id string
      state string required
      recurring_plan_id string required
      billing_count integer
      billing_count_created integer required
      recurring_billing_config object required
      id string required
      billing_interval string required
      billing_type string
      billing_month integer
      billing_day_of_month integer
      billing_proration_enabled boolean required
      description string
      created_at string
      updated_at string
      deleted_at string nullable
      recurring_items object[] required
    • Array [
    • id string required
      label string
      price number required
      quantity integer required
      currency string required
      reference_id string
      description string
      created_at string required
      updated_at string
      deleted_at string nullable
    • ]
    • billing_amount number
      discount_amount number
      discount_type string
      previous_cycle string nullable
      next_cycle string nullable
      estimated_start_date string
      start_date string nullable
      estimated_end_date string nullable
      end_date string nullable
      next_execute_time string nullable
      description string nullable
      created_at string required
      updated_at string required
      deleted_at string nullable
    • ]
    • customer object
      name string
      email string
      phone string
      reference_number string required
      default_payment_method string
      uuid string required
      current_order object
      amount number
      paid_total number
      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
    Loading...