Uncategorized

VIEW Request

POST http://apisandbox.onepay.com/billing/plan

Automated billing API enable you to manage payment plans. For creating a recurring billing plan, user has the ability to choose at yearly, monthly, weekly and daily level.

Sample Code


{  
   "billing_plan":{  
      "customer_id":"1091913485057794",
      "token":"3221510895193335",
      "plan_type":"1",
      "schedule_type":"M",
      "start_date":"2019-04-14",
      "end_date":null,
      "periodicity":"2",
      "end_type":"3",
      "no_of_payments":2,
      "amount":"500",
      "reference_id":"7675656756",
      "max_retry":1,
      "name":"test",
      "active":true,
      "billing_mode":"0",
      "bill_Day":2
   },
   "bill_Sequence":[  
      {  
         "amount":"100",
         "Schedule_Date":"2019-02-03",
         "reference_id":"1",
         "sequence_number":"1"
      }
   ]
}

Body

KEY VALUE DESCRIPTION
billing_plan object Contains automated recurring billing information.
customer_id alphanumeric with special characters
(_,.,-,@) (50 characters)
The customer ID is either system generated or user specific. Based on customer ID, billing is processed for the customer.
token numeric (up to 16 digits) Billing can be process based on the token information provided in the request.
plan_type character(1)
1-recurring, 2- installment, 3 -one time schedule
The type of plan chosen for billing occurences.
1-recurring, 2- installment, 3 -one time schedule
schedule_type character(1) The type of scheduled payments chosen on daily, weekly, monthly and yearly basis.
DWMYS - daily, weekly, monthly, yearly, one time scheduled payment
start_date date in yyyy-MM-dd format The date when the payments start. Start date is always on or after "current day + 1"
end_date date in yyyy-MM-dd format The date when the payments end
periodicity numeric. (Conditional)
Depending on the plan type and schedule, the periodicity can be passed. It defines the interval between schedules.
The plan type should be either 1- Recurring or 2- Installment.
The schedule type should to be W- Weekly, M- Monthly or Y- Yearly.
Here, when the schedule type is W- Weekly, the periodicity can range from 1-10.
When the schedule type is M- Monthly, the periodicity can range from 1-11.
When the schedule type is W- Yearly, the periodicity can range from 1-5.
bill_day numeric. (Conditional)
Depending on the plan type and schedule, the Bill Day can be passed.
The plan type should be either 1- Recurring or 2- Installment.
The schedule type should to be W- Weekly, M- Monthly or Y- Yearly.
Here, when the schedule type is W- Weekly, the Bill Day can range from 1-28.
When the schedule type is M- Monthly, the Bill Day can range from 1-28.
When the schedule type is W- Yearly, the Bill Day can range from 1-7. 1- Sunday 2- Monday until 7 - Saturday
end_type numeric. 1,2,3
1- Until Cancelled
2- Until Certain number of payments
3- Until End Date
no_of_payments numeric (Conditional)
When the end_type is 3, this field is mandatory and needs to be specified.
amount decimal.
0 to 999,999,999. Do not use currency symbols.
(Mandatory)
The amount per occurrence/event of the bill.
reference_id string (Optional) Any internal ID/number that needs be used as a reference can be passed here
max_retry tinyint
0-10. Default 0.
Number of retry attempts if a transaction fails at the time of execution
name string (optional) Plan Name
active bit
0- Active 1-Inactive
(Mandatory)
Depending on the Active and Inactive status, the transaction will be executed for occurence for the day.
billing_mode 0- Manual, 1- Auto
If empty, it is defaulted to auto(1)
(Optional)
If this is set Manual, Billing sequence needs to be given for each event/occurence when the transaction should go through
bill_sequence object
Contains information of the Bill Sequence
If a billing plan has transactions sent manually, then the below are mandatory. For automatic bill payments, these fields are ignored
amount decimal.
0 to 999,999,999. Do not use currency symbols.
Amount for the specific occurrence of the bill
schedule_date date in yyyy-MM-dd format Date for the specific occurrence of the bill
reference_id string (Optional) Any internal ID/number that needs be used as a reference can be passed here
sequence_number numeric Event number or the sequence number to identify a particular occurrence in a recurring bill