Create a billing config

Create a recycling plan configuration

Create a billing config

POST /svc/payment/api/v1/openapi/recurring_payments/billing_configs

Create a recycling plan configuration

Request

  • application/json

Body

config objectrequired

interval_count numberrequired

The number of intervals between recurring billings. For example, billing_interval=monthly and interval_count=3 , then system bills every 3 months.

If billing_interval=monthly and interval_count=1 , then system bills every 1 month.

If billing_interval=yearly and interval_count=1 , then system bills every 1 year.

billing_interval stringrequired

The frequency at which a recurring invoice is billed to the customer. Single option choice: [daily], [weekly], [monthly], [yearly] [daily] - The invoice will be billed on daily basis [weekly] - The invoice will be billed on weekly basis [monthly] - The invoice will be billed on monthly basis [yearly] - The invoice will be billed on annually basis

billing_type stringrequired

This is to determine if the system will apply automated billing date/time based on the current date/time of when the user subscribes to the recurring plan. Single option choice: [automated], [customized] [automated]: the system will select the current calendar date/time to be the start date of the recurring billing cycle. [customized]: if user chooses this option, depending on which data is set in  billing_interval , they will need to configure  billing_month ;  billing_day_of_month  . This option is only applicable for when billing_interval = monthly/yearly .

Possible values: [automated, customized]

billing_month number

The data is as below:

  • 1 = January
  • 2 = February
  • 3 = March
  • 4 = April
  • 5 = May
  • 6 = June
  • 7 = July
  • 8 = August
  • 9 = September
  • 10 = October
  • 11 = November
  • 12 = December

billing_day_of_month number

The data is as below:

  • 1 = 1st of that month
  • 2 = 2nd of that month
  • 3 = 3rd of that month
  • 4 = 4th of that month
  • 5 = 5th of that month
  • 6 = 6th of that month
  • 7 = 7th of that month
  • 8 = 8th of that month
  • 9 = 9th of that month
  • 10 = 10th of that month
  • 11 = 11th of that month
  • 12 = 12th of that month
  • 13 = 13th of that month
  • 14 = 14th of that month
  • 15 = 15th of that month
  • 16 = 16th of that month
  • 17 = 17th of that month
  • 18 = 18th of that month
  • 19 = 19th of that month
  • 20 = 20th of that month
  • 21 = 21st of that month
  • 22 = 22nd of that month
  • 23 = 23rd of that month
  • 24 = 24th of that month
  • 25 = 25th of that month
  • 26 = 26th of that month
  • 27 = 27th of that month
  • 28 = 28th of that month
  • 29 = 29th of that month
  • 30 = 30th of that month
  • 31 = 31st of that month (if there is no 31st in a month, then automatically default to 30th/29th/28th respecitvely)

billing_proration_enabled booleanrequired

This data field is let the system knows if needs to calculate prorated amount, if the customer is entering a recurring cycle that is not a full cycle period. For example, user starts the subscription on 1st April 2024, but the billing cycle is billing_interval= monthly and interval_count = 1 , and also  billing_day_of_month= 31 . If  billing_proration_enabled= False, then the system will calculate the payment to be paid from 31st March 2024 - 30th April 2024 (since there is no 31st April). The billing amount will be full amount expected to be paid in that cycle. The system will issue a billing invoice for customer to pay for recurring period of 1st April 2024 - 30th April 2024. The invoice’s billing start date will be 1st April 2024 00:00:00, and this should consider as one count for recurring_cycles.billing_count

description string

Responses

  • 200

Response Headers

  • application/json

  • Schema

  • Example (auto)

Schema

code integerrequired

message stringrequired

data objectrequired

config objectrequired

id stringrequired

interval_count integer

billing_interval stringrequired

billing_type stringrequired

billing_month integer

billing_day_of_month integer

billing_proration_enabled boolean

description string

created_at stringrequired

updated_at stringrequired

deleted_at stringnullable

{ "code": 0, "message": "string", "data": { "config": { "id": "string", "interval_count": 0, "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" } } }
  • csharp

  • curl

  • dart

  • go

  • http

  • java

  • javascript

  • kotlin

  • c

  • nodejs

  • objective-c

  • ocaml

  • php

  • powershell

  • python

  • r

  • ruby

  • rust

  • shell

  • swift

  • HTTPCLIENT

  • RESTSHARP

var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://developer.wonder.today/svc/payment/api/v1/openapi/recurring_payments/billing_configs"); request.Headers.Add("Accept", "application/json"); var content = new StringContent("{\n \"config\": {\n \"interval_count\": 0,\n \"billing_interval\": \"string\",\n \"billing_type\": \"automated\",\n \"billing_month\": 0,\n \"billing_day_of_month\": 0,\n \"billing_proration_enabled\": true,\n \"description\": \"string\"\n }\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync());

Request Collapse all

Body

{ "config": { "interval_count": 0, "billing_interval": "string", "billing_type": "automated", "billing_month": 0, "billing_day_of_month": 0, "billing_proration_enabled": true, "description": "string" } }