The merchant reported that the invoice for the month has not automatically closed.
Merchant-created subscriptions with the automatically close invoice flag as true but it still generated pending invoices are not closed automatically.
Steps to Debug:
1. Metered billing configured to automatically close invoices. Go to Preferences -> Enter Domain name and Choose 'Metered_billing' in the namespace. Check for the property value - 'Automatically close invoice' as given below.
Now, check the customer and subscription events one by one for subscription-level changes. For example in the below usecase, the merchant changed the subscription on 04-Nov-2022 10:53:49 AEDT at that time merchant changed the auto closure flag.
If the flag is changed, then it overrides at the subscription level. So, pending invoices were not automatically closed.