Bill
Disabling Autopay

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.

Prerequisites

Before disabling automatic payments, ensure you understand:


Disabling Autopay on Invoices


Prevent automatic payment attempts on specific invoices.

import payload
 
pl = payload.Session('secret_key_3bW9...', api_version='v2')
 
# Disable autopay on a specific invoice
 
invoice_id = 'inv_abc123'
 
updated = pl.Invoice.get(invoice_id)
 
 
updated.update(
    autopay_settings={
        'allowed': False,
    },
)  # Disable automatic payment
 
print(f'Invoice updated: {updated.id}')
print(f'Autopay disabled: {not updated.autopay_settings['allowed']}')
print('Manual payment required')
print(f'Amount due: {updated.totals['balance_due']}')

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)

Disabling Autopay on Billing Schedules


Stop automatic payment for future invoices generated from billing schedules.

import payload
 
pl = payload.Session('secret_key_3bW9...', api_version='v2')
 
# Disable autopay on a billing schedule
 
schedule_id = 'bscd_abc123'
 
updated = pl.BillingSchedule.get(schedule_id)
 
 
updated.update(
    autopay_settings={
        'allowed': False,  # Disable autopay on future invoices
    },
)
 
print(f'Billing schedule updated: {updated.id}')
print(f'Autopay disabled: {not updated.autopay_settings['allowed']}')
print('Future invoices will require manual payment')
print('Already-created invoices retain their autopay settings')

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.

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

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
# 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_date stops invoice generation entirely
  • Disabling autopay_settings.allowed continues 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