Why aren't unpaid invoices written off for canceled subscriptions via API?
Scope
While using the Salesforce API to cancel subscriptions in Chargebee, you might encounter an issue where unpaid invoices are not automatically written off, even if you have enabled the site-wide setting for this purpose. This typically occurs when the API call does not include the necessary parameters to trigger the write-off process.
Solution
To ensure that unpaid invoices are automatically written off when a subscription is canceled via the Salesforce API, follow these steps:
- Verify Site-wide Settings: Ensure that the site-wide setting to automatically write off unpaid invoices for canceled subscriptions is enabled.
- Navigate to Settings > Configure Chargebee > Billing Rules.
- Check the option for "Automatically write off unpaid invoices for canceled subscriptions."
- Modify API Call: Include the
account_receivables_handlingparameter in your Salesforce API call when canceling a subscription.
- This parameter is crucial for triggering the write-off process.
- Example API call snippet:
{ "subscription_id": "sub_123456", "contract_term": { "action_at_term_end": "cancel", "account_receivables_handling": "write_off" } }
- Test the API Call: After modifying the API call, perform a test to ensure that the unpaid invoices are written off as expected.
- Use a test subscription to verify the behavior.
- Review API Documentation: Familiarize yourself with the Chargebee API documentation to understand all available parameters and their effects.
- Refer to the API documentation for detailed information.
Important Notes
- Ensure that your API integration is updated to include the
account_receivables_handlingparameter for all relevant calls. - Regularly review your integration settings and API calls to prevent similar issues.
- If the issue persists after following these steps, contact Chargebee support for further assistance.
Related Articles
Show more
Was this article helpful?