Bill
Overview

Billing Schedules Overview

Automate recurring billing with flexible scheduling and automatic invoice generation


Billing schedules automate recurring invoice generation for subscriptions, contracts, and periodic billing. Set up schedules with flexible frequencies from daily to annually, configure autopay for automatic payment collection, and define line items that appear on every invoice. Billing schedules eliminate manual invoice creation, ensure consistent billing cycles, and provide customers with predictable payment schedules.

Common Use Cases

  • Subscription Services - Monthly SaaS, annual licenses, tiered memberships, usage-based billing
  • Contracts and Agreements - Quarterly maintenance, annual service agreements, retainer billing
  • Recurring Services - Weekly/biweekly charges, monthly rentals, daily equipment rentals
  • Membership and Clubs - Gym memberships, annual club dues, quarterly fees, weekly classes

Prerequisites

Before creating billing schedules, ensure you have:


Understanding Billing Schedules


Billing schedules define when and how often to automatically generate invoices.

Recurring Schedule

Defines billing frequency including daily, weekly, biweekly, bimonthly, monthly, quarterly, and annually. Each frequency specifies exact billing days or months based on the schedule type, controlling when automatic invoice generation occurs for predictable billing cycles.

Billing Items

Line items that appear on every generated invoice with value, quantity, and description. Items can have start and end dates for time-limited charges, and can be grouped for better invoice organization and structured billing presentation.

Schedule Dates

The start_date defines when billing begins and the first invoice is generated, while end_date optionally specifies when billing stops (leave empty for indefinite billing). Items can have independent start and end dates within the schedule for flexible charge timing.

Autopay Settings

The autopay_settings.allowed field controls automatic payment and defaults to true. When enabled, invoices are automatically charged on their due date, requiring the payer to have a payment method configured for seamless payment collection.

Financial Tracking

Track schedule performance with totals.recurring_amount showing the amount charged each billing cycle, totals.total for lifetime total across all generated invoices, totals.paid for total amount successfully paid, and totals.balance_due for outstanding unpaid balance.

Billing Frequencies

FrequencyBilling CycleConfigurationExample
DailyEvery dayNo additional configuration requiredDaily rental or usage-based billing
WeeklyEvery 7 daysBills on same day of week as start_dateMonday start_date bills every Monday
BiweeklyEvery 14 daysBills every two weeks on same day as start_datePayroll-aligned billing
BimonthlyTwice per monthRequires first_billing_day and second_billing_day (1-31)1st and 15th of each month
MonthlyOnce per monthRequires billing_day (1-31) OR billing_weekday + billing_week1st of month or first Monday of month
QuarterlyOnce per quarterRequires config for all quarters (q1-q4) with billing_month/dayMarch 31, June 30, Sept 30, Dec 31
AnnuallyOnce per yearRequires billing_month (1-12) and billing_day (1-31)January 1st or December 31st each year

Billing Items


Billing items define the charges that appear on each generated invoice.

Billing Item Types

Basic line item with fixed price and quantity.

{
    type: "line_item",
    description: "Pro Plan Subscription",
    line_item: {
        value: 49.99,
        qty: 1
    }
}

When to use:

  • Fixed monthly or annual subscription fees
  • One-time service charges
  • Standard recurring fees

Line item with per-unit pricing and variable quantity.

{
    type: "line_item",
    description: "User Licenses",
    line_item: {
        value: 10.00,  // Per user
        qty: 5         // 5 users = $50.00 total
    }
}

When to use:

  • Per-seat or per-user pricing
  • Volume-based charges
  • Usage-based billing with unit pricing

Line item calculated as a percentage of other charges.

{
    type: "line_item",
    description: "Processing Fee",
    line_item: {
        value: 2.5,           // 2.5%
        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: "Holiday Promotion Discount",
    start_date: "2024-12-01",
    end_date: "2024-12-31",
    line_item: {
        value: -10.00,  // Negative for discount
        qty: 1
    }
}

When to use:

  • Promotional discounts with expiration dates
  • Seasonal charges or temporary fees
  • Trial period pricing
  • Limited-time add-ons

Container for organizing multiple line items on invoices.

{
    type: "item_group",
    description: "Base Services",
    item_group: {
        items: [
            {
                type: "line_item",
                description: "Platform Access",
                line_item: { value: 29.99, qty: 1 }
            },
            {
                type: "line_item",
                description: "Support",
                line_item: { value: 10.00, qty: 1 }
            }
        ]
    }
}

When to use:

  • Grouping related charges together
  • Creating invoice sections
  • Organizing complex billing structures
  • Improving invoice readability

Managing Billing Items

Add a new billing item to an existing schedule.

item = pl.BillingItem.create(
    billing_schedule_id="bscd_abc123",
    type="line_item",
    description="Additional Feature",
    start_date="2024-03-01",  # Starts in future
    line_item={
        "value": 15.0,
        "qty": 1
    }
)

When to add items:

  • Adding new features or services to existing subscription
  • Introducing upsells or add-ons
  • Creating time-limited promotional charges
  • Expanding service offerings mid-contract

Update pricing or configuration for an existing billing item.

item = pl.BillingItem.get("bcrg_abc123")
item.update(
    line_item={
        "value": 59.99,  # New price
        "qty": 1
    }
)

When to update items:

  • Changing subscription pricing
  • Adjusting quantity for per-seat billing
  • Modifying item descriptions
  • Updating date ranges for time-limited items

Remove a billing item from future invoices by setting an end date or deleting immediately.

# Set end_date to stop including in future invoices
item = pl.BillingItem.get("bcrg_abc123")
item.update(
    end_date="2024-12-31"
)
 
# Or delete immediately
item_to_delete = pl.BillingItem.get("bcrg_abc123")
item_to_delete.delete()

When to remove items:

  • Cancelling add-on services
  • Ending promotional pricing
  • Removing deprecated features
  • Customer downgrades or plan changes

How Billing Schedules Work


Understand the complete workflow of billing schedules.

Invoice Generation Process

Schedule Creation

Define billing frequency and schedule configuration, add billing items (line items that appear on each invoice), set start_date and optional end_date, and configure autopay settings for automatic payment collection.

Automatic Invoice Generation

First invoice is created on or after start_date according to the configured schedule. Subsequent invoices are generated automatically on billing days, with each invoice including all active billing items (those within their date ranges). Invoice due_date is calculated based on biller settings.

Payment Collection

If autopay is enabled, payment is automatically processed on the invoice due_date. If autopay is disabled, customers pay invoices manually via payment links or API. Payment allocations update schedule totals automatically as payments are received.

Schedule Tracking

Monitor schedule performance with totals.recurring_amount showing per-cycle charge, totals.total tracking lifetime billing across all invoices, totals.paid tracking total payments received, and totals.balance_due showing outstanding unpaid amount.

Schedule Termination

Setting an end_date stops future invoice generation while existing invoices remain and must be paid separately. The schedule maintains a complete history of all generated invoices for reporting and reconciliation.

Schema Reference


Fields relevant to billing schedule configuration:

BillingSchedule Fields

id
stringRead-only
Unique identifier for the resource. Automatically generated upon creation and cannot be modified. (ID prefix: bscd)
Pattern: ^bscd_[A-Za-z0-9]+$
description
string
Optional text description of this billing schedule. Use this to provide context about what the schedule is for, such as "Monthly subscription for Premium Plan" or "Quarterly maintenance billing". Helpful for identifying and organizing billing schedules, especially when managing multiple schedules for a customer.
Max length: 128
start_date
string (date)
The date when this billing schedule becomes active and begins generating invoices. Invoices will not be created before this date. For recurring schedules, this determines when the first billing cycle starts. Use this to schedule billing to begin at a future date or to align with contract start dates.
end_date
string (date)
The date when this billing schedule expires and stops generating invoices. After this date, no new invoices will be created automatically. Leave empty for indefinite billing schedules. Use this to limit billing to a specific period, such as for fixed-term contracts or trial periods.
recurring_schedule
object
Defines when and how often invoices are automatically generated from this billing schedule. The type determines the billing frequency, and additional fields specify the exact timing (day of month, day of week, etc.) based on the chosen frequency. Essential for subscription and recurring payment scenarios. Frequencies like daily, weekly, and biweekly use simple intervals, while monthly, quarterly, and annually allow precise date control.
annually
object
Configuration for annual billing. Specifies the exact month and day each year when the invoice will be generated (e.g., January 1 or December 31). Required when type is "annually". Hidden for other billing frequencies.
billing_day
enum[integer (int64)]
The day of the month (1-31) on which billing will occur each year. For example, if set to 15, invoices will be generated on the 15th of the specified billing_month. If the day exceeds the days in the selected month (e.g., 31st in February), billing occurs on the last day of that month. Required for annual billing.
Values: 1, 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, 31
billing_month
enum[integer (int64)]
The month of the year (1-12) on which billing will occur, where 1=January, 2=February, etc. Combined with billing_day to specify the exact date each year when invoices will be generated (e.g., January 1, December 31). Required for annual billing.
Values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
bimonthly
object
Configuration for bimonthly billing. Specifies the two days of each month on which invoices will be generated (e.g., 1st and 15th). Required when type is "bimonthly". Hidden for other billing frequencies.
first_billing_day
enum[integer (int64)]
The first day of the month (1-31) on which billing will occur for bimonthly schedules. For example, if set to 1, invoices will be generated on the 1st of each month. Must be different from second_billing_day. If the day exceeds the days in a month (e.g., 31st in February), billing occurs on the last day of that month. Required for bimonthly billing.
Values: 1, 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, 31
second_billing_day
enum[integer (int64)]
The second day of the month (1-31) on which billing will occur for bimonthly schedules. For example, if set to 15, invoices will be generated on the 15th of each month. Must be different from first_billing_day. If the day exceeds the days in a month, billing occurs on the last day of that month. Required for bimonthly billing.
Values: 1, 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, 31
monthly
object
Configuration for monthly billing. Specifies the day of the month, or day of the week, on which invoices will be generated each month (e.g., 1st of the month, or last Friday). Required when type is "monthly". Hidden for other billing frequencies.
billing_day
enum[integer (int64)]
The specific day of the month (1-31) on which billing will occur for monthly schedules. For example, if set to 1, invoices will be generated on the 1st of each month. If the day exceeds the days in a month (e.g., 31st in February), billing occurs on the last day of that month. Use this for date-based monthly billing. Mutually exclusive with billing_weekday and billing_week (use one or the other, not both).
Values: 1, 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, 31
billing_week
enum[string]
Specifies which occurrence of the billing_weekday to use: "first" (first occurrence in the month) or "last" (last occurrence in the month). For example, billing_weekday=0 (Monday) and billing_week="first" means billing occurs on the first Monday of each month. Must be used with billing_weekday. Not applicable when using billing_day.
Values: first, last
billing_weekday
enum[integer (int64)]
The day of the week (0-6) on which billing will occur for monthly schedules, where 0 is Monday and 6 is Sunday. Used in combination with billing_week to specify patterns like "first Monday" or "last Friday" of each month. Use this for weekday-based monthly billing. Mutually exclusive with billing_day.
Values: 0, 1, 2, 3, 4, 5, 6
quarterly
object
Configuration for quarterly billing. Specifies the exact month and day within each quarter when invoices will be generated (e.g., January 15, April 15, July 15, October 15). Required when type is "quarterly". Hidden for other billing frequencies.
q1
object
Billing schedule for the first quarter (January-March). Specifies the exact month and day.
billing_day
enum[integer (int64)]
The day of the month (1-31) on which billing will occur in Q1. If the day exceeds the days in the selected month, billing occurs on the last day of that month.
Values: 1, 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, 31
billing_month
enum[integer (int64)]
The month within Q1 (1-3) on which billing will occur, where 1=January, 2=February, 3=March. Determines which month of the first quarter to generate invoices.
Values: 1, 2, 3
q2
object
Billing schedule for the second quarter (April-June). Specifies the exact month and day.
billing_day
enum[integer (int64)]
The day of the month (1-31) on which billing will occur in Q2. If the day exceeds the days in the selected month, billing occurs on the last day of that month.
Values: 1, 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, 31
billing_month
enum[integer (int64)]
The month within Q2 (4-6) on which billing will occur, where 4=April, 5=May, 6=June. Determines which month of the second quarter to generate invoices.
Values: 4, 5, 6
q3
object
Billing schedule for the third quarter (July-September). Specifies the exact month and day.
billing_day
enum[integer (int64)]
The day of the month (1-31) on which billing will occur in Q3. If the day exceeds the days in the selected month, billing occurs on the last day of that month.
Values: 1, 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, 31
billing_month
enum[integer (int64)]
The month within Q3 (7-9) on which billing will occur, where 7=July, 8=August, 9=September. Determines which month of the third quarter to generate invoices.
Values: 7, 8, 9
q4
object
Billing schedule for the fourth quarter (October-December). Specifies the exact month and day.
billing_day
enum[integer (int64)]
The day of the month (1-31) on which billing will occur in Q4. If the day exceeds the days in the selected month, billing occurs on the last day of that month.
Values: 1, 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, 31
billing_month
enum[integer (int64)]
The month within Q4 (10-12) on which billing will occur, where 10=October, 11=November, 12=December. Determines which month of the fourth quarter to generate invoices.
Values: 10, 11, 12
type
enum[string]
The frequency at which invoices will be generated and the payer will be billed. Possible values: "daily" (every day), "weekly" (every week), "biweekly" (every two weeks), "bimonthly" (twice per month), "monthly" (once per month), "quarterly" (once per quarter), or "annually" (once per year). Determines which additional scheduling fields are required.
Values: daily, weekly, biweekly, bimonthly, monthly, quarterly, annually
autopay_settings
object
Configuration for automatic payment behavior on this billing schedule. Controls whether invoices generated from this schedule will automatically charge the payer's payment method, or if manual payment is required. Essential for subscription and recurring billing scenarios.
allowed
boolean
Controls whether automatic payments are allowed for this billing schedule. When set to true, invoices will be automatically charged to the payer's payment method when due. When false, invoices must be paid manually. This provides control over whether the payer has opted into autopay for recurring billing.
default_tax_rate
number (double)
The default tax rate (as a percentage) to apply to taxable items on invoices generated from this billing schedule. For example, 8.5 represents an 8.5% tax rate. This rate is applied automatically to line items unless overridden at the item level. Used for calculating the tax portion of invoice totals.
totals
object
Financial summary of this billing schedule, including total amounts due, paid, and outstanding. All fields are read-only and automatically calculated based on the invoices and payments associated with this schedule. Provides a quick overview of the billing schedule's financial status and payment history.
balance_due
number (double)Read-only
The remaining unpaid balance across all invoices from this billing schedule (total - paid). Read-only field that represents the outstanding amount the payer still owes. When this reaches zero, all invoices have been fully paid.
paid
number (double)Read-only
The total amount that has been successfully paid across all invoices from this billing schedule. Read-only field that updates as payments are received. Use this to track total revenue collected from this schedule.
recurring_amount
number (double)Read-only
The amount that will be charged on each recurring billing cycle. This is the sum of all recurring line items and represents the expected charge for each billing period. Read-only field useful for understanding the periodic cost of this subscription or recurring billing arrangement.
total
number (double)Read-only
The total amount due across all invoices generated from this billing schedule. This is the sum of all charges, including tax. Read-only field that updates as invoices are generated. Represents the lifetime billing amount for this schedule.
payer
object
Information about the customer who will be charged according to this billing schedule. Includes the payer account and optionally the specific payment method to use for autopay. The payer receives invoices and is responsible for payment.
accountAccount
object
The expanded payer account object. When included, this provides full account details for the customer who will be charged according to this billing schedule.
Visibility: explicit
account_id ID of Account
string
The unique identifier of the account that will be charged for this billing schedule. This is the payer who will receive invoices and from whom payments will be collected. Required if payer account is not provided inline. (ID prefix: acct)
Pattern: ^acct_[A-Za-z0-9]+$
Required if:
payer[account]=null
object
The expanded payment method object for autopay. When included, this shows the specific payment method (card, bank account, etc.) that will be charged automatically if autopay is enabled.
Visibility: explicit
method_id ID of PaymentMethod
string
The unique identifier of the payment method to use for automatic payments. If specified, this payment method will be charged when autopay is enabled. If not set, the account's default payment method will be used. Must belong to the payer account. (ID prefix: pm)
Pattern: ^pm_[A-Za-z0-9]+$
biller
object
Information about the merchant or service provider who will receive payments from this billing schedule. Includes the biller account and optionally the specific payment method for receiving funds. The biller issues invoices and receives payments from the payer.
accountAccount
object
The expanded biller account object. When included, this provides full account details for the merchant or service provider who will receive payments from this billing schedule.
Visibility: explicit
account_id ID of Account
string
The unique identifier of the processing account that will receive payments from this billing schedule. This is the merchant or service provider being paid. If not specified, the system will attempt to select an applicable biller account automatically. Required if biller account is not provided inline. (ID prefix: acct)
Pattern: ^acct_[A-Za-z0-9]+$
Required if:
biller[account]=null
object
The expanded payment method object for funding. When included, this shows where the funds from this billing schedule will be deposited (the merchant's bank account or payment destination).
Visibility: explicit
method_id ID of PaymentMethod
string
The unique identifier of the payment method where funds will be deposited. If specified, payments from this schedule will be sent to this payment method. If not set, the biller account's default funding method will be used. Must belong to the biller account. (ID prefix: pm)
Pattern: ^pm_[A-Za-z0-9]+$

BillingItem Fields

id
stringRead-only
Unique identifier for the resource. Automatically generated upon creation and cannot be modified. (ID prefix: bcrg)
Pattern: ^bcrg_[A-Za-z0-9]+$
billing_schedule_id ID of BillingSchedule
string
The unique identifier of the billing schedule that this item belongs to. Links the item to its parent billing schedule, which determines when and how often this item will be billed. (ID prefix: bscd)
Pattern: ^bscd_[A-Za-z0-9]+$
type
enum[string]
The type of billing item. Must be either "line_item" (a single charge with amount and quantity) or "item_group" (a container for grouping multiple line items together). The type determines which fields are required and how the item is structured.
Values: line_item, item_group
description
string
Text description of this billing item. This appears on invoices and helps identify what the charge is for. Examples include "Monthly subscription fee", "Setup charge", "Usage overage", or "Product: Widget Pro". Clear descriptions help customers understand their invoices and reduce payment disputes.
Max length: 128
start_date
string (date)
The date when this billing item becomes active and starts appearing on generated invoices. Items will not be included in invoices created before this date. Use this to schedule charges to begin at a future date, such as when a service starts or a product is delivered. Useful for pro-rated billing or time-limited charges.
end_date
string (date)
The date when this billing item expires and stops appearing on generated invoices. After this date, the item will no longer be included in new invoices. Leave empty for indefinite charges. Use this for time-limited charges like promotional pricing, temporary fees, or service periods with defined end dates.
line_item
object
Detailed pricing information for a line item charge. Required when type is "line_item". Contains the unit value, quantity, and automatically calculated total. Use this for individual charges on a billing schedule, such as product prices, service fees, or usage charges. Hidden when type is not "line_item".
Required if:
type=line_item
qty
number (double)
The quantity or number of units for this line item. Multiplied by the value to calculate the total charge. For example, if value is 10.00 and qty is 3, the total would be 30.00. Defaults to 1 if not specified.
total
number (double)Read-only
The calculated total amount for this line item (value * qty), rounded to 2 decimal places. This field is read-only and automatically computed. Represents the final charge that will be applied to the invoice for this line item.
value
number (double)
The unit amount or rate for this line item. If value_units is "number", this is the price per unit. If value_units is "percentage", this is the percentage rate (e.g., 5.5 for 5.5%). The total charge is calculated as value * qty.
value_units
enum[string]
Specifies how the value should be interpreted. Set to "number" for fixed amounts (e.g., $10.00 per item) or "percentage" for percentage-based charges (e.g., 5% of a base amount). Determines how the line item total is calculated.
Values: percentage, number
item_group
object
Container for grouping multiple related line items together. Required when type is "item_group". Use item groups to organize charges on invoices for better readability and structure, such as grouping all products, services, or fees into separate sections. Hidden when type is not "item_group".
Required if:
type=item_group
array
List of line items that belong to this item group. Each item in this list must have type "line_item" and will be nested under this group for organizational purposes. Expanded by default when retrieving the item group. Use this to organize related charges together on an invoice (e.g., grouping all shipping charges or all product line items).

Next Steps

Enhance your recurring billing with automated schedules and payment workflows


Set Up Billing Schedules

Create and manage recurring billing with Create Billing Schedules to set up new recurring billing with flexible frequencies, modify existing schedules with Update Billing Schedules to change frequencies and billing items, and understand invoice generation with Creating Invoices for generated invoice structure and configuration.

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.

Track Schedule Performance

Monitor invoice lifecycle with Invoice Statuses to track generated invoice payment status, automate post-invoice workflows with Webhook Events for real-time billing notifications, and analyze revenue metrics with Reporting Overview to track MRR, ARR, and churn.


Related articles