Bill
Updating Schedules

Update Billing Schedules

Manage existing billing schedules, modify frequencies, update items, and control schedule lifecycle


Update billing schedules to adapt to changing subscription needs, customer requirements, and business conditions. Change billing frequencies, add or remove billing items, configure autopay settings, pause or cancel schedules, and query schedules by various criteria. All schedule modifications preserve the complete invoice generation history while applying changes to future billing cycles.

Prerequisites

Before updating billing schedules, ensure you have:


Managing Billing Schedules


Retrieve, modify, and control the lifecycle of existing billing schedules.

Retrieve Schedule

from datetime import date
 
import payload
 
pl = payload.Session('secret_key_3bW9...', api_version='v2')
 
# Managing billing schedules
 
# Retrieve a billing schedule
schedule = pl.BillingSchedule.get('bscd_abc123')
 
print(f'Schedule: {schedule.description}')
print(f'Status: Active from {schedule.start_date}')
print(
    f'Recurring: ${schedule.totals['recurring_amount']} {schedule.recurring_schedule['type']}'
)
print(f'Total billed: ${schedule.totals['total']}')
print(f'Total paid: ${schedule.totals['paid']}')
print(f'Balance due: ${schedule.totals['balance_due']}')
 
# Update billing schedule - change frequency
schedule.update(
    recurring_schedule={
        'type': 'quarterly',
        'quarterly': {
            'q1': {'billing_month': 3, 'billing_day': 31},
            'q2': {'billing_month': 6, 'billing_day': 30},
            'q3': {'billing_month': 9, 'billing_day': 30},
            'q4': {'billing_month': 12, 'billing_day': 31},
        },
    }
)
 
print('\nUpdated to quarterly billing on last day of each quarter')
 
# Add a new item to the schedule
new_item = pl.BillingItem.create(
    billing_schedule_id=schedule.id,
    type='line_item',
    description='Additional Service Fee',
    start_date='2024-03-01',  # Start in the future
    line_item={'value': 25.00, 'qty': 1},
)
 
print(f'\nAdded new item: {new_item.description}')
 
# Cancel a billing schedule (set end_date to today)
today = date.today().isoformat()
 
schedule.update(
    end_date=today,
    attrs={
        'cancellation_reason': 'Customer requested cancellation',
        'cancelled_by': '[email protected]',
        'cancelled_date': today,
    },
)
 
print(f'\nSchedule cancelled, no new invoices after {today}')

Get complete schedule details including current configuration, financial totals, and billing items.

Change Billing Frequency

Update the billing frequency to match changing subscription needs.

# Change from monthly to quarterly
schedule = pl.BillingSchedule.get("bscd_abc123")
schedule.update(
    recurring_schedule={
        "type": "quarterly",
        "quarterly": {
            "q1": {"billing_month": 3, "billing_day": 31},
            "q2": {"billing_month": 6, "billing_day": 30},
            "q3": {"billing_month": 9, "billing_day": 30},
            "q4": {"billing_month": 12, "billing_day": 31}
        }
    }
)

Effect of frequency change:

  • Next invoice generated on new schedule
  • Previous invoices unaffected
  • Billing items continue as configured
  • Schedule totals maintain complete history

Update Autopay Settings

Enable or disable automatic payment collection.

Enable autopay:

schedule = pl.BillingSchedule.get("bscd_abc123")
schedule.update(
    autopay_settings={
        "allowed": True
    },
    payer={
        "account_id": "acct_customer123",
        "method_id": "pm_card_456"  # Optional: specify payment method
    }
)

Disable autopay:

schedule = pl.BillingSchedule.get("bscd_abc123")
schedule.update(
    autopay_settings={
        "allowed": False
    }
)

Cancel Schedule

Stop future invoice generation by setting an end date.

# Cancel immediately (no future invoices)
from datetime import date
 
today = date.today().isoformat()
schedule = pl.BillingSchedule.get("bscd_abc123")
schedule.update(
    end_date=today,
    attrs={
        "cancellation_reason": "Customer requested cancellation",
        "cancelled_by": "[email protected]",
        "cancelled_date": today
    }
)

Cancellation effects:

  • No new invoices generated after end_date
  • Existing unpaid invoices remain due
  • Schedule remains accessible for history
  • Financial totals reflect all historical activity

Scheduled cancellation:

# Cancel at end of current billing period
schedule = pl.BillingSchedule.get("bscd_abc123")
schedule.update(
    end_date="2024-12-31",  # Last day of service
    attrs={
        "cancellation_reason": "Contract end",
        "cancellation_type": "scheduled"
    }
)

Pause Schedule

Temporarily stop invoice generation without cancelling the schedule.

Pause by setting near-future end date:

from datetime import date
 
schedule = pl.BillingSchedule.get("bscd_abc123")
schedule.update(
    end_date="2024-03-31",  # Pause until this date
    attrs={
        "pause_reason": "Customer requested service pause",
        "paused_date": date.today().isoformat()
    }
)

Resume by clearing end date:

from datetime import date
 
schedule = pl.BillingSchedule.get("bscd_abc123")
schedule.update(
    end_date=None,  # Resume indefinite billing
    attrs={
        "resumed_date": date.today().isoformat(),
        "resumed_by": "[email protected]"
    }
)

Resume by extending end date:

schedule = pl.BillingSchedule.get("bscd_abc123")
schedule.update(
    end_date="2025-12-31",  # Extend for another year
    attrs={
        "extension_reason": "Contract renewal"
    }
)

Pause use cases:

  • Seasonal businesses (pause during off-season)
  • Customer requests temporary service hold
  • Payment dispute resolution
  • Service interruption or maintenance
  • Trial extensions

Managing Billing Items


Add, update, or remove items that appear on generated invoices.

Add Item to Schedule

Add new charges that will appear on future invoices.

import payload
pl = payload.Session('secret_key_3bW9...', api_version='v2')
 
# Add item to schedule - appears on next invoice
 
schedule_id = 'bscd_abc123'
 
new_item = pl.BillingItem.create(
    billing_schedule_id=schedule_id,
    type='line_item',
    description='Premium Support',
    line_item={
        'value': 25.00,
        'qty': 1
    }
)
 
print(f'Added item: {new_item.description}')
print(f'Item ID: {new_item.id}')
print('Will appear on next invoice')

Item appears on the next invoice generated from the schedule.

import payload
pl = payload.Session('secret_key_3bW9...', api_version='v2')
 
# Add item with future start date
 
schedule_id = 'bscd_abc123'
 
future_item = pl.BillingItem.create(
    billing_schedule_id=schedule_id,
    type='line_item',
    description='Seasonal Feature Access',
    start_date='2024-06-01',  # Starts June 1st
    end_date='2024-08-31',    # Ends August 31st
    line_item={
        'value': 15.00,
        'qty': 1
    }
)
 
print(f'Added seasonal item: {future_item.description}')
print(f'Active from {future_item.start_date} to {future_item.end_date}')
print('Will not appear until start_date')

Item only appears on invoices generated on or after the start_date.

What happens when adding items:

  • Item appears on all invoices generated after start_date
  • If start_date not specified, appears on next invoice
  • Item stops appearing after end_date (if specified)
  • Schedule totals update to include new recurring charges

Update Item Pricing

Modify pricing for existing billing items.

import payload
 
pl = payload.Session('secret_key_3bW9...', api_version='v2')
 
# Update item price
 
item_id = 'bcrg_abc123'
 
updated = pl.BillingItem.get(item_id)
 
 
updated.update(line_item={'value': 59.99, 'qty': 1})  # New price
 
print(f'Updated price to ${updated.line_item}')
print('New price applies to next invoice')
print('Previous invoices remain unchanged')

Update the unit price for an existing billing item.

import payload
 
pl = payload.Session('secret_key_3bW9...', api_version='v2')
 
# Update item quantity (e.g., user count)
 
item_id = 'bcrg_userlic'
 
updated = pl.BillingItem.get(item_id)
 
 
updated.update(
    description='User Licenses (10 users)',
    line_item={'value': 10.00, 'qty': 10},  # Per user  # 10 users = $100.00
)
 
print(f'Updated quantity to {updated.line_item['qty']} users')
print(f'Total: ${updated.line_item['total']}')
print('Change applies to next invoice')

Update the quantity (e.g., user count, seat licenses).

Price change effects:

  • New price applies to next invoice
  • Previously generated invoices unchanged
  • Schedule recurring_amount updates automatically
  • No proration for current billing period

Remove Item from Schedule

Stop charging for specific items on future invoices.

import payload
 
pl = payload.Session('secret_key_3bW9...', api_version='v2')
 
# Remove item by setting end date (recommended)
 
item_id = 'bcrg_abc123'
 
updated = pl.BillingItem.get(item_id)
 
 
updated.update(end_date='2024-12-31')  # Last invoice to include this item
 
print(f'Item will stop appearing after {updated.end_date}')
print('Item remains in schedule history')
print('Good for scheduled removals and audit trail')

Recommended approach - maintains item in schedule history.

import payload
 
pl = payload.Session('secret_key_3bW9...', api_version='v2')
 
# Delete item immediately
 
item_id = 'bcrg_xyz789'
 
item = pl.BillingItem.get(item_id)
item.delete()
 
print(f'Item {item_id} deleted immediately')
print('Will not appear on any future invoices')
print('Use for immediate removal or error correction')

Removes item completely - use for immediate removal.

When to use end_date vs delete:

  • Use end_date for scheduled removal (end of contract, promotion expiry)
  • Use end_date to maintain item in schedule history
  • Use delete for immediate removal (customer downgrade, error correction)
  • Use delete for items never yet invoiced

Time-Limited Items

Add temporary charges for promotions, trials, or seasonal features.

import payload
pl = payload.Session('secret_key_3bW9...', api_version='v2')
 
# Add limited-time promotional discount
 
schedule_id = 'bscd_abc123'
 
promo_discount = pl.BillingItem.create(
    billing_schedule_id=schedule_id,
    type='line_item',
    description='Holiday Promotion - 20% Off',
    start_date='2024-11-01',
    end_date='2024-12-31',
    line_item={
        'value': -9.99,  # Negative for discount
        'qty': 1
    }
)
 
print(f'Promotional discount added: {promo_discount.description}')
print(f'Active from {promo_discount.start_date} to {promo_discount.end_date}')
print('Automatically expires without manual removal')

Limited-time discount that automatically expires.

import payload
pl = payload.Session('secret_key_3bW9...', api_version='v2')
 
# Add trial period pricing
 
schedule_id = 'bscd_abc123'
 
trial_discount = pl.BillingItem.create(
    billing_schedule_id=schedule_id,
    type='line_item',
    description='Trial Period Discount',
    start_date='2024-01-01',
    end_date='2024-03-31',
    line_item={
        'value': -25.00,  # $25 off during trial
        'qty': 1
    }
)
 
print(f'Trial discount added: {trial_discount.description}')
print('First 3 months at reduced rate')
print('Automatically ends after trial period')

Trial period pricing with automatic end date.

Schema Reference


Fields relevant to billing schedule updates:

BillingSchedule Update Fields

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
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.
attrs
object
Custom attributes for extending the resource with additional key-value pairs. Maximum length is 255 characters when serialized.

BillingItem Update Fields

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

Next Steps

Continue building your recurring billing workflow with invoice and payment management


Manage Invoices

Track invoice lifecycle with Invoice Statuses to understand generated invoice progression from unpaid to paid, attach supporting documents with Invoice Attachments for receipts and documentation, and create one-time charges with Creating Invoices for non-recurring billing needs.

Process Payments

Configure automatic payment collection 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.

Analyze Performance

Monitor billing events with Webhook Events to receive real-time schedule and invoice generation notifications, track subscription metrics with Reporting Overview for MRR, ARR, and churn analysis, and analyze revenue data with Transaction Reports for detailed financial reporting.


Related articles