Solved

Stripe and Klaviyo integration

  • 25 November 2022
  • 12 replies
  • 432 views

Badge +4

Hi guys,

 

We’ve just moved our website over from a shopify website to a custom website using stripe, and struggling to implement discount codes. What’s the easiest way to generate unique discount codes which expire for new customers in our welcome flow? As well as unique codes which expire for customer winback flows?

 

Thanks,


Ben

icon

Best answer by alex.hong 25 November 2022, 21:40

View original

12 replies

Userlevel 7
Badge +58

Hi @brewcrew ,

Thanks for sharing.

You can find more information on the Stripe Integration here

We do not have that ability with stripe to create codes within Stripe. However, you can generate unique coupons and upload them. You can find out more about how to do that here: https://help.klaviyo.com/hc/en-us/articles/115005084727-Guide-to-Using-Coupon-Codes-in-Klaviyo

 

Hope this helps,

Alex

Badge +4

Hey, 

 

Just revisiting this. With the method of uploading coupons, how do I add an expiry window for after it’s sent. For example, I want a coupon to be used in my win-back flow that will last for 48 hours from the time it is sent.

 

Thanks!

Userlevel 7
Badge +60

Hi @brewcrew

 

Thanks for your question! 

 

I’d encourage you to check out our awesome documentation linked as you walk through installing coupons! 

 

As it states in Step 5 of the documentation, when you get to the ‘Active Dates’ after choosing what kind of discount you want you’ll see this screen:

Choose the ‘on a specific date’ option, which will then let you choose when you want the coupon to be active before expiring.

Thanks for participating in the Community!

-Taylor 

Badge +4

And this will link to our custom stripe checkout and have them expire there? Thanks :)

Userlevel 7
Badge +60

Hey @brewcrew,

So this wouldn’t link back to your custom Stripe checkout automatically.

When using uploaded codes, it’s important to also import those same codes back to where you want to use the codes. In this case, Stripe.

If you haven’t already, I would suggest taking a look at our Tips on uploading unique coupon codes and Use uploaded coupons in a message subsections of our Getting started with coupon codes in Klaviyo Help Center article as I think they would be helpful.

David

Badge +4

Hi David,

 

Thanks for this. I understand that  I have to upload them into stripe as well. However, I’m not sure how I’d go about setting the expiry date to a certain amount of time after an email send. So for our customer winback flow we’d like to send a discount code that will expire a week after the email is sent.

 

Thanks,

 

Ben

Badge +4

Just chasing this one up!

Badge +4

@David To :)

Userlevel 7
Badge +60

Hey @brewcrew,

When it comes to uploaded coupons, you would only be able to select a specific date they expire on. Only coupons generated through a support ecommerce platform - like Shopify  - will offer you the option of a variable expiration date.

Additionally, variable expiration dates would only be supported in flow messages. Uploaded coupons, similar to unique coupons used in campaigns would need to be generated in advance to accommodate the recipient count. Hence why a variable expiration date wouldn’t be supported for these two options. 

David

Badge +4

Ahh ok, we have a custom website and don’t use shopify. Do you have any recommendations on setting up customer winback flows if we can’t set variable expiry times in this way? Ideally we want to give only a certain amount of time for the codes to be used, to be sent, say after a month of their first order. Thanks!

Hey @brewcrew,

When it comes to uploaded coupons, you would only be able to select a specific date they expire on. Only coupons generated through a support ecommerce platform - like Shopify  - will offer you the option of a variable expiration date.

Additionally, variable expiration dates would only be supported in flow messages. Uploaded coupons, similar to unique coupons used in campaigns would need to be generated in advance to accommodate the recipient count. Hence why a variable expiration date wouldn’t be supported for these two options. 

David

 

Badge +4

Ahh ok, we have a custom website and don’t use shopify. Do you have any recommendations on setting up customer winback flows if we can’t set variable expiry times in this way? Ideally we want to give only a certain amount of time for the codes to be used, to be sent, say after a month of their first order. Thanks!

Hey @brewcrew,

When it comes to uploaded coupons, you would only be able to select a specific date they expire on. Only coupons generated through a support ecommerce platform - like Shopify  - will offer you the option of a variable expiration date.

Additionally, variable expiration dates would only be supported in flow messages. Uploaded coupons, similar to unique coupons used in campaigns would need to be generated in advance to accommodate the recipient count. Hence why a variable expiration date wouldn’t be supported for these two options. 

David

 

@David To :)

Userlevel 7
Badge +60

Hey @brewcrew,

Some ways I’ve seen this accomplished is through the use of either a custom event or through the use of a custom profile property being updated via API. 

Custom events are highly flexible and customizable based on how they’re created. This means you can even stitch multiple events or logic together (in your backend) to trigger an event in Klaviyo. What I’ve seen are users making calls to the coupon API of the tool/app they’re using - in this case Stripe, to generate a dynamic coupon based on the logic they want. I.E. after a user’s first purchase. Then, they’ll pass that dynamic coupon code that was generated to Klaviyo through a custom event. This would then allow you to trigger a metric-triggered flow off of this event while calling that discount code in the email. 

The concept is similar when going through the custom profile property route. Instead of creating a custom event to pass the discount code that was generated through your third-party tool’s coupon API; the discount code is passed as a custom profile property. Going this route, you wouldn’t be able to trigger a flow off of a custom profile property being added or applied. But this would allow you to call the custom profile property and value containing the discount code in any email you want. 

In both instances, it’s important to understand because the discount code is generated through a third-party app, the variable expiration date will need to be managed through time delays in Klaviyo. 

If you haven’t already, I would suggest taking a look through our Developer Portal to learn more about our API to implement either of the solutions shared. We also have an extensive network of Klaviyo Partners you can reach out to for more hands on assistance when it comes to custom development help. 

David

Reply