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”
  • Multiple recurring_cycle can be created with this API in succession
Header Parameters
    x-appid string
    Example: {{appid}}
    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 required

    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 required

    Single option choice: [charge_automatically] - automatically charge the customer provided card details

    payment_retry_count number required

    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

    payment_retry_day_period number required

    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.

    grace_period number

    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

    callback_url string
    description string

    Any description to remark about this record

    recurring_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

    recurring_items object[] required
  • Array [
  • quantity number required
    recurring_item_id string required
  • ]
  • discount_amount number
    discount_type string
    description string
  • ]
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
      credit number
      description string
      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 required
      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
      end_date string nullable
      next_execute_time string nullable
      description string
      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...