Create Billing Schedules
Set up recurring billing schedules with flexible frequencies and automatic invoice generation
Create billing schedules to automate recurring invoice generation for subscriptions, contracts, and periodic billing. Configure billing frequencies from daily to annually, add line items that appear on each invoice, enable autopay for automatic payment collection, and let Payload handle the rest. Billing schedules eliminate manual invoice creation and ensure consistent billing cycles.
When you create a billing schedule, Payload automatically generates invoices based on the
recurring_schedule configuration. The first invoice is created on or after the start_date,
and subsequent invoices are generated on the scheduled billing days. Each invoice includes all
active items (billing items) that fall within their date ranges.
Prerequisites
Before creating billing schedules, ensure you have:
Understand schedules
Learn about billing schedule concepts, frequencies, and how they work.
Set up autopay
Configure automatic payment collection for generated invoices.
Creating Billing Schedules
Create schedules with different frequencies based on your billing needs.
Monthly subscription
Create recurring monthly invoices on a specific day of the month.
Monthly billing options:
- Date-based: Bill on specific day (1-31) each month
- Weekday-based: Bill on first/last Monday, Friday, etc.
# Bill on first Monday of each month
pl.BillingSchedule.create(
start_date="2024-01-01",
recurring_schedule={
"type": "monthly",
"monthly": {
"billing_weekday": 0, # 0=Monday, 6=Sunday
"billing_week": "first" # or "last"
}
}
)What happens when creating a schedule:
- Billing schedule is created with specified frequency
- First invoice is generated on or after
start_date - Subsequent invoices auto-generate on scheduled billing days
- Each invoice includes all active billing items
- If autopay enabled, payments processed automatically on due date
- Schedule tracks totals across all generated invoices
Schedule Start Date: The first invoice is generated on the first occurrence of the billing
day/schedule on or after the start_date. For example, if start_date is January 15th and
monthly billing_day is 1, the first invoice is generated on February 1st.
Billing Frequency Configuration
Configure different billing frequencies for various subscription models.
Daily Billing
Invoice generated every day starting from start_date:
pl.BillingSchedule.create(
start_date="2024-01-01",
recurring_schedule={
"type": "daily"
# No additional configuration needed
},
# ... payer, biller, items
)Use cases: Daily rentals, per-day services, usage-based billing
Weekly Billing
Invoice every 7 days on the same day of week as start_date:
recurring_schedule: {
type: "weekly"
// Bills on same weekday as start_date
}Use cases: Weekly subscriptions, recurring weekly services
Biweekly Billing
Invoice every 14 days starting from start_date:
recurring_schedule: {
type: "biweekly"
// Bills every two weeks from start_date
}Use cases: Bi-weekly payments, payroll-aligned billing
Bimonthly Billing
Invoice twice per month on specified days:
recurring_schedule: {
type: "bimonthly",
bimonthly: {
first_billing_day: 1, // 1st of month
second_billing_day: 15 // 15th of month
}
}Use cases: Semi-monthly billing, twice-per-month services
Bimonthly Default: If you don't specify billing days, they default based on the schedule creation date, maintaining a 14-day spacing.
Monthly Billing
Invoice once per month on a specific day or weekday:
// Date-based: Bill on 1st of each month
recurring_schedule: {
type: "monthly",
monthly: {
billing_day: 1 // 1-31
}
}
// Weekday-based: Bill on last Friday
recurring_schedule: {
type: "monthly",
monthly: {
billing_weekday: 4, // 0=Mon, 4=Fri
billing_week: "last" // "first" or "last"
}
}Use cases: Monthly subscriptions, monthly membership fees
Quarterly Billing
Invoice once per quarter with specific dates for each quarter:
recurring_schedule: {
type: "quarterly",
quarterly: {
q1: {
billing_month: 1, // January
billing_day: 31 // 31st
},
q2: {
billing_month: 4, // April
billing_day: 30 // 30th
},
q3: {
billing_month: 7, // July
billing_day: 31 // 31st
},
q4: {
billing_month: 10, // October
billing_day: 31 // 31st
}
}
}Use cases: Quarterly maintenance, seasonal billing, quarterly memberships
Annual Billing
Invoice once per year on a specific month and day:
recurring_schedule: {
type: "annually",
annually: {
billing_month: 1, // January (1-12)
billing_day: 1 // 1st (1-31)
}
}Use cases: Annual subscriptions, yearly licenses, annual memberships
Edge Cases: When billing day exceeds days in a month (e.g., 31st in February), the invoice is generated on the last day of that month. In leap years, February 29th is used when billing day is 29-31.
Adding Billing Items
Define the charges that appear on each generated invoice.
Billing Item Configuration
Single line item with fixed subscription fee.
items: [
{
type: "line_item",
description: "Pro Plan Subscription",
line_item: {
value: 49.99,
qty: 1
}
}
]When to use:
- Simple monthly or annual subscriptions
- Single service recurring fees
- Fixed-price memberships
Multiple line items including quantity-based pricing.
items: [
{
type: "line_item",
description: "Base Platform Fee",
line_item: {
value: 29.99,
qty: 1
}
},
{
type: "line_item",
description: "Premium Support",
line_item: {
value: 20.0,
qty: 1
}
},
{
type: "line_item",
description: "Additional Users",
line_item: {
value: 10.0, // Per user
qty: 5 // 5 users = $50.00
}
}
]When to use:
- Multi-component subscriptions
- Per-seat or per-user pricing
- Bundled services with separate line items
Line item calculated as a percentage of other charges.
{
type: "line_item",
description: "Processing Fee",
line_item: {
value: 3.0, // 3%
value_units: "percentage",
qty: 1
}
}When to use:
- Processing or service fees
- Tax calculations
- Variable charges based on invoice total
Line item that only appears on invoices during specific date ranges.
{
type: "line_item",
description: "Promotional Discount",
start_date: "2024-01-01", // Starts appearing on this date
end_date: "2024-03-31", // Stops appearing after this date
line_item: {
value: -10.00, // Negative for discount
qty: 1
}
}When to use:
- Limited-time promotions
- Trial period pricing
- Seasonal charges
- Temporary add-ons
Container for organizing multiple line items on invoices.
items: [
{
type: "item_group",
description: "Core Services",
item_group: {
items: [
{
type: "line_item",
description: "Platform Access",
line_item: { value: 29.99, qty: 1 }
},
{
type: "line_item",
description: "API Access",
line_item: { value: 15.0, qty: 1 }
}
]
}
},
{
type: "item_group",
description: "Add-Ons",
item_group: {
items: [
{
type: "line_item",
description: "Priority Support",
line_item: { value: 25.0, qty: 1 }
}
]
}
}
]When to use:
- Grouping related charges together
- Creating invoice sections (e.g., "Base Services", "Add-Ons", "Fees")
- Improving invoice readability and structure
Configuring Autopay
Enable automatic payment collection when invoices are generated.
Enable Autopay
pl.BillingSchedule.create(
start_date="2024-01-01",
autopay_settings={
"allowed": True # Enable automatic payment (default)
},
payer={
"account_id": "acct_customer123",
"method_id": "pm_card_456" # Optional: specific payment method
},
# ... rest of configuration
)Autopay behavior:
- Invoices automatically charged on due_date
- Requires payer to have valid payment method
- Failed payments leave invoice unpaid for retry/manual payment
- Successful payments transition invoice directly to paid status
Disable Autopay
autopay_settings: {
allowed: false // Require manual payment
}When to disable:
- Customer prefers manual payments
- Payment arrangements require approval
- Testing or development environments
- Invoice review before payment
Autopay Default: The autopay_settings.allowed field defaults to true. If you don't
specify it, autopay will be enabled automatically. Explicitly set to false if you want to
require manual payment.
Additional Configuration
Fine-tune your billing schedule with additional settings.
Tax Configuration
Apply tax to all invoices generated from the schedule:
pl.BillingSchedule.create(
default_tax_rate=8.5, # 8.5% tax rate
# ... rest of configuration
)Tax is automatically calculated and applied to taxable line items on each generated invoice.
Schedule Duration
Indefinite billing:
{
start_date: "2024-01-01",
end_date: null // or omit - continues indefinitely
}Fixed-term billing:
{
start_date: "2024-01-01",
end_date: "2024-12-31" // Stops after this date
}Use cases for end_date:
- Fixed-term contracts (1 year, 6 months, etc.)
- Trial periods with defined end
- Seasonal services
- Project-based billing
Descriptive Information
Add context to help identify and organize schedules:
{
description: "Enterprise Plan - Annual Contract",
attrs: {
contract_id: "CNT-2024-001",
sales_rep: "[email protected]",
customer_segment: "enterprise",
renewal_date: "2025-01-01"
}
}Custom Attributes: Use the attrs field to store any additional metadata about the
billing schedule. This is useful for integration with external systems, tracking, and
reporting purposes.
Schema Reference
Fields relevant to billing schedule creation:
BillingSchedule Creation Fields
descriptionstart_dateend_daterecurring_scheduleannuallybilling_day1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31billing_month1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12bimonthlyfirst_billing_day1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31second_billing_day1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31monthlybilling_day1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31billing_weekfirst, lastbilling_weekday0, 1, 2, 3, 4, 5, 6quarterlyq1billing_day1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31billing_month1, 2, 3q2billing_day1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31billing_month4, 5, 6q3billing_day1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31billing_month7, 8, 9q4billing_day1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31billing_month10, 11, 12typedaily, weekly, biweekly, bimonthly, monthly, quarterly, annuallyautopay_settingsalloweddefault_tax_ratepayeraccountAccountaccount_id ID of Account^acct_[A-Za-z0-9]+$payer[account]=nullmethodPaymentMethodmethod_id ID of PaymentMethod^pm_[A-Za-z0-9]+$billeraccountAccountaccount_id ID of Account^acct_[A-Za-z0-9]+$biller[account]=nullmethodPaymentMethodmethod_id ID of PaymentMethod^pm_[A-Za-z0-9]+$BillingItem Creation Fields
typeline_item, item_groupdescriptionstart_dateend_dateline_itemtype=line_itemqtytotalvaluevalue_unitspercentage, numberitem_grouptype=item_groupitemsBillingItemNext Steps
Manage your billing schedules and automate payment workflows
Manage Billing Schedules
Modify and maintain schedules with Update Billing Schedules to change frequencies and billing items, track invoice lifecycle with Invoice Statuses to monitor generated invoices and payment status, and attach supporting documents with Invoice Attachments for receipts and documentation.
Configure Payment Collection
Enable automatic payments with Automatic Payments to charge customers on invoice due dates, process manual payments with Payment API for programmatic invoice payment processing, and send payment requests with Payment Requests to share payment links via email or SMS.
Monitor and Analyze
Automate workflows with Webhook Events to receive real-time invoice generation notifications, track subscription metrics with Reporting Overview for MRR, ARR, and churn analysis, and analyze payment data with Transaction Reports for detailed financial reporting.
Related articles
- Billing Schedules Overview - Understand billing schedule concepts
- Update Billing Schedules - Manage schedule lifecycle
- Automatic Payments - Configure autopay settings
- Creating Invoices - Understand invoice structure
- Invoice Statuses - Track invoice lifecycle
- Billing Schedules API Reference - Complete API documentation