Connector Improvement: Improve Stripe Connector Handling of Invoices for Flexible/Trialing Subscriptions
AnsweredThe Fivetran Stripe connector currently generates repeated 400 Bad Request errors when attempting to fetch upcoming invoices for subscriptions with `billing_mode = flexible` or subscriptions in a trialing state. We'd like the connector to handle these cases more gracefully.
Current Behavior
The connector queries the `/v1/invoices/upcoming` endpoint for all subscription IDs, including those for which Stripe does not support or return upcoming invoices. Stripe returns the following error for affected subscriptions:
"The Upcoming Invoice API does not support `billing_mode = flexible` subscriptions. To preview invoices for these subscriptions, use the Create Preview Invoice API instead."
This results in repeated 400 errors appearing in the Stripe Health Dashboard logs, creating operational noise even though sync completion and data integrity are not affected.
Expected / Desired Behavior
1. Skip unsupported subscriptions gracefully**: The connector should detect subscriptions with `billing_mode = flexible` or in a `trialing` state and skip the `/v1/invoices/upcoming` call for them, rather than making a request that is guaranteed to fail.
2. Use the correct API for flexible subscriptions**: Where applicable, the connector could use the Create Preview Invoice API as recommended by Stripe for `billing_mode = flexible` subscriptions.
3. Optional configuration**: Provide a connector setting to exclude invoice queries for subscriptions in specific states (e.g., `trialing`, `flexible`).
Impact
- Stripe Health Dashboard is polluted with 400 errors, making it harder to identify genuine issues.
- No current workaround or configuration option exists to suppress these errors.
- Affects any customer using Stripe subscriptions with flexible billing or trial periods.
Suggested Fix
Before querying `/v1/invoices/upcoming`, filter out subscriptions where:
- `billing_mode = flexible`, or
- `status = trialing`
...or route those subscriptions to the appropriate Stripe API endpoint.
References
- Affected endpoint: `GET /v1/invoices/upcoming?subscription={id}`
-
Official comment
Hi Franziska,
Thank you for the detailed report — this is really helpful. We're looking into this further and will come back with an ideal solution and an update.
Appreciate your patience!
Best,
Sandeep -
When will this be fixed?
-
Hi Franziska,
We have implemented changes to prevent making API calls when `billing_mode` is flexible and are gradually rolling it out. This update has already been applied to your account, so you should no longer encounter errors related to this issue. Additionally, we are currently working on implementing the Create Preview Invoice API.
Best,
Sandeep
Please sign in to leave a comment.
Comments
3 comments