Payment schedules for an invoice refer to a payment structure where the amount_due
on an invoice is divided into smaller, more manageable parts, each of which is paid over a specified period. Payment schedule scheme is a configuration or set of rules for creating payment schedules. After creating a payment schedule scheme, you can use it to generate payment schedules for multiple invoices.
Sample payment schedule scheme [ JSON ]
{
"id": "__dev__HvFwO7xUND2MBa3x",
"number_of_schedules": 3,
"period_unit": "month",
"period": 1,
"created_at": 1709371975,
"updated_at": 1709371975,
"resource_version": 1709371975988,
"object": "payment_schedule_scheme"
}
API Index URL GET
https://{site}.chargebee.com/api/v2/payment_schedule_schemes
Model Class
<chargebee>.PaymentScheduleScheme
string, max chars=40 An auto-generated unique identifier for the payment schedule scheme.
optional, string, max chars=100 The name of a payment schedule scheme.
optional, string, max chars=200 A brief description for this payment schedule scheme.
integer, min=1, max=52 Specifies the total number of payment schedules for the invoice. The maximum number_of_schedules
varies based on the period_unit
: - Day: Up to 30 schedules
- Week: Up to 52 schedules
- Month: Up to 12 schedules
enumerated string Defines the time unit for intervals between payment schedules. Possible values are: day, week, and month. Possible values are
dayWhen the time unit for intervals between payment schedules is set as dayweekWhen the time unit for intervals between payment schedules is set as weekmonthWhen the time unit for intervals between payment schedules is set as month
dayWhen the time unit for intervals between payment schedules is set as dayweekWhen the time unit for intervals between payment schedules is set as weekmonthWhen the time unit for intervals between payment schedules is set as month
Show all values[+]
optional, integer, min=1, max=30 The time period between the effective dates of two consecutive payment schedules, expressed in period_units. Use this parameter to have fixed intervals between payment schedules. The maximum period
varies based on the period_unit
: - Day: Up to 30 days
- Week: Up to 6 weeks
- Month: Up to 6 months
timestamp(UTC) in seconds The timestamp at which the payment_schedule_scheme
was created.
optional, long Version number of this resource. The resource_version
is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
optional, timestamp(UTC) in seconds Defines the timestamp when the config was last updated
string, max chars=40 An auto-generated unique identifier for the payment schedule scheme.
optional, string, max chars=100 The name of a payment schedule scheme.
optional, string, max chars=200 A brief description for this payment schedule scheme.
integer, min=1, max=52 Specifies the total number of payment schedules for the invoice. The maximum number_of_schedules
varies based on the period_unit
: - Day: Up to 30 schedules
- Week: Up to 52 schedules
- Month: Up to 12 schedules
enumerated string Defines the time unit for intervals between payment schedules. Possible values are: day, week, and month. Possible values are
dayWhen the time unit for intervals between payment schedules is set as dayweekWhen the time unit for intervals between payment schedules is set as weekmonthWhen the time unit for intervals between payment schedules is set as month
dayWhen the time unit for intervals between payment schedules is set as dayweekWhen the time unit for intervals between payment schedules is set as weekmonthWhen the time unit for intervals between payment schedules is set as month
Show all values[+]
optional, integer, min=1, max=30 The time period between the effective dates of two consecutive payment schedules, expressed in period_units. Use this parameter to have fixed intervals between payment schedules. The maximum period
varies based on the period_unit
: - Day: Up to 30 days
- Week: Up to 6 weeks
- Month: Up to 6 months
timestamp(UTC) in seconds The timestamp at which the payment_schedule_scheme
was created.
optional, long Version number of this resource. The resource_version
is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
optional, timestamp(UTC) in seconds Defines the timestamp when the config was last updated Creates a payment schedule scheme. After creating a payment schedule scheme, you can use it to generate payment schedules for multiple invoices.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Codes
import Chargebee from "chargebee";
const chargebee = new Chargebee({
site : "{site}",
apiKey : "{site_api_key}",
});
try {
const result = await chargebee.paymentScheduleScheme.create({
name : "Scheme2",
number_of_schedules : 3,
period_unit : "month",
period : 1
});
console.log(result);
const paymentScheduleScheme = result.payment_schedule_scheme;
} catch (err) {
console.log(err);
}
Create 3 payment schedules collected monthly
import Chargebee from "chargebee";
const chargebee = new Chargebee({
site : "{site}",
apiKey : "{site_api_key}",
});
try {
const result = await chargebee.paymentScheduleScheme.create({
name : "Scheme2",
number_of_schedules : 3,
period_unit : "month",
period : 1
});
console.log(result);
const paymentScheduleScheme = result.payment_schedule_scheme;
} catch (err) {
console.log(err);
}
Create 3 payment schedules collected monthly
import Chargebee from "chargebee";
const chargebee = new Chargebee({
site : "{site}",
apiKey : "{site_api_key}",
});
try {
const result = await chargebee.paymentScheduleScheme.create({
name : "Scheme2",
number_of_schedules : 3,
period_unit : "month",
period : 1
});
console.log(result);
const paymentScheduleScheme = result.payment_schedule_scheme;
} catch (err) {
console.log(err);
}
Sample Result [ JSON ]
Show more...
{
"payment_schedule_scheme": {
"id": "__dev__HvFwO7xUND2MBa3x",
"number_of_schedules": 3,
"period_unit": "month",
"period": 1,
"created_at": 1709371975,
"updated_at": 1709371975,
"resource_version": 1709371975988,
"object": "payment_schedule_scheme"
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/payment_schedule_schemes
Method
<chargebee>.paymentScheduleScheme.create({<param name> : <value>,<param name> : <value> ...})
required, integer, min=1, max=52 Specifies the total number of payment schedules for the invoice. The maximum number_of_schedules
varies based on the period_unit
: - Day: Up to 30 schedules
- Week: Up to 52 schedules
- Month: Up to 12 schedules
required, enumerated string Defines the time unit for intervals between payment schedules. Possible values are: day, week, and month. Possible values are
dayWhen the time unit for intervals between payment schedules is set as dayweekWhen the time unit for intervals between payment schedules is set as weekmonthWhen the time unit for intervals between payment schedules is set as month
dayWhen the time unit for intervals between payment schedules is set as dayweekWhen the time unit for intervals between payment schedules is set as weekmonthWhen the time unit for intervals between payment schedules is set as month
Show all values[+]
optional, integer, min=1, max=30 The time period between the effective dates of two consecutive payment schedules, expressed in period_units. Use this parameter to have fixed intervals between payment schedules. The maximum period
varies based on the period_unit
: - Day: Up to 30 days
- Week: Up to 6 weeks
- Month: Up to 6 months
required, string, max chars=100 The name of a payment schedule scheme.
optional, array Array containing object of parameters for flexible_schedules
Array containing object of parameters for flexible_schedules
pass parameters as flexible_schedules => [{"<param name>" => "<value>",...}, {..}...]
optional, integer, min=0, max=52 The interval after which this payment schedule should be collected. optional, bigdecimal, min=1, max=100 The percentage amount that this specific payment schedule should collect.
always returned required
Resource object representing payment_schedule_scheme
Sample admin console URL
https://{site}.chargebee.com/admin-console/payment_schedule_schemes/123x
This endpoint retrieves an existing payment schedule.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Codes
import Chargebee from "chargebee";
const chargebee = new Chargebee({
site : "{site}",
apiKey : "{site_api_key}",
});
try {
const result = await chargebee.paymentScheduleScheme.retrieve("__dev__HvFwO7xUND2MBa3x");
console.log(result);
const paymentScheduleScheme = result.payment_schedule_scheme;
} catch (err) {
console.log(err);
}
Retrieve a payment schedule scheme
import Chargebee from "chargebee";
const chargebee = new Chargebee({
site : "{site}",
apiKey : "{site_api_key}",
});
try {
const result = await chargebee.paymentScheduleScheme.retrieve("__dev__HvFwO7xUND2MBa3x");
console.log(result);
const paymentScheduleScheme = result.payment_schedule_scheme;
} catch (err) {
console.log(err);
}
Retrieve a payment schedule scheme
import Chargebee from "chargebee";
const chargebee = new Chargebee({
site : "{site}",
apiKey : "{site_api_key}",
});
try {
const result = await chargebee.paymentScheduleScheme.retrieve("__dev__HvFwO7xUND2MBa3x");
console.log(result);
const paymentScheduleScheme = result.payment_schedule_scheme;
} catch (err) {
console.log(err);
}
Sample Result [ JSON ]
Show more...
{
"payment_schedule_scheme": {
"id": "__dev__HvFwO7xUND2MBa3x",
"number_of_schedules": 3,
"period_unit": "month",
"period": 1,
"created_at": 1709371975,
"updated_at": 1709371975,
"resource_version": 1709371975988,
"object": "payment_schedule_scheme"
}
}
URL Format
GET
https://{site}.chargebee.com/api/v2/payment_schedule_schemes/{payment-schedule-scheme-id}
Method
<chargebee>.paymentScheduleScheme.retrieve(<payment_schedule_scheme_id>,{<param name> : <value>,<param name> : <value> ...})
always returned required
Resource object representing payment_schedule_scheme
Sample admin console URL
https://{site}.chargebee.com/admin-console/payment_schedule_schemes/123x
This endpoint deletes a payment schedules created for an invoice.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Codes
import Chargebee from "chargebee";
const chargebee = new Chargebee({
site : "{site}",
apiKey : "{site_api_key}",
});
try {
const result = await chargebee.paymentScheduleScheme.delete("__dev__HvFwO7xUND2MBa3x");
console.log(result);
const paymentScheduleScheme = result.payment_schedule_scheme;
} catch (err) {
console.log(err);
}
Delete a payment schedule scheme
import Chargebee from "chargebee";
const chargebee = new Chargebee({
site : "{site}",
apiKey : "{site_api_key}",
});
try {
const result = await chargebee.paymentScheduleScheme.delete("__dev__HvFwO7xUND2MBa3x");
console.log(result);
const paymentScheduleScheme = result.payment_schedule_scheme;
} catch (err) {
console.log(err);
}
Delete a payment schedule scheme
import Chargebee from "chargebee";
const chargebee = new Chargebee({
site : "{site}",
apiKey : "{site_api_key}",
});
try {
const result = await chargebee.paymentScheduleScheme.delete("__dev__HvFwO7xUND2MBa3x");
console.log(result);
const paymentScheduleScheme = result.payment_schedule_scheme;
} catch (err) {
console.log(err);
}
Sample Result [ JSON ]
Show more...
{
"payment_schedule_scheme": {
"id": "__dev__HvFwO7xUND2MBa3x",
"number_of_schedules": 3,
"period_unit": "month",
"period": 1,
"created_at": 1709371975,
"updated_at": 1709371975,
"resource_version": 1709371975988,
"object": "payment_schedule_scheme"
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/payment_schedule_schemes/{payment-schedule-scheme-id}/delete
Method
<chargebee>.paymentScheduleScheme.delete(<payment_schedule_scheme_id>,{<param name> : <value>,<param name> : <value> ...})
always returned required
Resource object representing payment_schedule_scheme
Sample admin console URL
https://{site}.chargebee.com/admin-console/payment_schedule_schemes/123x