Skip to main content
Question

Stripe integration in campaigns


In this guide https://customer.io/docs/journeys/stripe-data-campaign/ it says that I should choose: .data.object.customer.id but It's not in the list. Should it only be data.object.customer?

6 replies

Now I choose this since the guide is not updated. Is this right?

Hi Stina,

Yes, that’s correct. We mistakenly based the example event and instructions on Stripe events using their `expand` parameter, which converts `customer` into an object. This parameter doesn’t apply to webhooks!

Keep in mind that this means that your Stripe ID needs to match your Customer ID in Customer.io—the `data.object.customer` field will only contain an ID for the customer.

From what I see in Stripe’s documentation, you’d also use `data.object.customer` for other subscription and subscription_schedule events from Stripe.

Sorry for the trouble! I’ve added a task for us to fix this article.

Hi, thank you for your answer. But how do I fix so that stripe and customer.io have the same ID?

That’s a tough question. I’m not a Stripe expert, but I think you’ve got a couple options depending on how you’re set up with Stripe. Both options below may require you to examine how you’re integrated with Stripe and Customer.io.

Option 1: It looks like Stripe sets a customer’s ID automatically when they’re created. To sync up IDs, you’d always need to set the ID value in Customer.io from Stripe. That might be a viable option if you only set ID values on people when they become customers in Stripe. (For example, you might create a lead in Customer.io using their email address and then assign them an ID from Stripe later when they become a paying/subscribed customer). But this option won’t work if you create customers in Stripe independently from people Customer.io.

Option 2: Stripe also allows a `metadata` field in subscriptions. If you pass the email to the metadata field, it will appear in your webhook events. Then you could associate incoming Stripe events with people in Customer.io by `data.object.metadata.email` (or a similar field). But this may require you to update your integration with Stripe to ensure that your subscriptions always include an email value.

Again, I apologize for the trouble here. I’ll try to get this article updated (and tested) ASAP.

Thank you, but I can’t find any data.object with email in the end? I get that information from Stripe as they collect it from the customer so I think that is the best way but I don’t know what attribute I shoudl trigger?

Sorry, what I meant above was that Stripe doesn’t automatically include customer email addresses in their webhooks. Even if you collect email addresses normally in Stripe, you won’t find that trigger attribute in Customer.io right now. By default, there is no email address in Stripe’s webhook trigger. (And, unfortunately, they don’t plan to add email addresses to webhook triggers.)

What I described in Option 2 above was that you might be able to update your integration with Stripe to send the email address in an additional field (the `metadata` field). But you’d have to update your integration with Stripe before you’d find the email attribute in Customer.io.

You will not have access to the email address you collect in Stripe in Customer.io today. Stripe does not send it to Customer.io, so it isn’t in your trigger.

Reply