Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 27, 2026

What

Adds optional configuration parameters to the Stripe connector that allow users to filter data and reduce API response sizes for improved sync performance. This addresses performance concerns for accounts with large data volumes.

How

Added 3 new optional configuration parameters to the connector spec and updated the corresponding stream definitions:

  1. subscription_status - Filter subscriptions by status (default: all)

  2. expand_charge_refunds - Toggle whether to expand refund objects in charges (default: true)

  3. expand_invoice_details - Toggle whether to expand discount and tax rate objects in invoices (default: true)

All defaults maintain backward compatibility with existing behavior.

Important note on expand parameters: The expand_charge_refunds and expand_invoice_details options only affect full refresh syncs which use the direct List APIs. Incremental syncs use the Events API which returns full objects without expand parameters.

Review guide

  1. manifest.yaml - spec section (lines ~1902-1931): New config parameter definitions with ENUMs
  2. manifest.yaml - subscriptions stream (line ~359): Made status configurable
  3. manifest.yaml - invoices stream (line ~389): Made expand conditional
  4. manifest.yaml - charges stream (line ~523): Made expand conditional
  5. docs/integrations/sources/stripe.md - Setup guide steps 10-12 and "Performance optimization settings" section

Recommended reviewer verification:

  • Confirm expand[]: [] (empty array) when expand options are disabled is handled correctly by the CDK
  • Verify ENUM values for subscription_status match current Stripe API documentation
  • Test that Jinja conditionals evaluate correctly for both enabled/disabled states
  • Verify documentation accurately describes the new options

Updates since last revision

  • Fixed subscription_status enum to only include valid Stripe API filter values (all, canceled, ended). Removed invalid values that were subscription object statuses rather than API filter parameters.
  • Removed balance_transaction_type config option - it was incompatible with the created_stream pattern used by the balance_transactions stream and caused manifest validation errors.
  • Added user-facing documentation for the 3 new config parameters in the Setup Guide (steps 10-12) and a "Performance optimization settings" section explaining that expand parameters only affect full refresh syncs.

User Impact

Users can now optionally configure these parameters to reduce sync times and data transfer:

  • Filter subscriptions by status (e.g., only canceled or ended subscriptions)
  • Disable expand parameters to reduce response payload sizes

No negative impact on existing users - all defaults preserve current behavior.

Can this PR be safely reverted and rolled back?

  • YES 💚

Requested by @agarctfi

Link to Devin run: https://app.devin.ai/sessions/ae559260b9e74cb8bcefe6d174e758af

…ptimization

- Add balance_transaction_type filter to filter balance transactions by type
- Add expand_charge_refunds option to control refund expansion in charges stream
- Add expand_invoice_details option to control discount/tax rate expansion in invoices stream
- Add subscription_status option to filter subscriptions by status

These options allow users to reduce API response sizes and improve sync performance
by only fetching the data they need.

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Contributor

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

PR Slash Commands

Airbyte Maintainers (that's you!) can execute the following slash commands on your PR:

  • 🛠️ Quick Fixes
    • /format-fix - Fixes most formatting issues.
    • /bump-version - Bumps connector versions, scraping changelog description from the PR title.
  • ❇️ AI Testing and Review:
    • /ai-docs-review - Provides AI-powered documentation recommendations for PRs with connector changes.
    • /ai-prove-fix - Runs prerelease readiness checks, including testing against customer connections.
    • /ai-canary-prerelease - Rolls out prerelease to 5-10 connections for canary testing.
    • /ai-review - AI-powered PR review for connector safety and quality gates.
  • 🚀 Connector Releases:
    • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-preview.{git-sha}) for all modified connectors in the PR.
    • /bump-progressive-rollout-version - Bumps connector version with an RC suffix (2.16.10-rc.1) for progressive rollouts (enableProgressiveRollout: true).
      • Example: /bump-progressive-rollout-version changelog="Add new feature for progressive rollout"
  • ☕️ JVM connectors:
    • /update-connector-cdk-version connector=<CONNECTOR_NAME> - Updates the specified connector to the latest CDK version.
      Example: /update-connector-cdk-version connector=destination-bigquery
    • /bump-bulk-cdk-version bump=patch changelog='foo' - Bump the Bulk CDK's version. bump can be major/minor/patch.
  • 🐍 Python connectors:
    • /poe connector source-example lock - Run the Poe lock task on the source-example connector, committing the results back to the branch.
    • /poe source example lock - Alias for /poe connector source-example lock.
    • /poe source example use-cdk-branch my/branch - Pin the source-example CDK reference to the branch name specified.
    • /poe source example use-cdk-latest - Update the source-example CDK dependency to the latest available version.
  • ⚙️ Admin commands:
    • /force-merge reason="<REASON>" - Force merges the PR using admin privileges, bypassing CI checks. Requires a reason.
      Example: /force-merge reason="CI is flaky, tests pass locally"
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@agarctfi
Copy link
Contributor

agarctfi commented Jan 27, 2026

/bump-version

Bump Version job started... Check job output.

✅ Changes applied successfully. (850bdd2)

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

Deploy preview for airbyte-docs ready!

✅ Preview
https://airbyte-docs-fq4vcn2x7-airbyte-growth.vercel.app

Built with commit e779173.
This pull request is being automatically deployed with vercel-action

Only keep valid Stripe API filter values: all, canceled, ended

Co-Authored-By: [email protected] <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

source-stripe Connector Test Results

209 tests   206 ✅  20m 15s ⏱️
  2 suites    3 💤
  2 files      0 ❌

Results for commit e779173.

♻️ This comment has been updated with latest results.

$ref: "#/definitions/base_requester"
request_parameters:
expand[]: '{{["data.discounts", "data.total_tax_amounts.tax_rate"]}}'
expand[]: '{{ ["data.discounts", "data.total_tax_amounts.tax_rate"] if config.get("expand_invoice_details", true) else [] }}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link the correct API Docs in the PR description for the Event-based endpoint? Also are we sure that leaving expand[]: [] will have the correct intended behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good questions!

  1. Event-based endpoint API docs: The invoices incremental stream uses the Events API with types[] filter for invoice events. The expand parameters only apply to the full refresh stream which uses the Invoices List API. I'll update the PR description to clarify this distinction.

  2. Empty expand[]: [] behavior: Looking at the Stripe API behavior, when you pass an empty array for expand, it's equivalent to not passing the expand parameter at all - Stripe will return the default response without expanded objects. However, I should verify this doesn't cause issues with the CDK's request parameter handling.

Let me verify the empty array behavior is handled correctly by the declarative framework. If there are concerns, we could alternatively use a conditional that omits the parameter entirely when disabled rather than passing an empty array.

devin-ai-integration bot and others added 2 commits January 27, 2026 23:18
…d_stream pattern)

The balance_transaction_type filter could not be implemented with the
created_stream pattern without breaking manifest validation. Keeping
the other 3 improvements: subscription_status, expand_charge_refunds,
and expand_invoice_details.

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

I ran tests with the Stripe test credentials to verify the empty expand[] behavior. Here are the results:

Test 1: Jinja Template Evaluation

With expand_invoice_details=True: ['data.discounts', 'data.total_tax_amounts.tax_rate']
With expand_invoice_details=False: []
With no config (default): ['data.discounts', 'data.total_tax_amounts.tax_rate']

The Jinja template correctly evaluates to an empty array when disabled, and defaults to the expand values when not specified.

Test 2: Stripe API Behavior
I tested the Stripe API directly with the test credentials:

  • With expand[]=['data.discounts', 'data.total_tax_amounts.tax_rate']: Returns expanded objects ✓
  • Without expand[] parameter: Returns default response ✓
  • With empty expand[]=[]: Returns default response (same as no expand) ✓

The Stripe API handles empty expand arrays gracefully - it's equivalent to not passing the parameter at all.

Test 3: CDK Request Parameter Handling
The CDK's HttpRequester uses the requests library which handles empty arrays by simply not including them in the query string. So expand[]=[] effectively becomes no expand parameter at all, which is the desired behavior.

Note: I had to remove the balance_transaction_type config option because it was incompatible with the created_stream pattern used by the balance_transactions stream. The PR now includes 3 improvements instead of 4:

  1. subscription_status - Filter subscriptions by status
  2. expand_charge_refunds - Toggle refund expansion in charges
  3. expand_invoice_details - Toggle discount/tax rate expansion in invoices

@agarctfi
Copy link
Contributor

agarctfi commented Jan 28, 2026

/ai-docs-review

AI Docs Review Started

Analyzing connector changes and preparing documentation recommendations.
View workflow run
AI Docs Review session starting... Analyzing connector changes and preparing documentation recommendations.

Devin AI session created successfully!

@devin-ai-integration
Copy link
Contributor Author

Documentation Review

Overall Assessment: The connector implementation correctly matches the Stripe API documentation, and the changelog entry is present. However, the new configuration parameters are not documented in the user-facing setup guide, which means users won't discover these performance optimization options.

High Priority (Correctness Issues)

No correctness issues found. The implementation aligns with Stripe API documentation:

  • subscription_status: The enum values (all, canceled, ended) correctly match the Stripe Subscriptions List API status parameter.
  • expand_charge_refunds: The data.refunds expand path is valid per Stripe Charges API.
  • expand_invoice_details: The data.discounts and data.total_tax_amounts.tax_rate expand paths are valid per Stripe Invoices API.
Completeness Gaps
  1. Missing: Documentation for the 3 new configuration parameters in the Setup Guide section of docs/integrations/sources/stripe.md.

    • Why it matters: Users won't know these performance optimization options exist unless they explore the connector configuration UI. The existing documentation lists steps 5-10 for configuration but doesn't mention these new options.
    • Suggested addition: Add the following after step 10 (before "Click Set up source"):
    11. (Optional) For **Subscription Status Filter**, you can filter which subscriptions are synced. By default, all subscriptions are synced (including canceled). You can choose to sync only `canceled` or `ended` subscriptions to reduce data volume.
    
    12. (Optional) For **Expand Charge Refunds**, you can disable this to exclude full refund objects from the charges stream, reducing response payload sizes. When disabled, only refund IDs are included. This setting only affects full refresh syncs.
    
    13. (Optional) For **Expand Invoice Details**, you can disable this to exclude full discount and tax rate objects from the invoices stream, reducing response payload sizes. When disabled, only IDs are included. This setting only affects full refresh syncs.
  2. Missing: Documentation of the important caveat that expand parameters only affect full refresh syncs.

    • Why it matters: Users might expect these settings to reduce data in incremental syncs as well, but incremental syncs use the Events API which returns full objects regardless of expand settings.
    • Suggested addition: Add a note in the Limitations & Troubleshooting section:
    #### Performance optimization settings
    
    The **Expand Charge Refunds** and **Expand Invoice Details** configuration options only affect **full refresh** syncs, which use the direct List APIs. **Incremental** syncs use the [Events API](https://docs.stripe.com/api/events/list) which returns full objects without expand parameters, so these settings have no effect on incremental sync performance.
Readability/Organization

Documentation is well-organized. The changelog entry follows the existing format.

Style Nits

No significant style issues. The spec descriptions in manifest.yaml use appropriate HTML links and clear language.

Summary of Recommended Changes

  1. Add documentation for the 3 new configuration parameters in the Setup Guide section (steps 11-13)
  2. Add a note in the Limitations & Troubleshooting section explaining that expand parameters only affect full refresh syncs

This review was generated by Devin. View session

If you are unsure of which value to use, we recommend leaving this setting at its default value of 365 days.

10. Click **Set up source** and wait for the tests to complete.
10. (Optional) For **Subscription Status Filter**, you can filter which subscriptions are synced. By default, all subscriptions are synced (including canceled). You can choose to sync only `canceled` or `ended` subscriptions to reduce data volume. See the [Stripe Subscriptions API](https://docs.stripe.com/api/subscriptions/list) for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD029/ol-prefix Ordered list item prefix [Expected: 6; Actual: 10; Style: 1/2/3]

10. Click **Set up source** and wait for the tests to complete.
10. (Optional) For **Subscription Status Filter**, you can filter which subscriptions are synced. By default, all subscriptions are synced (including canceled). You can choose to sync only `canceled` or `ended` subscriptions to reduce data volume. See the [Stripe Subscriptions API](https://docs.stripe.com/api/subscriptions/list) for details.

11. (Optional) For **Expand Charge Refunds**, you can disable this to exclude full refund objects from the charges stream, reducing response payload sizes. When disabled, only refund IDs are included. This setting only affects full refresh syncs. See the [Stripe Charges API](https://docs.stripe.com/api/charges/list) for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD029/ol-prefix Ordered list item prefix [Expected: 7; Actual: 11; Style: 1/2/3]


11. (Optional) For **Expand Charge Refunds**, you can disable this to exclude full refund objects from the charges stream, reducing response payload sizes. When disabled, only refund IDs are included. This setting only affects full refresh syncs. See the [Stripe Charges API](https://docs.stripe.com/api/charges/list) for details.

12. (Optional) For **Expand Invoice Details**, you can disable this to exclude full discount and tax rate objects from the invoices stream, reducing response payload sizes. When disabled, only IDs are included. This setting only affects full refresh syncs. See the [Stripe Invoices API](https://docs.stripe.com/api/invoices/list) for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD029/ol-prefix Ordered list item prefix [Expected: 8; Actual: 12; Style: 1/2/3]


12. (Optional) For **Expand Invoice Details**, you can disable this to exclude full discount and tax rate objects from the invoices stream, reducing response payload sizes. When disabled, only IDs are included. This setting only affects full refresh syncs. See the [Stripe Invoices API](https://docs.stripe.com/api/invoices/list) for details.

13. Click **Set up source** and wait for the tests to complete.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD029/ol-prefix Ordered list item prefix [Expected: 9; Actual: 13; Style: 1/2/3]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants