Why do we care about APIs?
Imagine all of the software in your tech stack works independently. Your ecommerce store runs independently of Klaviyo, which runs independently of your loyalty programs and shipping software.
Suppose one of your loyalty customers recently made a purchase, but they reached out to support because they never received a shipping confirmation. Upon chatting with support, they discovered their loyalty points were never applied to the purchase.
This is not only a frustrating customer experience, but it reduces the power of all of the software you rely on. Each system in your tech stack relies on information from all of the others in order to keep your business running efficiently.
APIs are instrumental in facilitating communication between these business-critical systems. Most, if not all, of the integrations and software you currently rely on are connected via APIs.
Understanding how to craft, send, and troubleshoot API calls will help you understand your tech stack, enabling you to take Klaviyo to the next level.
Discover how APIs impact brands
The following use cases highlight some of the ways Klaviyo's APIs have helped brands communicate with their customers. Click the arrow to expand each dropdown and learn more.
Report on message performance
Nani Skincare is looking to do a deep dive into campaign performance in the last 6 months. They are specifically looking at conversions - they want to know the Placed Order rate and average order value for each campaign, in addition to open and click rates.
To set this up, Nani used the Query Campaign Values API endpoint. With one API call, they can see detailed reports on every campaign they have sent out in a given timeframe.
Nani then automated this, making an API call on a monthly basis to analyze monthly campaign performance.
With this data, they can quickly identify their highest- and lowest-converting campaigns and adjust their sending strategy accordingly. They’ve seen a positive impact after adjusting their strategy, and the marketing team continuously evaluates and iterates on their optimal sending strategy.
They can also use APIs to send this data into Tableau. Now, the entire business is able to quickly visualize and understand the impact of the marketing team's email marketing strategies.
Modify and resend Klaviyo events
Beantown Coffee just integrated with a brand new loyalty program. Whenever a customer's loyalty points change, the loyalty program sends an event into Klaviyo with details about the update.
However, this event doesn't automatically update the Loyalty points profile property on the corresponding profile.
To resolve this, Beantown uses a webhook to update a profile property via Klaviyo's API. They set up a flow triggered by the Changed loyalty points event and add a webhook action. This webhook sends an API request to Klaviyo's Create or Update profile endpoint, updating the loyalty points on the customer's profile.
Now, whenever a customer's loyalty points change, the Loyalty points profile property is updated accordingly, ensuring customer loyalty points are always up to date.
Integrate POS data into Klaviyo
WineDirect is a software used by wineries to manage inventory and handle ecommerce and POS purchases. Hundreds of wineries use WineDirect to sell wine directly to consumers.
Wine sales happen largely in person, as customers visit the wineries and book tastings. Klaviyo partner Best Worlds built a custom integration with WineDirect to help bridge the gap between POS activity and digital communication.
With this integration, when customers book a wine tasting, the integration calls the Klaviyo Create Event endpoint to send a custom Booked wine tasting event into Klaviyo.
The integration also syncs a customer's wine club membership status and all of their orders into Klaviyo.
With this data synced into Klaviyo, WineDirect is able to send personalized messages to their customers after their tastings. They send different messages based on wine club membership status and whether or not the customer purchased any wine after their tasting.
Track unsubscribes with a custom event
Bola's Baked Goods noticed a recent uptick in unsubscribes. Obviously, something is going wrong, but they want to know what - are they sending too many emails? Are the emails not engaging enough? Are customers overloaded with emails in addition to social media ads?
To resolve this, Bola's used a custom hosted unsubscribe page. On this page, they asked customers why they wanted to opt out of email marketing:
Once customers click Unsubscribe, Bola's uses Klaviyo APIs to send a custom Submitted Unsubscribe Reason event into Klaviyo. This event contains the unsubscribe reason the customer selected and updates a custom profile property with this reason as well.
Now, Bola's has a deeper understanding of why customers are unsubscribing and can tailor their marketing efforts accordingly. They can create custom reports in Klaviyo to understand unsubscribe reasons over time and make sure they communicate with their customers in the right way.
Internationalize a product catalog
SWAK, a cosmetics and beauty brand, recently expanded sales from their home base of the UK into Germany, Spain, and France. They've found themselves with many more customers from these additional countries, along with more languages and currencies to handle.
To properly internationalize their products, SWAK used the Catalogs API. This allowed them to update their catalog to have different products in each language and currency.
Now, German shoppers see German product names, while English shoppers see the same product in English. The products can still be used with Klaviyo's product blocks, meaning each shopper gets recommendations personalized not only to their browsing history, but to their language preference as well.
SWAK can also use these data to track performance of different products in different regions, informing their overall product and marketing strategy.
Explore more API use cases
You can use Klaviyo's APIs to modify and report on every part of Klaviyo's data model.
Keep these examples in mind as you start working through making your own API calls. Consider what worked for these brands and what customization can do for you.
Check out these solution recipes in Klaviyo's Developer Blog to see detailed information about how to implement some of these use cases. Please note that some of the code in these recipes may be out of date.