Disable Automatic Payments
Stop automatic payment attempts on invoices and billing schedules
Disable automatic payments when customers request manual payment, when invoices require approval before payment, or when you need to prevent charges during disputes. You can disable autopay on individual invoices, stop autopay for future invoices from billing schedules, remove account default payment methods, or cancel invoices entirely to prevent any payment attempts.
Disabling autopay on invoices before the due date prevents automatic charges. If an automatic payment is already being processed, disabling autopay may not stop it immediately. Disable autopay well before the due date to ensure payment is prevented.
Prerequisites
Before disabling automatic payments, ensure you understand:
Autopay overview
Understand how automatic payments work and eligibility requirements.
Enable autopay
See how autopay is configured to understand how to disable it.
Disabling Autopay on Invoices
Prevent automatic payment attempts on specific invoices.
What happens when you disable autopay:
- Invoice will not be automatically charged on due date
- Customer must pay invoice manually
- Invoice remains in current status (unpaid or partially_paid)
Check invoice autopay status
# Check if autopay is enabled on an invoice
invoice = pl.Invoice.get("inv_abc123")
print("Autopay enabled:", invoice.autopay_settings["allowed"])
print("Due date:", invoice.due_date)
print("Balance due:", invoice.totals["balance_due"])
if invoice.autopay_settings["allowed"]:
print("Will be automatically charged on due date")
else:
print("Requires manual payment")Re-enable autopay on invoice
# Enable autopay on an invoice that was previously disabled
invoice = pl.Invoice.get("inv_abc123")
invoice.update(
autopay_settings={
"allowed": True
}
)
print("Autopay re-enabled:", invoice.autopay_settings["allowed"])
print("Will charge on:", invoice.due_date)Timing Matters: If an automatic payment is already being processed, disabling autopay would not stop it. Always disable autopay well before the due date if you need to prevent the charge.
Disabling Autopay on Billing Schedules
Stop automatic payment for future invoices generated from billing schedules.
What happens when you disable schedule autopay:
- Future invoices generated from schedule will have autopay disabled
- Already-created invoices retain their individual autopay settings
- Schedule continues generating invoices on schedule
- Customers must pay future invoices manually
Impact on existing invoices
# Disabling autopay only affects future invoices
schedule = pl.BillingSchedule.get("bscd_abc123")
schedule.update(
autopay_settings={
"allowed": False
}
)
print("Future invoices will require manual payment")
print("Next invoice date:", schedule.next_invoice_date)Future invoices generated after this change will have autopay_settings.allowed: false.
# Find and disable autopay on already-created invoices
schedule = pl.BillingSchedule.get("bscd_abc123")
# Get all unpaid invoices from this schedule
invoices = pl.Invoice.filter_by(
billing_schedule_id=schedule.id,
q='status != "paid" && status != "closed"'
).all()
# Disable autopay on each invoice
for invoice in invoices:
if invoice.autopay_settings["allowed"]:
invoice.update(
autopay_settings={"allowed": False}
)
print(f"Disabled autopay on invoice: {invoice.id}")Already-created invoices require individual updates to disable autopay.
Already-Created Invoices: Changing autopay settings on a billing schedule only affects future invoices. To stop autopay on already-created invoices, update each invoice individually or remove the account's default payment method.
Removing Default Payment Methods
Remove account-level default payment methods to stop all automatic payments.
Remove default status
# Remove default status from payment method
method = pl.PaymentMethod.get("pm_card_789")
method.update(
account_defaults={
"paying": None # No longer default for payments
}
)
print("Default payment method removed")
print("No invoices will be automatically charged for this account")Account-wide autopay control:
- Removing the default payment method stops all automatic payments
- Existing autopay-enabled invoices won't be charged
- Can be re-enabled by setting a new default payment method
Set new default payment method
# Set a different payment method as default
new_default = pl.PaymentMethod.get("pm_card_456")
new_default.update(
account_defaults={
"paying": "payments" # Set as new default
}
)
print("New default payment method:", new_default.id)
print("Future automatic payments will use this method")
print("Previous default automatically removed")Automatic default removal:
- Setting a new default automatically removes default status from previous method
- Only one payment method can be default for payments at a time
- Customer can switch defaults without manually removing old default
Customer Portal: Provide customers with an easy way to manage their default payment method. Allow them to temporarily disable autopay by removing the default, then easily re-enable by setting a default again.
Alternative Ways to Stop Autopay
Other methods to prevent automatic payment attempts.
# Cancel an invoice to prevent automatic payment
invoice = pl.Invoice.get("inv_abc123")
invoice.update(
status="closed"
)
print("Invoice status:", invoice.status)
print("No payment will be attempted")
print("Invoice is closed and cannot be paid")Close an invoice to prevent automatic payment while maintaining records.
When to cancel invoices:
- Invoice created in error
- Customer refund or credit issued instead
- Service cancelled before invoice due
- Disputed charges being written off
- Correcting billing mistakes
# Delete invoice to permanently prevent payment
invoice = pl.Invoice.get("inv_abc123")
invoice.delete()
print("Invoice deleted - no automatic payment possible")
print("Use with caution - deletion is permanent")Permanently remove an invoice to prevent payment. Use with caution.
When to delete invoices:
- Test invoices in sandbox environment
- Duplicate invoices created by mistake
- Completely removing erroneous invoices
- Early development and testing
Deletion is Permanent: Deleting an invoice removes all records and cannot be undone. Use
status: 'closed' instead if you need to maintain records for accounting or audit purposes.
# Stop a billing schedule from generating future invoices
from datetime import date
today = date.today().isoformat()
schedule = pl.BillingSchedule.get("bscd_abc123")
schedule.update(
end_date=today
)
print("Billing schedule stopped")
print("No future invoices will be generated")
print("Existing invoices unaffected")Stop invoice generation entirely by setting an end date on the billing schedule.
Stopping vs disabling autopay:
- Setting
end_datestops invoice generation entirely - Disabling
autopay_settings.allowedcontinues generating invoices but requires manual payment - Choose based on whether you want to stop billing or just stop automatic payment
Next Steps
Continue managing automatic payments and processing manual payments
Re-enable Autopay
Set up automatic payments again with Enable Autopay to configure default payment methods, understand how automatic payment processing works with Autopay Overview for eligibility and retry logic, and track payment success with Monitor Autopay to troubleshoot and optimize collection.
Process Manual Payments
Process manual invoice payments with Payment API for programmatic payment processing, send payment links to customers with Payment Requests via email or SMS, and record offline payments with External Payments for cash, check, and wire transfers.
Manage Schedules and Invoices
Manage schedule settings with Update Billing Schedules to modify frequencies and autopay settings, understand invoice progression with Invoice Statuses for tracking unpaid to paid transitions, and build individual invoices with Creating Invoices for one-time charges.
Related articles
- Enable Autopay - Set up automatic payments
- Monitor Autopay - Track automatic payment activity
- Autopay Overview - How automatic payments work
- Update Billing Schedules - Manage schedule autopay
- Payment API - Process manual payments
- Payment Requests - Send payment links