Skip to main content

Community

Connector Improvement: Stripe connector supporting more fields in INVOICE_ITEM

Answered

Please sign in to leave a comment.

Comments

4 comments

    Hi Sam! Anna from the product team here. We should be able to add the price columns to INVOICE_ITEM fairly easily. I'm not seeing a plan object in the documentation though– where does that information get related to invoice?

    Whoops, I responded in a no-response email. Let me paste here:

    Thanks for reaching out, Anna! Looking at my original description, the issue I laid out is accurate, but I'm mentioning the wrong objects. Instead of "invoice line items," I'm actually referring to "invoice items" (two different things). Happy to jump on a call to share details or clarify anything (in fact, this would be preferred). But let me try again with my description of the problem..

    The main ask is to log additional fields in Stripe invoiceitem objects into Fivetran's INVOICE_ITEM. The main fields that would be helpful include `plan.id` or `price.id` (they should be the same value), `price/plan.product`, `price/plan.amount`, `price/plan.unit_amount`, `price.recurring.interval` or `plan.interval`, and `price.recurring.interval_count` or `plan.interval_count`. But it's probably a good idea to just log everything that Stripe passes over. 

    We're building analytics tables that use INVOICE_ITEM, but the fields that Fivetran actually sends to our data warehouse are very limited (source) and cannot be easily joined with other tables for enrichment. For instance, if an "invoice item" was created due to a subscription change, it's difficult to find the relevant `plan_id` (taken from the `price.id` or `plan.id` field on the Stripe side; for reference, Fivetran currently logs `plan_id` in INVOICE_LINE_ITEM). You could join with Fivetran's SUBSCRIPTION_ITEM table (which contains `plan_id` and `subscription_item_id`) on `subscription_item_id`, but that table is a snapshot of the currently active subscription items, and so historical `plan_ids` cannot be found. If you think of scenarios where customers were on Plan A originally, then made two plan switches (from Plan A to B, then B to C) in this current billing period, we can find the most recently switched plan (Plan C) but not the initially-switched plan (Plan B). 

    To your question of not seeing a plan object..
    Stripe updated their Plans API to the Price API (which track what plan a customer is subscribed to), and so most of their documentation (like this invoiceitem documentation) only includes Price API fields. They support backward compatibility though, so Stripe objects and events will have both a `plan` and `price` field, with a lot of overlap between the two (such as `plan.id` = `price.id`). If you look at Fivetran's INVOICE_LINE_ITEM, there's a `plan_id` column -- that is likely taken from either the `plan.id` or `price.id` field in Stripe invoice line items (Stripe documentation). 

    Thank you so much for this detailed explanation Sam! Definitely empathize with the challenge here. I will open a ticket with the team to include `price` and `plan` object fields in INVOICE_ITEM, and make sure we are working with sample data that includes the legacy `plan` fields. 

    As an aside, would you find historical data on SUBSCRIPTION and SUBSCRIPTION_ITEM valuable? It sounds like that might be impeding some of your analytics. We could explore this feature as well, if there are enough use cases for it.

    That's great! Yes, SUBSCRIPTION and SUBSCRIPTION_ITEM would be useful. I'm curious what you mean by "historical" -- are you referring to all historical changes to a subscription (e.g., subscription status and payment collection paused changes)? If so, we would use it. 

Didn’t find what you need?

Contact support