Skip to main content

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”
Header Parameters
    Nonce string required

    random 16 bytes alphanumerics

    Credential string required

    Please follow the OpenAPI authentication section

    Example: d900da8b-6e16-4a85-8a66-05d29ac53f24/20240501120123/Wonder-RSA-SHA256
    Signature string required

    Please follow the OpenAPI authentication section

    Example: lM42cgyuLS98Dieydc8K2OD3KwYkOXibpV9pFvr/R0i/830M/FPKUKbav2UBBN3M3EdPk/PpvKQlvBNT+NbEg20CKuiDTZWDc3r7KiA1pdZsui/57XCVhC2s01W8jEM+G5lS362+p8+E0K6UKQDrJMyVpbDT31XSkSJIxae+uDi2nJr4DnIkemeU2LlNDRPPGe9NeX7z3B3N3LwIiQgKMyauPqAjro0UrZykQM9pv4UySRSU2cT8EcjQmyKxbzyuR2A47PyeodJvotlIthdfCHIxG52D06tpRJlRVbUdvxSg14bFiPbr3FwCvruZlbR15gOanJCqE4wp4fC8qEXXsg==
    Content-type string required
    Example: application/json
    x-request-id string
    Example: d900da8b-6e16-4a85-8a66-05d29ac53f24
Request Body
    plan object required
    name string
    • This is name of the recurring plan (ex: Plan A)
    reference_number string
    • This field is to generate the reference number for the connecting orders created by the recurring plan
    • Every new order created under this recurring plan will have the same “reference number” with incremental suffix
    customer_uuid string required
    default_collection_method string
    default_payment_token string
    description string
    • Any description to remark about this record
    recurring_cycles object[] required
  • Array [
  • estimated_start_date string required
    estimated_end_date string
    recurring_items integer[] required
    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
    name string required
    • This is name of the cycle (ex: trial period/discounted period)
    description string
    • Any description to remark about this record
    interval_counts number
    • This is to count how long will the recurring cycle run for. For example if the recurring_billing_configs.billing_interval = monthly , with recurring_billing_configs.billing_interval_count = 1  , and interval_counts = 3 , then it means this recurring_cycles record will run for 3 months (with each invoice to be billed every 1 month)

    • For example if the recurring_billing_configs.billing_interval = monthly , with recurring_billing_configs.billing_interval_count = 6  , and interval_counts = 3 , then it means this recurring_cycles record will run for 18 months (with each invoice to be billed every 3 months)

    • If data is null, then consider this recurring_cycles record will run forerver. For example if the recurring_billing_configs.billing_interval = yearly , with recurring_billing_configs.billing_interval_count = 1  , and interval_counts = NULL , then it means this recurring_cycles record will run with no ending (with each invoice to be billed every 1 year)

    state string required
    • This is to determine the status of a particular subscription/recurring billing cycle. The difference between this status with general orders record is that it will have status specific to the current state of a recurring cycle.

    • Single option: [not_started], [started], [completed], [cancelled], [retrying_payment], [uncollectible]

    • [not_started] - it means that the cycle has not started, and do the billing

    • [started] - it means that the cycle has started, and do the billing

    • [completed] - it means that the cycle has completed

    • [cancelled] - (i) merchant/customer decides to end/cancel the subscription (ii) if the cycle is cancelled/unpaid for long time

    • [retrying_payment] - When the system is trying payments again after first initial payment has failed (only applicable for default_collection_method = charge_automatically ).

    • [uncollectible] - When the unpaid order of this cycle has reached its grace period grace_period

    • recurring_cycles.state = not_started (no recurring_orders record to be generated)

    • recurring_cycles.state = started equals recurring_orders.state = invoiced

    • recurring_cycles.state = started equals recurring_orders.state = async_pending

    • recurring_cycles.state = completed equals recurring_orders.state = completed

    • recurring_cycles.state = cancelled equals recurring_orders.state = voided

    • recurring_cycles.state = retrying_payment equals recurring_orders.state = invoiced

    • recurring_cycles.state = uncollectible equals recurring_orders.state = invoiced

    • recurring_cycles.state = uncollectible equals recurring_orders.state = voided

  • ]
Responses

Response Headers

    Schema
      code integer required
      message string required
      data object required
      plan object required
      id string required
      name string
      reference_number string
      customer_uuid string required
      p_business_id string required
      default_payment_token string
      default_collection_method string
      description string
      created_at string required
      updated_at string required
      deleted_at string
      recurring_cycles object[] required
    • Array [
    • id string
      name string required
      state string required
      p_business_id string required
      recurring_plan_id string required
      interval_counts integer
      recurring_billing_config object required
      id string required
      p_business_id string required
      billing_interval_counts integer required
      billing_interval string required
      billing_config_settings string required
      billing_month integer required
      billing_day_of_month integer required
      billing_proration_enabled boolean required
      description string required
      created_at string required
      updated_at string required
      deleted_at null required
      recurring_items object[] required
    • Array [
    • id string required
      label string
      p_business_id string required
      price number required
      quantity integer required
      currency string required
      reference_id string
      description string
      created_at string required
      updated_at string required
      deleted_at string
    • ]
    • billing_amount number required
      discount_amount number
      discount_type string
      default_payment_token string
      default_collection_method string
      payment_retry_day_period integer required
      payment_retry_count integer required
      grace_period integer
      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 required
      updated_at string required
      deleted_at string
    • ]
    • customer object required
      name string
      email string
      phone string
      reference_number string required
      default_payment_method string
      uuid string required
    Loading...