airbyte icon indicating copy to clipboard operation
airbyte copied to clipboard

Source Stripe: Expandable fields missing in Events API may lead to incomplete data

Open strosek opened this issue 1 year ago • 1 comments

Current situation

The Stripe API doesn't support retrieving expandable fields through the Events API. This makes it impossible to construct the full data in incremental sync without retrieving the full objects. This may imply that existing data is updated with null when writing in the destination. One example of this expandable fields in the API is the Price.tiers object.

Reproducing the issue

Create a new pricing object with billing_scheme = tiered, and fill the required fields in the Tiers object. Then query for events related to the newly created Price. Results don't include tiers information.

Desired situation

Connector logic to retrieve updated expandable fields in incremental sync is implemented. We update multiple objects from a single API call if possible for performance. We make sure expandable fields don't override values with null in destinations when not present.

Proposed solution

We keep track of which fields are expandable throughout the API. Objects with expandable data that also have update events are queried to populate all fields when doing incremental sync.

Expected outcome

Data is complete and up-to-date even when expandable data is present in API objects. Test end to end to check no wrong nulls are written. As we will perform one HTTP query per record, we expect this to slow the syncs but don't have a good measure of how much.

strosek avatar Apr 17 '24 15:04 strosek

Based on this information, it is assumed that the following fields are missing during incremental syncs:

  • ~~Stream: charges, field: refunds~~ (this one actually works even though Stripe have this field as expandable. I'll contact them to get more information on this one)
  • ~~Stream: checkout_sessions_line_items, fields: discounts and taxes~~ (this one is fine because we don't retrieve line items through the events API, only the parents)
  • Stream: plans, field: tiers (running full_refresh, I have the information but not running incremental)

maxi297 avatar May 07 '24 19:05 maxi297

I found the same issue with the discounts field in the subscriptions object https://docs.stripe.com/api/subscriptions/object#subscription_object-discounts Right now we are missing that field in the Subscriptions stream

eloymc16 avatar Feb 17 '25 10:02 eloymc16

I have the same issue regarding the tax_amounts json from the invoices stream. This is a huge deal because the data at the first load is ok, but then it starts changing as the data is updated using the events streams.

nimuriel avatar Sep 11 '25 08:09 nimuriel