<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mike Sedzielewski</title>
    <description>The latest articles on DEV Community by Mike Sedzielewski (@msedzielewski).</description>
    <link>https://dev.to/msedzielewski</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F16028%2F4ff3f2a0-4afc-40e0-9234-bff5926b74bb.png</url>
      <title>DEV Community: Mike Sedzielewski</title>
      <link>https://dev.to/msedzielewski</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/msedzielewski"/>
    <language>en</language>
    <item>
      <title>Becoming an e-commerce architect: 12 API integration skills for developers</title>
      <dc:creator>Mike Sedzielewski</dc:creator>
      <pubDate>Thu, 01 Feb 2024 11:34:12 +0000</pubDate>
      <link>https://dev.to/msedzielewski/becoming-an-e-commerce-architect-12-api-integration-skills-for-developers-3npi</link>
      <guid>https://dev.to/msedzielewski/becoming-an-e-commerce-architect-12-api-integration-skills-for-developers-3npi</guid>
      <description>&lt;p&gt;Postman has published my &lt;a href="https://blog.postman.com/e-commerce-architect-api-integration-skills-developers/"&gt;article&lt;/a&gt;, which highlights key API integration skills essential for an e-commerce developer. The post presents a list of practices and techniques we’ve learned during the development of Voucherify and its integration with various systems, including other headless platforms and consumer-facing applications.&lt;/p&gt;

&lt;p&gt;Contents:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read the fancy manual&lt;/li&gt;
&lt;li&gt;Check API version&lt;/li&gt;
&lt;li&gt;Double-check update guarantees and caching&lt;/li&gt;
&lt;li&gt;Favor using idempotent endpoints&lt;/li&gt;
&lt;li&gt;Scan the data-retention policy&lt;/li&gt;
&lt;li&gt;Examine API error handling&lt;/li&gt;
&lt;li&gt;Meet an API guardian: the rate limiter&lt;/li&gt;
&lt;li&gt;Map out the way from migration to production&lt;/li&gt;
&lt;li&gt;Master webhooks&lt;/li&gt;
&lt;li&gt;Explore pre-built integrations&lt;/li&gt;
&lt;li&gt;Detect downtime with status monitoring&lt;/li&gt;
&lt;li&gt;Event-driven architecture and further reading&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>architecture</category>
      <category>ecommerce</category>
      <category>api</category>
    </item>
    <item>
      <title>Maximizing Customer Loyalty with CDP-Powered Incentives</title>
      <dc:creator>Mike Sedzielewski</dc:creator>
      <pubDate>Fri, 01 Sep 2023 13:26:41 +0000</pubDate>
      <link>https://dev.to/msedzielewski/maximizing-customer-loyalty-with-cdp-powered-incentives-3kfh</link>
      <guid>https://dev.to/msedzielewski/maximizing-customer-loyalty-with-cdp-powered-incentives-3kfh</guid>
      <description>&lt;p&gt;It’s the twenties and the market circumstances made brands revisit &lt;a href="https://www.voucherify.io/loyalty-software"&gt;loyalty programs&lt;/a&gt;. Privacy regulations, post-pandemic habits, and chain supply breakdowns caused a shockwave of changes to how digital teams design CLV schemes.&lt;/p&gt;

&lt;p&gt;It might be hard to surf this wave without spending money on software. Connecting &lt;a href="https://www.voucherify.io/blog/zero-party-data-loyalty-programs"&gt;zero-party data&lt;/a&gt;, new customer experiences and touchpoints, and the whole ecommerce backend with the reward campaigns requires tasking a number of coders to glue it all together.&lt;/p&gt;

&lt;p&gt;There’s a way to make the Gantt chart for your customer lifetime value projects shorter, though. It’s promo codes. Although they sound easy, they can become a pain when your scale grows. Fortunately, an integration of CDP and a &lt;a href="https://www.voucherify.io/learn/promotion-engine-how-to"&gt;Promotion Engine&lt;/a&gt; lets you embrace promo codes and forge a loyalty strategy without taxing your dev team too much.&lt;/p&gt;

&lt;h3&gt;
  
  
  Beyond the public codes — promo code types and their purpose
&lt;/h3&gt;

&lt;p&gt;One of the Big 4 consultancy firms was tasked with finding out why “earn and burn” loyalty programs fail. They surveyed customers and came up with three reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It took too long to earn points or rewards.&lt;/li&gt;
&lt;li&gt;Rewards were irrelevant.&lt;/li&gt;
&lt;li&gt;Too many notifications caused confusion.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How to address it? Let’s engage customers with something easy to understand, easy to use, and, finally, evoking the feeling of being rewarded. Any ROI-guaranteed examples? No sir, you need to experiment your way to find the reward-customer-fit.&lt;/p&gt;

&lt;p&gt;Now, what’s the most straightforward reward to start building loyalty? A promo code — easy to understand and easy to use. Let’s see how we can make it more relevant with customer preferences stored in your CDP.&lt;/p&gt;

&lt;h3&gt;
  
  
  Iteration #1 — public promo codes
&lt;/h3&gt;

&lt;p&gt;We have a blank checkout view. Let’s display “BLCKFRDY” on top of your your web/mobile app. It’s the simplest site-wide promo code, but is there any way to get it more personal? A pipeline between CDP and a Promotion Engine might help you pave the way.&lt;/p&gt;

&lt;p&gt;The setup gives you a way to modify promo code experience depending on customer preferences. A product manager now gets a palette with three types of conditions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Soft — showing or hiding promotions depending on one (or more) customer preferences.&lt;/li&gt;
&lt;li&gt;Hard — making promotions exclusive only to a selected segments.&lt;/li&gt;
&lt;li&gt;Dynamic — making promotions better (or less attractive) for some customers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s see some real-world variants we’ve seen in recent years.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--neiHBJfC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2Ayz2sj8f_qGuUqaS9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--neiHBJfC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2Ayz2sj8f_qGuUqaS9.png" alt="" width="800" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the CDP x Promotion Engine pipeline in place, building promotions take only several clicks to roll-out. Changing eligibility conditions or rolling them back is also a matter of selecting different attributes. This makes the public promo codes a scalable marketing tool — you can introduce new campaigns in days or even hours.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aMVmr_Hg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/767/0%2AanjXfzDAZbW5XiqC.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aMVmr_Hg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/767/0%2AanjXfzDAZbW5XiqC.png" alt="" width="767" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Iteration #2 — bulk codes
&lt;/h3&gt;

&lt;p&gt;But sometimes public codes are not enough. Perhaps you want to be more selective when it comes to promotion eligibility (e.g., one-off “sorry” coupons handled by the customer support team). Or, you want to track marketing channels with higher granularity (e.g. exclusive anniversary discounts offered to “premium” members only via the app). Or, spinning a referral program by equipping your customers with a code that works as a discount for new customers and servers as a referral measure at the same time.&lt;/p&gt;

&lt;p&gt;All of these examples are proven tools for enticing customer loyalty so you might want to have them under your belt. Bulk promo codes give you that and more.&lt;/p&gt;

&lt;p&gt;How does a CDP &amp;amp; Promotion Engine integration make it easier for digital teams? First, generating up to millions of codes and making them available to a customer profile is out-of-the-box. The only thing remaining is to figure out how to display the code to the customer (see the next section👇)&lt;/p&gt;

&lt;p&gt;Second, while implementing code generation is a fun challenge to a seasoned developer, maintaining it is not. Devs don’t like to be interrupted with requests like: “can you disable “HAPPY10” for one day please?”. This is where the Promotion Engine shines with hundreds LUX.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sm4RafCy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AxP2nLrULbhzpLpxEuG8G2g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sm4RafCy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AxP2nLrULbhzpLpxEuG8G2g.png" alt="" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The admin dashboard gives the control over the bulk codes back to the revenue/marketing/customer success teams. They can search, disable, track, monitor, redeem, and roll back codes on their own, with the user interface that favors revenue generation and security.&lt;/p&gt;

&lt;p&gt;The best part? It’s easy to mix public and bulk codes to test original promo codes ideas, see how they entice loyalty — again all without distracting the development team.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZUN7u4_E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2AfUmt5oscjjq9DdFY.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZUN7u4_E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2AfUmt5oscjjq9DdFY.png" alt="" width="800" height="522"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🥡 &lt;strong&gt;Takeaways&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Instead of rolling out a full-blown point program, start with promo codes (public and bulk) to see how they impact customer loyalty.&lt;/li&gt;
&lt;li&gt;To create, manage, and track promo codes, build a promotion engine.&lt;/li&gt;
&lt;li&gt;Use customer attributes from CDP to define promo eligibility rules and see how they drive revenue.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Beyond the homepage — funnel-aware promotions
&lt;/h3&gt;

&lt;p&gt;Ease of creating and managing promo codes isn’t the only benefit coming with a CDP-fed Promotion Engine. Even a generous incentive won’t work if it doesn’t end up in the right place. Imagine an endpoint which returns all valid promo codes for the logged-in user. What can you do with it?&lt;/p&gt;

&lt;p&gt;You can start with &lt;a href="https://www.voucherify.io/blog/the-definitive-guide-to-personalised-promotions-tips-best-practices-and-examples"&gt;personalizing discounts&lt;/a&gt; on the side-wide banners. Let’s step up the game by displaying personal incentives further in the funnel — product pages, category pages, checkout, popups are also great places to nudge customers. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Show a product-page discount only to customers who went dormant.&lt;/li&gt;
&lt;li&gt;Reward them with a one-off code for leaving a review of a product.&lt;/li&gt;
&lt;li&gt;Give a one-off promo code to the first-time customers, right after the purchase.&lt;/li&gt;
&lt;li&gt;Display a time-limited promotion next to the cart only to the geofenced customers.&lt;/li&gt;
&lt;li&gt;Or a classic one — show a last-resort cart abandonment discount.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But the true power comes when you feed your promotion system with the current cart structure. Then the branches of the promotional rules tree grow tenfold. With this in place, your promotional mix gets new knobs that allow you to control how much margin you can spend, or should I say invest, in your campaigns.&lt;/p&gt;

&lt;p&gt;While most ecommerce allow you to define a minimum amount to make a promotion work, a flexible Promotion Engine can go way beyond that. The endpoint returning all valid codes for the logged-in user can now return product- and volume-specific discounts such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Buy product X to get Y with 50% off.&lt;/li&gt;
&lt;li&gt;Get 10% off with $100 spend, make it 15% with $200.&lt;/li&gt;
&lt;li&gt;Discount the cheapest product in the cart.&lt;/li&gt;
&lt;li&gt;If you buy 10 SKUs, give one free.&lt;/li&gt;
&lt;li&gt;Add a free gift, when buying something from the X category.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, you can interweave customer segments with OR and AND like this one:&lt;/p&gt;

&lt;p&gt;The code ARABICA-LVRS is displayed only on the “arabica coffee” category page, works only for selected SKUS and gives $10 off to new customers, but $5 to others.&lt;/p&gt;

&lt;p&gt;Want a real promo scenario?&lt;/p&gt;

&lt;p&gt;Carsome uses a mix of promotional rules to drive car sales based on customer activity and the stock information. The longer a car stays in the parking lot the worse it’s for the business. Carsome uses this information together with a tight CDP integration. The system watches out for user behaviour (car browsed, essential clicks, cart abandonment events), then these insights are put into a formula that defines what discount should be applied for a given shopping context.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rYijUa-t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/774/0%2AbmJOjxTrHcdZM2OA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rYijUa-t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/774/0%2AbmJOjxTrHcdZM2OA.png" alt="" width="774" height="852"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This endpoint might work well for other promotional use cases, for example, reminders. Supposing your first-time customer received a discount for their next order via email (we’ll get to that later), you can show the same promo code on a flash banner once the user logs in to your app again.&lt;/p&gt;

&lt;p&gt;You can take it to the next level by creating a customer wallet — a list of all active incentives the customer is entitled to. Showing redeemed offers is also worth considering as, with a bit of creativity, you can use it to paint a positive picture of your brand.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qlp6gk6B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2AeHKSWxmTaPxfoLP4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qlp6gk6B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2AeHKSWxmTaPxfoLP4.png" alt="" width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have plenty of ideas in your head by now, hold on, because we haven’t covered the best part yet — messaging.&lt;/p&gt;

&lt;p&gt;🥡 &lt;strong&gt;Takeaways&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Showing promotions where the user is shopping increases the chances for using them.&lt;/li&gt;
&lt;li&gt;Fine-grained promotional API helps you tie promotions to every funnel stage.&lt;/li&gt;
&lt;li&gt;Adding the cart context to your promotion rules, enables you to roll out margin-sensitive incentives.&lt;/li&gt;
&lt;li&gt;Promotion Engine that understands customer attributes and cart structure gives you utmost control over who gets a discount, when and what kind.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Beyond the website — email, SMS, and push notifications
&lt;/h3&gt;

&lt;p&gt;For offline customers, promo codes are deadly effective call-to-actions. A CDP-powered Promotion Engine becomes a precision rifle that helps you target customers with personalized offers. It’s powerful and simple — the mechanism follows the “if-then” logic supplied with operators.&lt;/p&gt;

&lt;p&gt;Technically, if a CDP tracks an event and notifies a Promotion Engine, it automatically creates a promo code according to the predefined conditions, then, if needed, notifies other systems about the offer. A few examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If a customer purchased an order, send them a re-engagement offer with email after 30 days.&lt;/li&gt;
&lt;li&gt;If a customer clicked on a specific car AND it occupied the parking space for more than 6 months, double the discount and inform the customer with a push notification.&lt;/li&gt;
&lt;li&gt;If a customer has a birthday today, show a 50% promo code for products up to $50 in the app, for the next 7 days.&lt;/li&gt;
&lt;li&gt;If a customer’s total order amount exceeds $1000 OR the number of orders is greater than 10 AND she hasn’t redeemed BLACKFRIDAY code, send a webhook to &lt;a href="https://www.braze.com/"&gt;Braze&lt;/a&gt; with a unique promo code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These examples show how real-time events, common customer attributes, aggregated data, and interaction with previous offers managed by a Promotion Engine, can be used to trigger an incentive/reward workflow.&lt;/p&gt;

&lt;p&gt;A caveat here — connecting promotions with messages on scale requires planning. Email/SMS deliverability has policies you do need to take into account. For example, your integration should be able to throttle and queue data to be sure every message ends up delivered, with all the &lt;code&gt;{{placeholders}}&lt;/code&gt; replaced with the right values.&lt;/p&gt;

&lt;p&gt;What you can do with a CDP + Promotion Engine + CRM tools + checkout system tightly integrated thanks to the API-first capabilities?&lt;/p&gt;

&lt;p&gt;Pomelo, for one, used this approach to roll out a massive customer acquisition campaign together with a referral program. They built it in weeks and the project has been rewarded by Braze. We &lt;a href="https://www.voucherify.io/blog/fast-track-referral-program-voucherify-segment-braze-branch"&gt;prepared&lt;/a&gt; a step-by-step guide for glueing four API-first tools to achieve a similar effect.&lt;/p&gt;

&lt;p&gt;The list of use cases goes way beyond that. With tools like Braze’s Connected Content, you can wire personalized promotions to your messages by literally editing a message template.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZxFKgZfv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2Adjovng5S5p7VumZA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZxFKgZfv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2Adjovng5S5p7VumZA.png" alt="" width="800" height="634"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here’s a list of &lt;a href="https://github.com/voucherifyio/braze-connected-content/tree/main/connected-content-calls"&gt;Braze x Voucherify Liquid examples&lt;/a&gt; presenting some promotional scenarios.&lt;/p&gt;

&lt;p&gt;Building a wallet full of personalised incentives is one thing, but to move the needle with incentives you should make them easy-to-apply — we’ll zoom in on it now.&lt;/p&gt;

&lt;p&gt;🥡 &lt;strong&gt;Takeaways&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Promotions can be effective when wired to your messaging platform.&lt;/li&gt;
&lt;li&gt;Make sure to check how to work with a messaging queue in a scalable way.&lt;/li&gt;
&lt;li&gt;Modern engagement platforms have nifty tools for incorporating data into messages without complex development work, check them out before you open your IDE.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Beyond the manual promo codes — promotions UX
&lt;/h3&gt;

&lt;p&gt;Let’s sum up what we’ve achieved so far by connecting the CDP and the Promotion Engine.&lt;/p&gt;

&lt;p&gt;We have generated coupons (both public and bulk), used customer attributes and cart structure to define their eligibility, and injected them in places and messages across the customer journey. A successful promo code redemption is the single most essential event in the whole process. Let’s see how we can make it easier for the customer.&lt;/p&gt;

&lt;p&gt;Here’s a list of how you can shape your UI to put promo codes in motion:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clearly state the timeframe of the promotion.&lt;/li&gt;
&lt;li&gt;Automatically apply publicly available codes.&lt;/li&gt;
&lt;li&gt;Create a sales compilation page (Remember wallet? How about the one for not-logged users?)&lt;/li&gt;
&lt;li&gt;Enable filtering in your sales category.&lt;/li&gt;
&lt;li&gt;Be clear about the restrictions of promotion upfront.&lt;/li&gt;
&lt;li&gt;Leave the old price tag on.&lt;/li&gt;
&lt;li&gt;Include coupon code fields as a core part of both the shopping cart and checkout pages.&lt;/li&gt;
&lt;li&gt;For minimum-spend promotions, do the math for users and help them reach the spending target.&lt;/li&gt;
&lt;li&gt;Display an error message for invalid coupon codes.&lt;/li&gt;
&lt;li&gt;And &lt;a href="https://www.voucherify.io/blog/coupon-promotions-ui-ux-best-practices-inspirations"&gt;many more&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Including these ideas into your UI already takes time. But if you sell through web and mobile, the development work doubles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Listing used promo codes for specific customers&lt;/li&gt;
&lt;li&gt;Showing discounts eligible to VIP customers only&lt;/li&gt;
&lt;li&gt;Calculating total discount every time a product is added/removed from the cart&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where a fine-grained REST API comes into play. SaaS Promotion Engines have endpoints for these use cases. You just model the backend once and connect the touchpoints.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bonus&lt;/strong&gt; : need ideas for the UI? Here’s a &lt;a href="https://www.figma.com/community/file/1100356622702326488"&gt;Figma Kit&lt;/a&gt; with the most common promotion and coupon components.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LuKSOgmy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/940/0%2ATfD9DeosoTho73S0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LuKSOgmy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/940/0%2ATfD9DeosoTho73S0.jpg" alt="" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can improve promo code experience even more. Remember our product-specific discount? You might be wondering why use codes for a “buy one, get one free” use case at all. And you’re right — with an advanced Promotion Engine, you can drop codes altogether, just show the promotion banner and make the discount auto-applied every time a cart is recalculated or the customer’s attributes are changed.&lt;/p&gt;

&lt;p&gt;While &lt;a href="https://support.voucherify.io/article/519-create-cart-level-promotions"&gt;auto-applied cart-level promotions&lt;/a&gt; working with customer attributes give leeway for next-level bundling, you need to know when to double down on a promotion and when to stop it. Promotion Engines have a few handy tools for that.&lt;/p&gt;

&lt;p&gt;🥡 &lt;strong&gt;Takeaways&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Promotions are only as effective as their UX.&lt;/li&gt;
&lt;li&gt;Building top promotion experience requires gazillion lines of front-end code, Promotion Engines make it easier serving predictable promotion backend.&lt;/li&gt;
&lt;li&gt;Take a look at &lt;a href="https://www.figma.com/community/file/1100356622702326488"&gt;Coupon and Promotion Figma Kit&lt;/a&gt; to get inspiration for your frontend.&lt;/li&gt;
&lt;li&gt;Why not to get rid of promo codes, when you can calculate the discount based on the shopping context — see if your Promotion Engine supports it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  (Not) beyond the budget — fraud and margin protection
&lt;/h3&gt;

&lt;p&gt;It looks like we have everything ready to go after redemptions, higher sales, reengagement, you name it. We know how to counteract the enemy number one of promotional campaigns — lack of engagement. But nemesis number two is looming on the horizon — exceeding your margins and, simply, fraud.&lt;/p&gt;

&lt;p&gt;Your Promotion Engine controls the discount eligibility based on the cart information and customer behaviour so you’re already in a better position to fight back. But there’s still some work to be done.&lt;/p&gt;

&lt;p&gt;From the plethora of tools in your marketing toolbelt, promo codes are the family of “sharp knives” — ready for precise work but they carry the risk of hurting yourself. The biggest risks are losing money with too generous discounts and customers trying to abuse your offers.&lt;/p&gt;

&lt;p&gt;Example? Let’s assume your offer is $10 off for the “arabica coffee” category. When the margin for some SKUs is less than the discount, you start losing money. Worse, imagine customers buy the whole stock of these particular SKUs.&lt;/p&gt;

&lt;p&gt;How does a Promotion Engine protect you from the loss? There are three major features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic discounts — the offer is modified based on a formula. In the case of Voucherify, it can include parameters such as an order amount, cheapest product price, or any custom attribute like margin.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pVdmhp_b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2AAhoKfEgmLvtd8AHG.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pVdmhp_b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2AAhoKfEgmLvtd8AHG.png" alt="" width="800" height="195"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can soften the limits for specific segments e.g., your “loyal” tier, if you integrated CDP tightly with the rule engine.&lt;/li&gt;
&lt;li&gt;Global safety caps — again, Voucherify can impose:&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Redemption limits&lt;/strong&gt; : per customer, per day, per customer per day/month, per given campaign, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Budget limits&lt;/strong&gt; : total discounted amount, total orders’ value, etc.&lt;/li&gt;
&lt;li&gt;Promotion stacking — some promotions should be stacked in the specific order, some shouldn’t be stacked at all. A flexible Promotion Engine can work with such promotion dependencies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🥡 &lt;strong&gt;Takeaways:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To experiment with codes with lesser fraud and promo misuse, you need to set up a safety net.&lt;/li&gt;
&lt;li&gt;A Promotion Engine has dedicated features like parameterized discounts, budget limits, and stacking to prevent promotion loss.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Beyond the POC phase — when push comes to shove
&lt;/h3&gt;

&lt;p&gt;Digital promotions, especially promo codes, look very tempting to be adapted. They have a hidden cost, though. It’s complexity and compliance. When designing your Promotion Engine, you should look far ahead of the POC phase. While the path onwards is different for every digital team, there are some common obstacles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Marketer interface&lt;/strong&gt;  — the marketing team wants to change promotion conditions and touchpoints every day. No wonder, experimenting with the offer is what they get paid for. Enabling, disabling, searching, counting redemptions — they already call for some UI. Add approvals to the mix and you end up with a full-blown admin panel.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Internationalisation&lt;/strong&gt;  — if your pilot is successful, the next step is going abroad. Different currencies, labels, discount policies, or event product catalogs may break your promotion strategy in lots of tiny places.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security &amp;amp; fraud&lt;/strong&gt;  — once in a while you can hear a story about the promo code that unlocked a once in a lifetime deal for way too many customers. Sometimes the loss exceeds a decade-long licence for a Promotion Engine. But you can expect more risk out there. Fraud and malicious actors in your team do happen too (not to mention data leaks). When running dozens or &lt;a href="https://www.voucherify.io/customers/baemin"&gt;hundreds&lt;/a&gt; of promo code campaigns, investing in a coherent management suite with an audit log helps you sleep better.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy&lt;/strong&gt;  — promo codes earned a special place in the SPAM prevention algorithms not without a reason. Even without GDPR implications, you want to be complicit with customers’ preferences. A good CDP &amp;amp; Promo Engine tandem respects people’s contact choice from the outset.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scale&lt;/strong&gt;  — a well-crafted promo code can bring huge traffic to your store. We’ve seen this happen when one of our users &lt;a href="https://www.voucherify.io/customers/quintoandar"&gt;ran a TV ad&lt;/a&gt;. Wise men put in manuscripts that the code optimization shouldn’t be your default. But when your checkout crashes during the peak, you just killed the viral campaign — the holy grail of every consumer-facing business.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration&lt;/strong&gt;  — finally, the code responsible for connecting promotions to other ecommerce tools, data sources, and customer touchpoints might be hard to maintain. Flexible and predictable API with good documentation will help you save time needed for building and testing data integrity and workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🥡 &lt;strong&gt;Takeaways:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Non-functional requirements impact promotions too. Plan for them upfront, to pivot faster in the future 🚀&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Beyond the promo codes — how about a full-blown loyalty program?
&lt;/h3&gt;

&lt;p&gt;My friend plays in the symphonic orchestra. Apart from the full-size repertoire, they often play ensembles. Although I don’t plan to do so, I end up with a few tickets throughout the year. I love the experience of a small squad playing in a quaint place.&lt;/p&gt;

&lt;p&gt;When you look at your customer loyalty strategy, I believe the same rules apply. People will often appreciate a truly personalized deal more than a virtual reward from an earn-and-burn loyalty program. But just like you can’t ignore the sound of philharmonic, the CDP-powered loyalty scheme is becoming a must for DTC brands.&lt;/p&gt;

&lt;p&gt;How a CDP x Promotion Engine can help you build a loyalty scheme? By:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connecting promotions and revenue-management initiatives to loyalty mechanisms.&lt;/li&gt;
&lt;li&gt;Introducing points-plus-cash options to facilitate access to big-ticket rewards.&lt;/li&gt;
&lt;li&gt;Granting non-monetary offerings such as: exclusive events, early access, or unique discoveries.&lt;a href="https://www.voucherify.io/blog/paid-memberships-can-you-buy-loyalty"&gt;‍&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.voucherify.io/blog/paid-memberships-can-you-buy-loyalty"&gt;Paid membership&lt;/a&gt; where you can offer premium rewards that are too expensive to offer more broadly. Or, keep engagement with everyday discounts.&lt;a href="https://www.voucherify.io/blog/cashback-loyalty-program-guide"&gt;‍&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.voucherify.io/blog/cashback-loyalty-program-guide"&gt;Cashback programs&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Give customers more options to redeem points, such as donating their points to a charity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These use cases are even more complex software-wise. The good news is that when you battle test promo codes with CDP and a Promotion Engine, you have a solid setup for testing new incentives &amp;amp; reward programs in the next iterations.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at&lt;/em&gt; &lt;a href="https://www.voucherify.io/blog/cdp-based-loyalty-programs-for-retention"&gt;&lt;em&gt;https://www.voucherify.io&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>marketingtechnology</category>
      <category>segment</category>
      <category>customerdataplatform</category>
      <category>customerloyalty</category>
    </item>
    <item>
      <title>Amazon gift cards as referral program rewards with Incentives API &amp; Voucherify</title>
      <dc:creator>Mike Sedzielewski</dc:creator>
      <pubDate>Thu, 24 Aug 2023 08:20:51 +0000</pubDate>
      <link>https://dev.to/msedzielewski/amazon-gift-cards-as-referral-program-rewards-with-incentives-api-voucherify-43bg</link>
      <guid>https://dev.to/msedzielewski/amazon-gift-cards-as-referral-program-rewards-with-incentives-api-voucherify-43bg</guid>
      <description>&lt;p&gt;For better or for worse Amazon Gift Cards have become a standard in incentivizing customers and employees. Amazon Incentives API provides an easy and secure way of generating gift cards in real-time. Let’s see how we can make them a part of a referral program run with Voucherify.&lt;/p&gt;

&lt;h3&gt;
  
  
  What you can build with Amazon Incentives API
&lt;/h3&gt;

&lt;p&gt;The primary feature of the &lt;a href="https://developer.amazon.com/incentives-api" rel="noopener noreferrer"&gt;Amazon Incentives API&lt;/a&gt; is to create virtual Amazon gift cards in real-time. But it enables a bunch of other interesting digital incentive scenarios too:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login And Receive — recharge a new or existing customer’s Amazon account when they log in (Amazon Login SDK necessary).&lt;/li&gt;
&lt;li&gt;Activate Physical Gift Cards — programmatically activate physical gift cards purchased in bulk earlier.&lt;/li&gt;
&lt;li&gt;Product Vouchers — create a gift card for a specific product category only (specs controlled by Amazon &lt;a href="https://developer.amazon.com/docs/incentives-api/product-voucher-codes.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The API also provides some brick &amp;amp; mortar gift card activity capabilities, go to the &lt;a href="https://developer.amazon.com/incentives-api" rel="noopener noreferrer"&gt;docs&lt;/a&gt; to learn more.&lt;/p&gt;

&lt;p&gt;In this tutorial we’re going to cover real-time digital gift card generation which is a more secure and more convenient method to use them as referral rewards to buying gift cards in bulk.&lt;/p&gt;

&lt;h3&gt;
  
  
  API &amp;amp; portal access
&lt;/h3&gt;

&lt;p&gt;Only verified partners can access the Amazon Incentives API. Verified means that you have Amazon Incentives partner ID — this is different from AWS solution partner ID. You can get this by filling out this form &lt;a href="https://www.amazon-incentives.com/api/contact-us" rel="noopener noreferrer"&gt;https://www.amazon-incentives.com/api/contact-us&lt;/a&gt; (For the Polish marketplace I waited ~2 weeks but it was a holiday season.)&lt;/p&gt;

&lt;p&gt;Then, you can go to Step 2 of the &lt;a href="https://developer.amazon.com/docs/incentives-api/onboarding-process.html#step-2---setting-up-the-amazon-incentives-api-portal" rel="noopener noreferrer"&gt;onboarding guide&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The first API call
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; : Here’s a &lt;a href="https://www.postman.com/ltvdev/workspace/ltv-dev/collection/841083-3e3ed22c-9d39-47c7-94b2-f514408348b4?action=share&amp;amp;creator=841083" rel="noopener noreferrer"&gt;Postman collection&lt;/a&gt; with all API calls used in this tutorial.&lt;/p&gt;

&lt;p&gt;Let’s test the API by creating a fake gift card within their Sandbox environment. We need three keys to authenticate a request: credentials and partner ID we obtained in the previous step.&lt;/p&gt;

&lt;p&gt;To get credentials, go to /gc/corp/account/keys/, select Sandbox and create new access keys.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AHe5uZEx5sO75-e1m" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AHe5uZEx5sO75-e1m"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As with every Amazon service, the first step is to locate the right endpoint and region. For the Polish marketplace, the URL to Amazon Gift Codes On Demand (AGCOD) is &lt;a href="https://agcod-v2-eu-gamma.amazon.com/" rel="noopener noreferrer"&gt;https://agcod-v2-eu-gamma.amazon.com&lt;/a&gt; and the region is eu-west-1. You can find the reference &lt;a href="https://developer.amazon.com/docs/incentives-api/incentives-api.html#sandbox-endpoints" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ABlKSK74UiieFWi9C" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ABlKSK74UiieFWi9C"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, any request needs to be signed with &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html" rel="noopener noreferrer"&gt;Signature Version 4&lt;/a&gt; algo. If you test the API with Postman, then you can configure it in the Authorization tab as shown below (apart from credentials, remember to provide the respective region and service name: AGCODService).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AYavrSsWIYR72R7za" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AYavrSsWIYR72R7za"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;According to the &lt;a href="https://developer.amazon.com/docs/incentives-api/digital-gift-cards.html" rel="noopener noreferrer"&gt;spec&lt;/a&gt;, we need to send the following payload to the /CreateGiftCard endpoint.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;CreateGiftCardRequest&amp;gt;
  &amp;lt;creationRequestId&amp;gt;YourPartnerIDTSpecTest001&amp;lt;/creationRequestId&amp;gt;
  &amp;lt;partnerId&amp;gt;YourPartnerID&amp;lt;/partnerId&amp;gt;
  &amp;lt;value&amp;gt;
    &amp;lt;currencyCode&amp;gt;PLN&amp;lt;/currencyCode&amp;gt;
    &amp;lt;amount&amp;gt;10.00&amp;lt;/amount&amp;gt;
  &amp;lt;/value&amp;gt;
&amp;lt;/CreateGiftCardRequest&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Caveats&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;currencyCode needs to match the currency set up in your Amazon Incentives API account.&lt;/li&gt;
&lt;li&gt;creationRequestId needs to start with your partner id as a prefix.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By invoking the request, you should get something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;CreateGiftCardResponse&amp;gt;
  &amp;lt;gcClaimCode&amp;gt;GVFW-Y9DWGW-K5BQ&amp;lt;/gcClaimCode&amp;gt;
  &amp;lt;cardInfo&amp;gt;
    &amp;lt;value&amp;gt;
      &amp;lt;amount&amp;gt;10.0&amp;lt;/amount&amp;gt;
      &amp;lt;currencyCode&amp;gt;PLN&amp;lt;/currencyCode&amp;gt;
    &amp;lt;/value&amp;gt;
    &amp;lt;cardStatus&amp;gt;Fulfilled&amp;lt;/cardStatus&amp;gt;
  &amp;lt;/cardInfo&amp;gt;
  &amp;lt;gcId&amp;gt;4510447105517016&amp;lt;/gcId&amp;gt;
  &amp;lt;creationRequestId&amp;gt;YourPartnerIDTSpecTest001&amp;lt;/creationRequestId&amp;gt;
  &amp;lt;gcExpirationDate&amp;gt;Sun Aug 21 21:59:59 UTC 2033&amp;lt;/gcExpirationDate&amp;gt;
  &amp;lt;status&amp;gt;SUCCESS&amp;lt;/status&amp;gt;
&amp;lt;/CreateGiftCardResponse&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Status Fulfilled means that the gift card certificate stored in gcClaimCode is ready to be shipped to the customer.&lt;/p&gt;

&lt;p&gt;The developer portal should now be showing this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AXcS-7wFw4O4MBwF6" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AXcS-7wFw4O4MBwF6"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How to store gift cards
&lt;/h3&gt;

&lt;p&gt;Actually, you don’t need to. The AGCOD CreateGiftCard operation is idempotent, so if the API receives more than one request with the same creationRequestId, only the first request will result in the creation of a new gift card, and all subsequent responses will return the same original gift card. They will not be treated as different transactions.&lt;/p&gt;

&lt;p&gt;This means you can use your customer identifier (up to 40 alphanumeric chars) to differentiate gift cards. Keep in mind that the service is &lt;a href="https://developer.amazon.com/docs/incentives-api/incentives-api.html#throttle-rates" rel="noopener noreferrer"&gt;rate-limited&lt;/a&gt; with 10 requests per second.&lt;/p&gt;

&lt;p&gt;You can also import gift card codes to Voucherify. Importing them as regular codes will be helpful to track Amazon gift cards along with other rewards. The other way is to store them in a custom field in the Customer object.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing &amp;amp; error handling
&lt;/h3&gt;

&lt;p&gt;Because gift card API deals with money directly, your integration needs to be rock solid. Good news is that the AGCOD architects prepared a rock solid &lt;a href="https://developer.amazon.com/docs/incentives-api/test-plan.html" rel="noopener noreferrer"&gt;test plan&lt;/a&gt; for your integration. The &lt;a href="https://developer.amazon.com/docs/incentives-api/gift-codes-errors.html" rel="noopener noreferrer"&gt;error codes list&lt;/a&gt; is also well-documented.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AuZliOfjX3bQUI8oi" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AuZliOfjX3bQUI8oi"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Highlights&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In case of a mistake, you can cancel the gift card within 15 minutes after creation.&lt;/li&gt;
&lt;li&gt;You can simulate returning the error by any endpoint by providing a specific error code as a creationRequestId, e.g. F3003 will result in the endpoint returning F300 InsufficientFunds.&lt;/li&gt;
&lt;li&gt;Success response can be mocked by using mock code F0000.&lt;/li&gt;
&lt;li&gt;Six seconds is the recommended timeout for the client side application.&lt;/li&gt;
&lt;li&gt;If you suspect a bug at their end, the AGCOD team &lt;a href="https://developer.amazon.com/docs/incentives-api/outage-management.html" rel="noopener noreferrer"&gt;describes&lt;/a&gt; how and when they want to be bothered.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can monitor the available funds with the portal (/gc/corp/payments/notifications/), where you can also set up alerts for low balance:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ALOHNlSz1vyDkVFsp" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ALOHNlSz1vyDkVFsp"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or you can call /GetAvailableFunds, Sandbox will always return 0 though.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;GetAvailableFundsResponse&amp;gt;
  &amp;lt;availableFunds&amp;gt;
    &amp;lt;amount&amp;gt;0.0&amp;lt;/amount&amp;gt;
    &amp;lt;currencyCode&amp;gt;PLN&amp;lt;/currencyCode&amp;gt;
  &amp;lt;/availableFunds&amp;gt;
  &amp;lt;timestamp&amp;gt;20230821T154205Z&amp;lt;/timestamp&amp;gt;
  &amp;lt;status&amp;gt;SUCCESS&amp;lt;/status&amp;gt;
&amp;lt;/GetAvailableFundsResponse&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How to use Amazon Gift Cards in your referral program
&lt;/h3&gt;

&lt;p&gt;Earlier this year, Taxfix, a prominent provider of tax filing services in Germany, introduced a two-sided referral program to increase their presence in the German market. Individuals who successfully referred their friends received Amazon gift cards as rewards. The Taxfix development team employed Voucherify and Braze to manage the program, and the operational process unfolded as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2Aei1P1GTp5x_52NnM" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2Aei1P1GTp5x_52NnM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By utilizing Voucherify, they set up a customized referral program that allowed them to reward successful referrers with Amazon gift cards and invited friends with -50% discount codes on their first tax return with Taxfix.. With every referral code application, Voucherify would send a webhook notification to the Taxfix system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ADpdmUTT3xQmwjlyP" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ADpdmUTT3xQmwjlyP"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AAheCnCBhMJDLIqeA" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AAheCnCBhMJDLIqeA"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, they would call Amazon Incentives API to create rewards ($30 Amazon gift cards) for each successful referral.&lt;/p&gt;

&lt;p&gt;The Taxfix team used Braze to divide their audience into different groups and prioritize those who were most engaged. They strategically encouraged these engaged users to refer more people by sending them push notifications and emails. The referral messages contained a deep link that took advocates to a specific view in the app, where they could find their personalized referral code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F528%2F0%2AWAU4QabSmX9CoUv3" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F528%2F0%2AWAU4QabSmX9CoUv3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F592%2F0%2AMo_gDLLGXNfVr_fR" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F592%2F0%2AMo_gDLLGXNfVr_fR"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F608%2F0%2AJ7oA0d84nLJwKUNt" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F608%2F0%2AJ7oA0d84nLJwKUNt"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, to create an end-to-end referral reward experience, Taxfix:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generated referral codes in Voucherify.&lt;/li&gt;
&lt;li&gt;Defined the discount associated with the referral code.&lt;/li&gt;
&lt;li&gt;Defined a successful referral event — using the referral code during signup.&lt;/li&gt;
&lt;li&gt;Promoted referral program with Braze emails and push notifications including a deeplink to the referral view containing the referral code.&lt;/li&gt;
&lt;li&gt;When a referral event occured, they sent a webhook to the Taxfix backend system.&lt;/li&gt;
&lt;li&gt;Backend called the Amazon Incentives API to get a new gift card code and send it with a transactional email to the customer.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Scaling and improvements
&lt;/h3&gt;

&lt;p&gt;The scenario covers only a single marketplace. If you want to create gift cards for more countries, you need to get a partner ID for each supported country.&lt;/p&gt;

&lt;p&gt;You can think of other rewards and incentive campaigns, both digital and brick and mortar. For instance, you can use &lt;a href="https://developer.amazon.com/docs/incentives-api/product-voucher-guide.html" rel="noopener noreferrer"&gt;Product Vouchers&lt;/a&gt; to narrow down the gift scope to be applicable only to Education Assistance products or other &lt;a href="https://developer.amazon.com/docs/incentives-api/product-voucher-codes.html" rel="noopener noreferrer"&gt;good cause&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Another option is to replace Amazon gift cards with vouchers or discounts for your services. With Voucherify, you can manage &lt;a href="https://www.voucherify.io/gift-cards" rel="noopener noreferrer"&gt;digital gift cards&lt;/a&gt; and other incentives within one platform.&lt;/p&gt;

&lt;p&gt;If you want to discuss options or get some help, drop me a line.&lt;/p&gt;

</description>
      <category>softwareaarchitecture</category>
      <category>marketingtechnology</category>
      <category>aws</category>
    </item>
    <item>
      <title>LTV developer</title>
      <dc:creator>Mike Sedzielewski</dc:creator>
      <pubDate>Wed, 16 Aug 2023 09:51:06 +0000</pubDate>
      <link>https://dev.to/msedzielewski/ltv-developer-hjc</link>
      <guid>https://dev.to/msedzielewski/ltv-developer-hjc</guid>
      <description>&lt;p&gt;&lt;a href="https://www.theonion.com/"&gt;The Onion&lt;/a&gt; reports that the interdisciplinary research group dedicated to the investigation of the Anthropocene (AWG) has agreed to name the last decade ‘The Great Mobilification.’ Scientists characterize the era by the overflow of mobile devices used to distract humanity from the pain of being.&lt;/p&gt;

&lt;p&gt;Jokes aside, the distraction often takes the form of careless consumerism. Businesses that want a piece of this pie need to learn how to navigate the stream of distraction. They need to find a way to have the consumer pull over next to their offer, over and over again. This is impossible without technology and thus a developer.&lt;/p&gt;

&lt;p&gt;Dealing with this scale requires somebody who knows how to engineer data in the business context. This includes building data workflows and taking care of data integrity. But the ultimate goal is to recognize data patterns quickly and use them to drive revenue (or customer lifetime value [LTV]).&lt;/p&gt;

&lt;p&gt;I call this person an LTV developer.&lt;/p&gt;

&lt;p&gt;There are three traits an LTV developer should have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data expert&lt;/li&gt;
&lt;li&gt;Fluent with modern marketing APIs&lt;/li&gt;
&lt;li&gt;Doesn’t follow the “I did not complete the computer science degree, only to talk to mere marketers” rule.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because The Onion’s sources claim that developers prefer to abstract data away, favor open-source solutions and building from scratch, and don’t want to be bothered outside IDE, there’s a massive gap of the LTV dev on the market.&lt;/p&gt;

&lt;p&gt;Now supposing you want to fill the gap and break the bank, how do you start? While I don’t have an obligatory &lt;a href="https://roadmap.sh/"&gt;visual roadmap&lt;/a&gt; yet, I find this &lt;a href="https://phiture.com/mobilegrowthstack/what-is-the-mobile-growth-stack-426c6e474329"&gt;piece&lt;/a&gt; by Andy Carvell useful to picture the key areas.&lt;/p&gt;

&lt;p&gt;I’m also a lifelong believer that the best way to learn something is by doing. The following list provides hands-on developer tutorials from projects I’ve stumbled upon while building Voucherify and watching top digital teams that integrated our product.&lt;/p&gt;

&lt;p&gt;📚&lt;a href="https://medium.com/@msedzielewski/list/ltv-developer-03a38b62d705"&gt;LTV developer reading list&lt;/a&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>marketingtechnology</category>
    </item>
    <item>
      <title>How to make martech POCs easier</title>
      <dc:creator>Mike Sedzielewski</dc:creator>
      <pubDate>Mon, 14 Aug 2023 09:55:10 +0000</pubDate>
      <link>https://dev.to/msedzielewski/how-to-make-martech-pocs-easier-2pdl</link>
      <guid>https://dev.to/msedzielewski/how-to-make-martech-pocs-easier-2pdl</guid>
      <description>&lt;p&gt;Creating POCs in marketing technology has become a lot easier. Especially for someone like me — an ex-programmer who last coded professionally 10 years ago. Recently I’ve found 3 things particularly helpful:&lt;/p&gt;

&lt;p&gt;1) Developer-first platforms with predictable documentation, sandboxes, and transparent pricing so I don’t need to go through mundane “discovery sessions”&lt;/p&gt;

&lt;p&gt;2) &lt;a href="https://twitter.com/Replit"&gt;@Replit&lt;/a&gt;— an IDE from the “it just works” family. No time wasted on environment setup, true single-click hosting. Also, the repo forking is a hidden gem of Replit — you can share a repo with your team, they just change secrets, start dabbling on their own, and then they can deploy it right away. Finally, ghostwriter — Replit’s copilot alternative that helps me stay in the zone when I’m looking up CSS syntax.&lt;/p&gt;

&lt;p&gt;3) &lt;a href="https://twitter.com/htmx_org"&gt;@htmx_org&lt;/a&gt; — lets me skip a decade of JS ecosystem “advancements” to get some interactivity done. These might seem of little value to a true coder but for a busy solutions architect or a tech-savvy marketer, this is huge (as I’m getting older, I tend to cherish simple products that help me save my CPU ticks).&lt;/p&gt;

&lt;p&gt;Here’s a recent showcase: &lt;a href="https://fun-with-promo-codes.sedzia.repl.co"&gt;https://fun-with-promo-codes.sedzia.repl.co&lt;/a&gt; This is a basic demo showing how to integrate &lt;a href="https://twitter.com/voucherifyio"&gt;@voucherifyio&lt;/a&gt; and &lt;a href="https://twitter.com/bannerbearHQ"&gt;@bannerbearHQ&lt;/a&gt; to generate visuals for parametrized promo codes like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mJtcU_rI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1000/0%2AWkyybs8da_OfQaNM" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mJtcU_rI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1000/0%2AWkyybs8da_OfQaNM" alt="Voucherify and Bannerbear integration" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;BTW Bannerbear is a joy to work with — intuitive, smart defaults, easy to integrate with. Impressive feature set when you consider their headcount &lt;a href="https://twitter.com/yongfook"&gt;@yongfook&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can find the repo here &lt;a href="https://replit.com/@sedzia/Fun-with-promo-codes#readme.md"&gt;https://replit.com/@sedzia/Fun-with-promo-codes#readme.md&lt;/a&gt;&lt;/p&gt;

</description>
      <category>marketingtechnology</category>
      <category>replit</category>
      <category>api</category>
    </item>
    <item>
      <title>The Challenges of Managing Promo Codes: A Syntax.fm Case Study</title>
      <dc:creator>Mike Sedzielewski</dc:creator>
      <pubDate>Mon, 14 Aug 2023 09:54:26 +0000</pubDate>
      <link>https://dev.to/msedzielewski/the-challenges-of-managing-promo-codes-a-syntaxfm-case-study-25n5</link>
      <guid>https://dev.to/msedzielewski/the-challenges-of-managing-promo-codes-a-syntaxfm-case-study-25n5</guid>
      <description>&lt;p&gt;Developers keep asking me why you need a promo engine when you can implement it yourself in a flash. From now on, I’ll show them this — the last episode of the Syntax podcast, where &lt;a href="https://twitter.com/wesbos"&gt;@wesbos&lt;/a&gt; and&lt;a href="https://twitter.com/stolinski"&gt;@stolinski&lt;/a&gt; talk about the tech stack for Syntax x &lt;a href="https://twitter.com/getsentry"&gt;@getsentry&lt;/a&gt; giveaway campaign.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The last episode of the Syntax podcast:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/syntax/the-syntax-giveaway-site-codes-bots-tech-stack-and-more"&gt;The Syntax Giveaway Site - Codes, Bots, Tech Stack and More!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CSSzlm28--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/752/0%2AG6hNRiOiUTC8Sic8" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CSSzlm28--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/752/0%2AG6hNRiOiUTC8Sic8" alt="Syntax web development podcast" width="752" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Truth be told, I stumbled upon this episode by accident. Everyday, I inject myself with dopamine by watching “Voucherify” being mentioned all over the internet (thanks &lt;a href="https://www.linkedin.com/company/brand24-s-a/"&gt;Brand24&lt;/a&gt;). Not everyday, however, a 350k-followers-strong developer mentions your brand in his podcast.&lt;/p&gt;

&lt;p&gt;When it happens, you drop everything you’ve been doing and listen to the whole episode. I did so and the content wasn’t disappointing!&lt;/p&gt;

&lt;p&gt;Wes and Scott discuss their recent &lt;a href="https://swag.syntax.fm/"&gt;giveaway campaign&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R_tE2WGJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/815/0%2ANJum2KeBYrYtMbOo" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R_tE2WGJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/815/0%2ANJum2KeBYrYtMbOo" alt="Syntax and Sentry giveaway campaign" width="800" height="982"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They joined Sentry (a top platform btw, we’re using it in Voucherify) and decided to celebrate in the best possible way: by giving people some SWAG.&lt;/p&gt;

&lt;p&gt;To get the SWAG, you had to find a promo code sprinkled around the internet to have it redeemed later on a website.&lt;/p&gt;

&lt;p&gt;Syntax x Sentry Giveaways is one of these little, short-lived projects where you want to play with a new tech stack and Get Something Done in 2 hours tops. After all, it’s just 700 random codes representing: 600 t-shirts, 50 skate decks and 50 yeti ramblers.&lt;/p&gt;

&lt;p&gt;But, even so, it highlights all the challenges with managing promo codes in a nutshell:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;generating unique, hard-to-guess coupon codes — codes should be long enough to be brute-force-proof (to achieve this, Scott used our &lt;a href="https://www.voucherify.io/generator"&gt;free code generator&lt;/a&gt;, hence the mention)&lt;/li&gt;
&lt;li&gt;managing the code’s state (active, locked, used) and owner — no two users should get the same code (What if Wes and Scott want to publish a bulk of 10 codes at the same time? What if they wanted to release the locked codes 30 minutes before the show? How to make sure a single user gets only one code?)&lt;/li&gt;
&lt;li&gt;supporting multiple promo code types (“premium” / “standard”) — some codes should carry a different deal than others&lt;/li&gt;
&lt;li&gt;fraud protection — the system should be prepared for users who want to exploit it. (Wes claims some agents recruited their home-grown botnets to get the priceless SWAG 🤯. This caused a massive traffic spike (~1.6m requests), so Wes had to react in real-time by rolling out an in-memory cache to filter out malicious requests.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the end, a 2-hour-tops project turned into a few days of work for seasoned developers, a series of hotfixes to production, and significant traffic in the cloud.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OXD92sFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2ArTULyXhi5zLmipUt" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OXD92sFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2ArTULyXhi5zLmipUt" alt="Challenges with managing promo codes" width="800" height="1123"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I recommend listening to the whole &lt;a href="https://dev.to/syntax/the-syntax-giveaway-site-codes-bots-tech-stack-and-more"&gt;podcast&lt;/a&gt; to get the full picture and some tasty insights on the tech stack Wes and Scott have chosen for the project (&lt;a href="https://www.linkedin.com/company/vercel/"&gt;Vercel&lt;/a&gt;, Svetle, &lt;a href="https://www.linkedin.com/company/prisma-io/"&gt;Prisma&lt;/a&gt;, &lt;a href="https://www.linkedin.com/company/planetscale/"&gt;PlanetScale&lt;/a&gt;, &lt;a href="https://www.linkedin.com/company/getsentry/"&gt;Sentry (sentry.io)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Compared to a regular ecommerce campaign, it’s just a tiny, one-off marketing campaign. If Syntax.fm would like to scale it in future, the number of challenges would increase proportionally. At least, this is what we’ve seen when working with customers over the years.&lt;/p&gt;

&lt;p&gt;At Voucherify, we’ve been building an API-first promotion engine to help devs overcome these issues with just a few lines of codes (or 2 hours tops 🙃). We also wanted to give teams an admin panel to control promo codes without committing to prod for every business change. Finally, Voucherify is ready for scale and fraud — we handle millions of code validations a day, we can rate-limit requests from a given IP address, you can stop a campaign when you hit your targets, and many more.&lt;/p&gt;

</description>
      <category>api</category>
      <category>marketing</category>
    </item>
    <item>
      <title>Decoding Commercetools Integration: A Peek Behind the Scenes</title>
      <dc:creator>Mike Sedzielewski</dc:creator>
      <pubDate>Fri, 11 Aug 2023 15:06:26 +0000</pubDate>
      <link>https://dev.to/msedzielewski/decoding-commercetools-integration-a-peek-behind-the-scenes-334b</link>
      <guid>https://dev.to/msedzielewski/decoding-commercetools-integration-a-peek-behind-the-scenes-334b</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7-gvgCYt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/800/1%2ABHhlMlxp66LarqFycyCdGA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7-gvgCYt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/800/1%2ABHhlMlxp66LarqFycyCdGA.jpeg" alt="" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This week Voucherify announced the commercetools connector. Integrating with another MACH tool gave us a unique chance to assess our product. By using APIs for a concrete use case, we could explore two POVs:&lt;br&gt;&lt;br&gt;
👉 What we can learn from &lt;a href="https://www.linkedin.com/company/machalliance/"&gt;MACH Alliance&lt;/a&gt; founders &amp;amp; leaders&lt;br&gt;&lt;br&gt;
👉 Is our API as dev-friendly as we want it to be?&lt;/p&gt;

&lt;p&gt;Re 1) I talked to our devs about what they like about CT API. Among other things, the API Extension model was praised as “webhooks on steroids’’. Unlike webhooks, the synchronous and time-sensitive nature of API Extension makes it more predictable to work with (and boy we have been struggling with some pain-in-the-neck webhook mechanisms for some time).&lt;/p&gt;

&lt;p&gt;The flexibility of this model and the requests chaining policy are also well thought of. You can do pretty much everything with an active order and pass all the relevant info further to subsequent call-outs.&lt;/p&gt;

&lt;p&gt;commercetools API has some learning curve for sure, but once you grasp the basics and install the SDK you don’t need docs on the side to understand what’s in the “cart” and other objects passed with a request. When you add to it a CLI task that registers a local ngrok instance as a target endpoint for API Extensions, you — as &lt;a href="https://www.linkedin.com/in/ACoAAAx6gBYBQFbJ3d11D-MOtHfY5AD-jtDP0B4"&gt;Michał Moczulski&lt;/a&gt; puts it — “forget you’re working with external SaaS.”&lt;/p&gt;

&lt;p&gt;Hats off to &lt;a href="https://www.linkedin.com/in/ACoAAABIk90BajMmOMdE1FcLgzdxuG_mXl3CM0Q"&gt;Kelly Goetsch&lt;/a&gt; and the team 👌&lt;/p&gt;

&lt;p&gt;Re 2) The connector highlighted some gaps in our docs and SDKs. One thing that was clearly missing are sequence diagrams showing the order of API calls (like this one 👇)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v4GmDyzR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A9o8-QAffvMd85SSCUva19g.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v4GmDyzR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A9o8-QAffvMd85SSCUva19g.jpeg" alt="" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;BTW I learned about mermaid (&lt;a href="https://mermaid.js.org/#/"&gt;https://mermaid.js.org/#/&lt;/a&gt;) which gives you grammar for building diagrams in your editor (and github can render it right away). Cool thing for automating product marketing too.&lt;/p&gt;

&lt;p&gt;As for the connector itself, it’s open source so you can see how we implemented a few unique discounting features such as applying many promo codes/gift cards/etc at the same time.&lt;/p&gt;

&lt;p&gt;But our integration team (&lt;a href="https://www.linkedin.com/in/ACoAAAuaYA4BCGSn2pyuKM_bKUO7Oq1aZFUdsVE"&gt;Marcin Ślęzak&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/ACoAAC7AKPcB-nlUqKeVIt0vLm3FwDoifxIz2to"&gt;Tomasz Łochmańczyk&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/ACoAAAx6gBYBQFbJ3d11D-MOtHfY5AD-jtDP0B4"&gt;Michał Moczulski&lt;/a&gt;) is pushing new features. If you want to stay updated, star ⭐️ the repo on Github or join our Slack channel.&lt;/p&gt;

&lt;p&gt;Links:&lt;br&gt;&lt;br&gt;
&lt;a href="https://github.com/voucherifyio/commerce-tools-integration"&gt;https://github.com/voucherifyio/commerce-tools-integration&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://community.voucherify.io/"&gt;https://community.voucherify.io/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>headlesscommerce</category>
      <category>commercetools</category>
      <category>api</category>
    </item>
    <item>
      <title>How to Fast-track a Referral Program with Voucherify, Segment, Braze, and Branch?</title>
      <dc:creator>Mike Sedzielewski</dc:creator>
      <pubDate>Thu, 10 Aug 2023 10:13:17 +0000</pubDate>
      <link>https://dev.to/msedzielewski/how-to-fast-track-a-referral-program-with-voucherify-segment-braze-and-branch-2lpk</link>
      <guid>https://dev.to/msedzielewski/how-to-fast-track-a-referral-program-with-voucherify-segment-braze-and-branch-2lpk</guid>
      <description>&lt;p&gt;&lt;a href="https://www.voucherify.io/referral-programs"&gt;Referral programs&lt;/a&gt; have long been hailed as one of the most effective marketing strategies to acquire new customers, increase customer loyalty, and boost revenue. However, running a successful referral program requires careful planning, execution, and the right set of tools to achieve optimal results. In today’s fast-paced digital landscape, leveraging the power of technology and automation is crucial to maximize the potential of your referral program.&lt;/p&gt;

&lt;p&gt;In this post, we will explore how you can fast-track your referral program using the powerful combination of Voucherify, &lt;a href="https://www.voucherify.io/integrations/segment"&gt;Segment&lt;/a&gt;, &lt;a href="https://www.voucherify.io/integrations/braze"&gt;Braze&lt;/a&gt;, and Branch. These four cutting-edge platforms offer an integrated solution to build your referral campaigns in days. In this guide, I will recreate the success story of &lt;a href="https://www.voucherify.io/blog/how-pomelo-supercharged-their-promotions-with-voucherify-and-braze"&gt;Pomelo Fashion&lt;/a&gt; and their award-winning low-code referral campaign.&lt;/p&gt;

&lt;h3&gt;
  
  
  What were the rules of Pomelo’s referral program?
&lt;/h3&gt;

&lt;p&gt;Pomelo Fashion created a highly personalized messaging experience by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Streaming user data into &lt;a href="https://segment.com/"&gt;Segment&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Creating relevant referral messages in &lt;a href="https://www.braze.com/"&gt;Braze&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Using &lt;a href="https://branch.io/"&gt;Branch&lt;/a&gt; deeplinks to ensure that users land on the app page &amp;amp; app store.&lt;/li&gt;
&lt;li&gt;Leveraging &lt;a href="https://www.voucherify.io/"&gt;Voucherify&lt;/a&gt; to deliver personalized messages and manage the referral codes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v-19SPhF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2A-S9XhjBXvCJD1CiU.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v-19SPhF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2A-S9XhjBXvCJD1CiU.png" alt="Pomelo referral program workflow" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pomelo launched a two-sided referral program which rewarded both the advocate and their friends. When it comes to the promotional logic, several requirements had to be met to ensure that the campaign drives customer acquisition while &lt;a href="https://www.voucherify.io/blog/blowing-the-whistle-how-to-combat-referral-abuse-and-fraud"&gt;preventing referral fraud and misuse&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Friend is not an existing Pomelo customer.&lt;/li&gt;
&lt;li&gt;Friend uses advocate’s code to make their first Pomelo purchase.&lt;/li&gt;
&lt;li&gt;Friend gets 200 THB off their purchase.&lt;/li&gt;
&lt;li&gt;Advocate gets 200 THB coupon sent to their account EVERY TIME a new friend becomes a customer.&lt;/li&gt;
&lt;li&gt;Friends referrals should work on both web and mobile channels.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But the real difficulty had to do with Pomelo’s scale. As an industry leader, Pomelo serves millions of customers in a dozen different countries. The real challenge was to launch, and more importantly, maintain the marketing agility of the referral campaign across markets and teams in a limited time frame for launching the campaign.&lt;/p&gt;

&lt;h3&gt;
  
  
  API-based building blocks of the referral campaign
&lt;/h3&gt;

&lt;p&gt;Pomelo believes that with the right technology and marketing strategy, it’s possible to make personalization happen responsively, and at a massive scale.&lt;/p&gt;

&lt;p&gt;As personalization today means crunching large volumes of customer data and synchronizing them across sparse systems and databases, Pomelo has become a power user of API-first platforms.&lt;/p&gt;

&lt;p&gt;Here’s how they connected them to achieve:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster time-to-market.&lt;/li&gt;
&lt;li&gt;Personalization flexibility.&lt;/li&gt;
&lt;li&gt;Traffic spikes handled.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, let’s get our hands dirty recreating this setup. Before we continue, make sure you have these provided:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Voucherify, Braze, Branch, and Segment accounts (we need the API keys).&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.postman.com/"&gt;Postman&lt;/a&gt; (or any other tool allowing you to send and receive HTTP requests). We’re going to use it to simulate an app and backend exchanging messages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Note: Follow these links to find API documentation of&lt;/em&gt; &lt;a href="https://docs.voucherify.io/docs/authentication"&gt;&lt;em&gt;Voucherify&lt;/em&gt;&lt;/a&gt;&lt;em&gt;,&lt;/em&gt; &lt;a href="https://segment.com/docs/connections/find-writekey/"&gt;&lt;em&gt;Segment&lt;/em&gt;&lt;/a&gt;&lt;em&gt;,&lt;/em&gt; &lt;a href="https://www.braze.com/docs/api/basics/"&gt;&lt;em&gt;Braze&lt;/em&gt;&lt;/a&gt;_, and &lt;a href="https://help.branch.io/developers-hub/reference/apis-overview"&gt;&lt;em&gt;Branch&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: if you want to brush up on Postman and operating API-first platforms in general, you can visit our introductory &lt;a href="https://www.smashingmagazine.com/2019/01/api-based-platforms-product-managers/"&gt;&lt;em&gt;article&lt;/em&gt;&lt;/a&gt;&lt;/em&gt;._&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; &lt;a href="https://drive.google.com/file/d/14tM3DiYY32Y8junVabLTh5oKogdAV2S_/view?usp=sharing"&gt;&lt;em&gt;here&lt;/em&gt;&lt;/a&gt; &lt;em&gt;you can find the Postman collection of the requests we use in this tutorial.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1 — Populate users across platforms (Segment)
&lt;/h3&gt;

&lt;p&gt;Before we jump into the referral logic design, we need to ensure the basics are in place. The first thing on the list is the &lt;strong&gt;customer data integrity&lt;/strong&gt;  — we’ll make sure a customer gets identified properly on every platform.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn more&lt;/strong&gt; : &lt;a href="https://www.voucherify.io/blog/technical-aspects-of-customer-segmentation-part-2-data-integrity"&gt;Customer segmentation — how to ensure data integrity?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s imagine a new user signing up to our shop. We need to populate this information to Braze, Branch, and Voucherify to make the customer data actionable. That’s a perfect task for &lt;a href="https://www.voucherify.io/integrations/segment"&gt;Segment&lt;/a&gt;. It provides a coherent abstraction for identifying customers, tracking their behavior on various touchpoints and distributing these data to relevant systems.&lt;/p&gt;

&lt;p&gt;Off we go to Segment. We’ll create the first connection. The connection will receive data from an app or actually its backend (source) and will send it to Braze and Voucherify (destinations).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn more&lt;/strong&gt; : &lt;a href="https://www.voucherify.io/blog/voucherify-and-segment-how-to-effectively-use-customer-attributes-for-personalized-promotions"&gt;How to use Segment custom attributes to personalize promotions?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;strong&gt;Sources&lt;/strong&gt; , add a new &lt;a href="https://segment.com/docs/connections/sources/"&gt;source&lt;/a&gt; and choose &lt;a href="https://segment.com/docs/connections/sources/catalog/libraries/server/http-api/"&gt;HTTP API option&lt;/a&gt;. This allows you to fire HTTP requests to Segment’s severs from Postman. Name the source and optionally add labels to filter sources in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wkAE9CQ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AfnwZ08RfeO3O3hLUGvAZ5Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wkAE9CQ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AfnwZ08RfeO3O3hLUGvAZ5Q.png" alt="How to set up the source in Segment" width="800" height="260"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Set up the Source in Segment&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let’s test the connection. Click on the source and copy your write key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jr76mJA2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AXXDvILe51ohJuztPR2afKA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jr76mJA2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AXXDvILe51ohJuztPR2afKA.png" alt="Illustration showing how to copy the Write Key" width="800" height="275"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Copy the Write Key&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, open Postman and create a new API request.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change the method to  &lt;strong&gt;POST&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Set URL to&lt;a href="https://api.segment.io/v1/identify"&gt;https://api.segment.io/v1/identify.&lt;/a&gt;‍&lt;/li&gt;
&lt;li&gt;In the Authorization tab, select Basic Auth as TYPE and provide your Segment API key as Username.&lt;/li&gt;
&lt;li&gt;Go to Body, select Raw and JSON. Place the following snippet in the body:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "userId": "jim@dundermifflinpaper.com",
  "traits": {
    "email": "mike+jim@voucherify.io",
    "name": "Jim Halpert"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;For simplicity, we’re using emails as customer identifiers and&lt;a href="https://support.google.com/a/users/answer/9308648?hl=en"&gt;email aliases&lt;/a&gt; to test messages.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1o1CSjmf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2Azd6gSYpSwKxCbMiXeRKUWw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1o1CSjmf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2Azd6gSYpSwKxCbMiXeRKUWw.png" alt="Authorizing API connection" width="800" height="342"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Authorize API connection&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X_r-jYlP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AJovxfuAe7Usij0b9aozuVQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X_r-jYlP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AJovxfuAe7Usij0b9aozuVQ.png" alt="An example of API request in Postman" width="800" height="323"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Exemplary API request&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The customer data above serves as an example. To test the Segment API connection, you need to provide userID, email address, and customer name. Now SEND the request. When you see &lt;em&gt;“success”: true&lt;/em&gt;, open &lt;strong&gt;Debugger&lt;/strong&gt; in Segment. You should see a confirmation that your source has received data from Postman.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Hi6xMGn---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AEFGh7sa_4GgSwXrEXnCfsQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Hi6xMGn---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AEFGh7sa_4GgSwXrEXnCfsQ.png" alt="Checking the API connection in Segment" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Check the API connection&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now that we have the source listening for requests, let’s pass them to Braze and Voucherify.&lt;/p&gt;
&lt;h4&gt;
  
  
  Add Voucherify as Destination
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Destinations&lt;/strong&gt; and click Add Destination.&lt;/li&gt;
&lt;li&gt;Select Voucherify from the Catalog and configure the integration.&lt;/li&gt;
&lt;li&gt;Get your API keys and paste them into Segment. You can find your keys in the&lt;a href="https://docs.voucherify.io/docs/authentication"&gt;Project Settings&lt;/a&gt; in the Voucherify dashboard. Make sure the API URL corresponds with your&lt;a href="https://docs.voucherify.io/docs/api-endpoints"&gt;Voucherify settings&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Voucherify Application ID serves as Segment’s API Key. Voucherify Secret Key is Segment’s API Token.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZrmHcDHo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AAN5tZ96s6tFPi4H-RPY_Dw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZrmHcDHo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AAN5tZ96s6tFPi4H-RPY_Dw.png" alt="Voucherify integrations configuration" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Configure Voucherify integration&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Next, switch on your destination and go to &lt;strong&gt;Event Tester&lt;/strong&gt;. Select Identify as Event Type and Send Event. On the right hand side, you should see the confirmation that Voucherify has created a test user. Likewise, when you go to Customers in Voucherify dashboard, you should see the newly-created test user.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e9HxhLNL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AhU0dVgHo_Aq94fcpPbpbcw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e9HxhLNL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AhU0dVgHo_Aq94fcpPbpbcw.png" alt="Illustration showing how to test Voucherify destination" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Test the Voucherify destination&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Add Braze as Destination
&lt;/h4&gt;

&lt;p&gt;Adding Braze destination is quite similar, here’s how the settings might look like (make sure your REST API key has User Data permissions). You will find the data you need in the &lt;strong&gt;App Settings&lt;/strong&gt; in Braze.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YawqgtYg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2Ane8TswGc2PcRDg8Tr3j5zA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YawqgtYg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2Ane8TswGc2PcRDg8Tr3j5zA.png" alt="How to add Braze as a destination" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Set up Braze destination&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, the final task in this step is to activate the whole workflow. Ensure that both destinations are switched on, go back to Postman and hit SEND once again. Segment will receive the request and translate it in a way it’s digestible by Voucherify and Braze. As a result, the Jim Halpert should be visible on both platforms.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oRQQtH3Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AfbLRTcmGKjUxd5-rsUWTCw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oRQQtH3Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AfbLRTcmGKjUxd5-rsUWTCw.png" alt="How to test the Connection by sending an API request" width="800" height="207"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Test the Connection by sending an API request&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 2 — Generate referral codes (Voucherify)
&lt;/h3&gt;

&lt;p&gt;Now that we have our customers synced, let’s invite them to join the referral program. We’ll start off with generating referral codes with Voucherify. Begin by providing general details of your referral program.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new Referral Codes campaign.&lt;/li&gt;
&lt;li&gt;Define the name and the code pattern for our program (you might want to give a prefix and remove misleading characters like O, 5, I from referral codes).&lt;/li&gt;
&lt;li&gt;Impose some time limits, they’re optional but usually of high importance for the success of a campaign.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Learn more&lt;/strong&gt; : &lt;a href="https://www.voucherify.io/blog/how-to-create-a-referral-program-that-works"&gt;How to build a referral program?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V8cPQ4BO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AZA217LEshVE3VTBYUMuzXQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V8cPQ4BO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AZA217LEshVE3VTBYUMuzXQ.png" alt="Setting up referral programme details in Voucherify" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Provide general details of your referral program&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The third stage is essential. Here, we need to design on what conditions Voucherify should reward people. In our case, we want to give 200 THB to both advocate and new customer so we choose &lt;strong&gt;double-sided reward&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now to the conversion event. By default, Voucherify awards advocates when their referral code gets&lt;a href="https://docs.voucherify.io/docs/redemption"&gt;redeemed&lt;/a&gt;. Sometimes, however, this isn’t enough to account for a successful referral. You might want to wait for the shipping or event return period. That’s why Voucherify enables you to define a custom event for this purpose (whenever Voucherify receives such an event via API, the valid referral is counted).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---LmchhE2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A5jwH0EfjAvCsrE646wSk8w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---LmchhE2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A5jwH0EfjAvCsrE646wSk8w.png" alt="How to choose referral program workflow in Voucherify" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Set up the referral program workflow&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We know when a customer gets awarded, but we’re still missing the actual reward. Proceed to the next screen to set it up. First, we define how we award referred friends — in our case it’s a discount coupon worth 200 THB.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VGgvkbdN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2Ao0NN5dnw8tlouqd6rf1bCA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VGgvkbdN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2Ao0NN5dnw8tlouqd6rf1bCA.png" alt="Creating referral rewards for invited customers" width="800" height="476"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Create referral reward for invited customers&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;At this point, we should think of some ground rules of the program. First, a friend should be referred only once. Second, we might want to increase the spend with minimal cart value for the referred customer’s first order. Finally, we can exclude customers from the program based on any attribute like location or payment method. Voucherify validation rules builder will help you achieve that with a simple editor.&lt;/p&gt;

&lt;p&gt;Let’s skip Referrer Reward and Notifications steps (we’ll come back to them in a minute) and save the campaign. In this way, Voucherify will be ready to generate referral codes.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 3 — Assign referral codes to user profiles (Braze)
&lt;/h3&gt;

&lt;p&gt;It’s time to actually invite customers to the referral program. First, let’s call the Segment identify again to have at least two users. Here is an exemplary API call:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "userId": "michael@dundermifflinpaper.com",
  "traits": {
    "email": "mike+michael@voucherify.io",
    "name": "Michael Scott"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, let’s create a Braze campaign that calls Voucherify to get a unique referral code and assigns it to every new user. To do so, we’ll use &lt;a href="https://www.braze.com/docs/user_guide/personalization_and_dynamic_content/connected_content/"&gt;Connected Content&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new email campaign.&lt;/li&gt;
&lt;li&gt;Select your template and come up with an email copy.&lt;/li&gt;
&lt;li&gt;Switch to HTML editor and paste the following snippet somewhere within the  tag (preferably between &lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt; tags), substituting API credentials and the referral campaign identifier (get it from the URL in the Voucherify dashboard).


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{% assign campaign_id = {{campaign.${api_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = campaign_id | append: customer_id %}
{% connected_content https://api.voucherify.io/v1/publications 
:method post 
:headers { "X-App-Id": "YOUR APP ID", "X-App-Token": "YOUR APP SECRET" } 
:body campaign=camp_YOUR_CAMPAIGN_ID&amp;amp;customer={{${user_id}}}&amp;amp;channel=Braze&amp;amp;source_id={{source_id}} 
:content_type application/json 
:save publication %}
&lt;/code&gt;&lt;/pre&gt;


&lt;ul&gt;
&lt;li&gt;In the HTML editor, put &lt;code&gt;{{publication.voucher.code}}&lt;/code&gt; where you want to display the code.&lt;/li&gt;
&lt;li&gt;Set up other parameters of the campaign and save it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--89g7RClT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2ASWP9VUbhk7cLs0ucqKfWqw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--89g7RClT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2ASWP9VUbhk7cLs0ucqKfWqw.png" alt="How to leverage Braze Connected Content functionality" width="800" height="348"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Use Braze Connected Content functionality&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We’ve used Scheduled Delivery with immediate send-out. However, you can trigger the email send-out based on multiple events and attributes.&lt;/p&gt;

&lt;p&gt;Once the campaign is launched, this happens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Voucherify generates a new unique referral code according to the pattern we defined.&lt;/li&gt;
&lt;li&gt;Voucherify publishes it to a user whose id is sent with Connected Content API call. (Once published, it won’t be used again for another user).&lt;/li&gt;
&lt;li&gt;Voucherify sends the new code back to Braze as a response to the API call.&lt;/li&gt;
&lt;li&gt;Braze puts the code in the right place and sends the email.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If everything worked as planned, we should receive emails and unique referral codes assigned to Jim and Michael in their Voucherify profiles.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eQ_Uy-g_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/959/1%2AVnqe0IU3AbNePxV4mHf_ag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eQ_Uy-g_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/959/1%2AVnqe0IU3AbNePxV4mHf_ag.png" alt="An example of referral email from Braze" width="800" height="510"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Receive referral email from Braze&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--u9f1G5Rt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AJBZAaPDYWyS0DtQrmsYd-A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--u9f1G5Rt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AJBZAaPDYWyS0DtQrmsYd-A.png" alt="Referral code is assigned to customer in Voucherify dashboard" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;A new referral code is assigned to Jim&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Bonus step — upload codes to user profiles in Braze
&lt;/h3&gt;

&lt;p&gt;Thanks to Connected Content, Braze was able to send the assigned referral code in a message. However, it won’t be persisted in the Braze user profile. You might want to upload it to have it at your fingertips for further campaign engagement.&lt;/p&gt;

&lt;p&gt;To achieve this, you can configure the referral campaign to send corresponding referral codes via Custom Attribute.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Let’s edit our referral campaign in Voucherify.&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;Notifications&lt;/strong&gt; and select Send referral code to the referrer.&lt;/li&gt;
&lt;li&gt;Scroll down and select Braze as a channel. (You’ll need a Braze API key with users.track permission enabled.)&lt;/li&gt;
&lt;li&gt;Provide the name of Custom Attribute that will store the referral code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DkpLpKSF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AD4B_EV8MgbtFx9NBRh03cg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DkpLpKSF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AD4B_EV8MgbtFx9NBRh03cg.png" alt="How to set up referral program notifications in Voucherify" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Set up referral program notifications&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Save the campaign. From now on, every new Connected Call will populate the &lt;em&gt;referral_code&lt;/em&gt; attribute of a user in Braze.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lGEM7W28--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AF9VgIoNLY02QNh53pSz7oA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lGEM7W28--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AF9VgIoNLY02QNh53pSz7oA.png" alt="How to store referral codes in Braze" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Use custom attributes to store referral codes&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 4 — Create tiers for referrers (Voucherify)
&lt;/h3&gt;

&lt;p&gt;Let’s wrap up the current setup. Thanks to Segment, every new user is synchronized with both Voucherify and Braze. Then, the active Braze campaign retrieves a unique referral code from Voucherify and sends it via email to the new user. The code is managed by Voucherify, it’s linked with the user and the promo engine treats it as a 200 THB off coupon for every new referred customer. You can validate the referral code to confirm this.&lt;/p&gt;

&lt;p&gt;Create a new Postman request and call validate endpoint from Voucherify API.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select &lt;strong&gt;POST&lt;/strong&gt; method and put the following URL: &lt;a href="https://api.voucherify.io/v1/vouchers/torchie-MYRATKCP/validate"&gt;https://api.voucherify.io/v1/vouchers/{CODE}/validate&lt;/a&gt; replacing CODE with your referral code.&lt;/li&gt;
&lt;li&gt;Add X-App-Id and X-App-Token headers and fill it with Application ID and Secret Key respectively.&lt;/li&gt;
&lt;li&gt;Set Content-Type header to application/json.&lt;/li&gt;
&lt;li&gt;Set the following Body to simulate a friend trying to redeem the referral code and SEND.
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "customer" : {
        "source_id" : "pam@dundermifflinpaper.com"
    }
}
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Voucherify should reply with the information about the referral code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6AJ6d_A0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AkfEAmPvcriiie6plDj27lg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6AJ6d_A0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AkfEAmPvcriiie6plDj27lg.png" alt="How to validate the referral code in Postman" width="800" height="489"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Test validating the referral code&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What we’re still missing though is something that would move the needle — an actual incentive for advocates. Let’s give them 200 THB for every referred friend.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Edit your referral campaign and go to &lt;strong&gt;Referrer rewards&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Create the first and only tier which awards referrer every time referral event occurred. You can create many more to employ some gamification theme. Apart from the number of successful referrals you can add more validations rules, like location or budget to name a few examples.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UkYfp4dJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A9qSpp6b0iCCSI-OEmPF80Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UkYfp4dJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A9qSpp6b0iCCSI-OEmPF80Q.png" alt="Creating a tier for referrer rewards in Voucherify dashboard" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Create a tier for referrer rewards&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Go to Rewards and CREATE NEW REWARD. Our plan is to give a 200 THB coupon for every referral. Name your reward to help you reference it in reports (something like “200 THB off”) and click CREATE NEW CAMPAIGN. Here select Amount type coupons of 200THB value and SAVE. Now ADD REWARD to assign reward to your referral campaign.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--59rAeP7C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A6m9gwVbDh7UxJYQwZV02ow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--59rAeP7C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A6m9gwVbDh7UxJYQwZV02ow.png" alt="How to confirm the referral reward in Voucherify" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Confirm the referral reward&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The last step is to notify an advocate about the reward. To do so, we’ll send a reward coupon code to advocates profiles at Braze. Enable Braze channel and define how Voucherify should name the reward related Custom Attributes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TX6UJJzj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A1qYKT6HfuKNQQESUHU3EDQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TX6UJJzj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A1qYKT6HfuKNQQESUHU3EDQ.png" alt="Customer referal reward notifications" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Notify customers about referral reward&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Save the campaign and the Voucherify part is ready. It’s about time we tested what we’ve built so far end-to-end. We’ll simulate the scenario of Jim referring the service to his dear friend — Dwight. In effect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dwight gets 200THB off of her first order.&lt;/li&gt;
&lt;li&gt;Jim gets a 200THB coupon reward.&lt;/li&gt;
&lt;li&gt;Dwight receives an invitation to referral program with a unique referral code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Switch to Postman and follow these steps:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dwight installs the app and creates an account — the backend detects a new signup — call Segment Identify request with the body below to notify Braze and Voucherify about a new signup. Go to dashboards in Voucherify and Braze to see if Dwight data got populated correctly.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "userId": "dwight@dundermifflinpaper.com",
  "traits": {
    "email": "mike+dwight@voucherify.io",
    "name": "Dwight Schrute"
  }
}
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Dwight uses the referral code at the checkout — the ecommerce engine needs to apply the code to the cart. Call &lt;a href="https://docs.voucherify.io/reference#redeem-voucher"&gt;Voucherify Redemption&lt;/a&gt; to validate the referral code and to calculate the discounted order price.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "customer" : {
        "source_id" : "dwight@dundermifflinpaper.com"
    },
    "order": {
      "amount": 80000 // amount multiplied by 100 to handle decimals
    }
}
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qG9xrf05--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A3s3pzqdmCpEDj-q1A2a1Iw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qG9xrf05--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A3s3pzqdmCpEDj-q1A2a1Iw.png" alt="Redeeming the referral code with Voucherify API" width="800" height="489"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Redeem the referral code with Voucherify API&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Dwight gets his first order delivered to the farm — the backend listens to the shipping status and notifies CRM platforms about the updates — call Segment Track Referral to notify that a successful referral should be counted.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{    
"userId":"dwight@dundermifflinpaper.com",    
"event":"referral",   
"referral":{  
"code":"torchie-MYRATKCP"    
}
}
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;When we look into the referral program dashboard, we should see two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Jim’s referral code has been already used once (by Dwight).&lt;/li&gt;
&lt;li&gt;A newly generated code for Dwight.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xM5OUtr3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A1drsPiolsZycI6VwZrPiKQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xM5OUtr3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A1drsPiolsZycI6VwZrPiKQ.png" alt="An illustration of referral codes status in Voucherify dashboard" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Visit the dashboard to see referral codes status&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When you visit Jim’s profile in Braze, you can see that he received his first referral reward coupon.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1DqcnZe5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2ASkscXwUaqQ45NgZsL5qA5Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1DqcnZe5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2ASkscXwUaqQ45NgZsL5qA5Q.png" alt="An overview of the referral reward code in Braze" width="800" height="394"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;You can see the referral reward code in Braze&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When you invite new users to the referral program again, Voucherify will generate Dwight’s referral code via Connected Content and send it to his profile in Braze.&lt;/p&gt;

&lt;p&gt;The very last step is to notify Jim about the reward. The easiest way to achieve it is to create an action-based campaign which uses &lt;strong&gt;Change Custom Attribute Value&lt;/strong&gt; trigger. So, whenever reward_coupon_code changes its value with successive reward notifications from Voucherify, Braze sends a message with the reward coupon code.&lt;/p&gt;

&lt;p&gt;In a production environment, you might and should integrate in-app customer profiles with Voucherify to show their full promotional wallet, including referral code, statistics, and above all rewards. For the web version, you can use Voucherify pre-built cockpits.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ghryEiUR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AftIbOmZOwbaWJbvZd11k7Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ghryEiUR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AftIbOmZOwbaWJbvZd11k7Q.png" alt="Customer hub with the referral score in Voucherify dashboard" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Visit individual customer hub to see the referral score&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Bonus step — Add more tiers (Voucherify)
&lt;/h3&gt;

&lt;p&gt;If the campaign performs too well, you can easily add more tiers to gamify the referral frenzy and protect your budget. For example, you might want to send one reward for one referred customer, and then another one but only if an advocate earns at least five referred customers — so two rewards in total regardless of the number of successful referrals. To apply this to your program, just edit your campaign, go to tiers section and:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Edit the original tier, so that number of Referred Customers is more than 0.&lt;/li&gt;
&lt;li&gt;Create another tier, and set the condition to Referred Customers is more than 5.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9LesNbcW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A4v-eovbeoFPlqoFI705RUA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9LesNbcW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A4v-eovbeoFPlqoFI705RUA.png" alt="How to build additional referral tiers in Voucherify" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Build additional referral tiers&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5 — Onboarding with deeplinks (Branch)
&lt;/h3&gt;

&lt;p&gt;The missing puzzle is how we can attribute app installs to our referral campaign and how to send newly registered users the referral deal. With our current setup, the advocate has to send a referral code to their friends. Then, they need to save it somehow to paste in during the checkout stage. What if we could modify the referral link in a way it lets the app store and apply the code automatically?&lt;/p&gt;

&lt;p&gt;To achieve this goal, we need deeplinks. Many of you already use one of the deeplinking platforms, you can use it here for integrity. In our case, we’ll go with Branch.&lt;/p&gt;

&lt;p&gt;While Braze x Branch integration has&lt;a href="https://help.branch.io/using-branch/docs/universal-email-integration-guide"&gt;some&lt;/a&gt; advanced goodies for branded deeplinking, this is beyond the scope of this tutorial. We’re going to use&lt;a href="https://help.branch.io/using-branch/docs/creating-a-deep-link#long-links"&gt;long links&lt;/a&gt; to show how straightforward it is to attribute installations to our referral campaign and how to point new users to a specific view.&lt;/p&gt;

&lt;p&gt;When our deeplink is clicked by a new user, Branch will redirect them to a corresponding place, either App Store, Google Store or a web page. Then, when the app is installed, the parameters that we pass with the URL, will be read by the Branch SDK on the mobile app. In this way, the app will be able to recognize the referral code and store it in the user’s profile. Here’s how our deeplink is constructed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;+ +&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s implement it with Branch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open your Branch dashboard and go to Configuration.&lt;/li&gt;
&lt;li&gt;Provide the links to the stores and a fallback link in for the web view. (As we don’t use real apps in this example, we skipped stored links).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wdRYIOdM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A1uVfeWbS0hHTwJIrw-eWQw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wdRYIOdM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A1uVfeWbS0hHTwJIrw-eWQw.png" alt="How to set up Branch redirects" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Configure Branch redirects&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Scroll down to Link Domain and set up your domain. (Again, for simplicity we use default ones).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t0lgKkfi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A1jb6ymf106slYaCExoDh3g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t0lgKkfi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2A1jb6ymf106slYaCExoDh3g.png" alt="Using default link domain to test the workflow" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;You can use default link domain to test the flow&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Open Postman, create a new GET request and type the following long link:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;g9xol.test-app.link/?~campaign=referral&amp;amp;code=torchie-MYRATKCP&amp;amp;$fallback=https%3A%2F%2Fshowcase.voucherify.io&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before we click SEND, let’s analyze each part of our long link:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;g9xol.test-app.link&lt;/em&gt; &lt;/strong&gt; — our Branch domain (you can configure your custom one for better branding).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;~campaign=referral &lt;/em&gt;&lt;/strong&gt; — telling Branch how to attribute the click.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;code=torchie-MYRATKCP&lt;/em&gt; &lt;/strong&gt; — Jim’s referral code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;$fallback=https%3A%2F%2Fshowcase.voucherify.io&lt;/em&gt; &lt;/strong&gt; — (optional) telling Branch where to redirect the user after click in the fallback mode (we’ve set up the primary mode in Branch dashboard).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, when you hit SEND, simulating a user clicking on the link, the request goes to Branch which will redirect the user to the right place.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aFAZsDgN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AbsZGYCKUMah_TCZQHEwJJg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aFAZsDgN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AbsZGYCKUMah_TCZQHEwJJg.png" alt="How to send a test API call to Branch" width="800" height="490"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Send a test API call to Branch&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When you open Source and compare by campaign, you’ll see that the click was correctly attributed to our referral campaign.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UthPhclh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AfvKsy-bxyCQoyLFJX70VYg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UthPhclh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2AfvKsy-bxyCQoyLFJX70VYg.png" alt="How to test Branch click attribution" width="800" height="426"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Test Branch click attribution&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, go back to the Braze referral invitation campaign and add our link to the message. &lt;strong&gt;In the URL, remember to replace Jim’s code with &lt;code&gt;{{publication.voucher.code}}&lt;/code&gt; to ensure every signup gets their own unique code.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6 — Manage your referral campaign
&lt;/h3&gt;

&lt;p&gt;In these five steps, we’ve created a &lt;strong&gt;complete POC of a solid referral program&lt;/strong&gt;. Thanks to powerful mar-tech tools, we were able to spin off a highly targeted referral campaign in hours. The API-first approach allowed us to outsource the backend part while still having flexibility over the mechanics of the referral calculation. What’s most important, with the collaboration between Braze, Segment, Branch and Voucherify you can enjoy 100% personalized, on-brand experiences with app and web customer touchpoints.&lt;/p&gt;

&lt;p&gt;The best part? Lower development efforts required. Both of the implementation part and maintenance. With Voucherify, you can change the referral program conditions on your own. Think running A/B tests with limiting referrals per advocates or referrals in total, adding minimum spent value to the friend’s order, or excluding specific customers or whole segments from the program.&lt;/p&gt;

&lt;p&gt;The final step is to define the requirements for your developers. Within a day or so, they should be able to translate our Postman requests into the production code (check out official SDKs). The initial launch might require some bulk customers sync and depending on your traffic you should consider the rate-limiting policies of the platforms — this is where the official API documentation comes in handy.&lt;/p&gt;

&lt;p&gt;With Voucherify and your mar-tech stack you can launch many more personalized incentives. Visit our &lt;a href="https://docs.voucherify.io/docs"&gt;docs&lt;/a&gt; to learn what goodies come with our API, get our Postman collection, and happy hacking!&lt;/p&gt;


&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>marketingtechnology</category>
      <category>architecture</category>
      <category>api</category>
    </item>
    <item>
      <title>What's MACH and how it can make you 10x ecommerce developer</title>
      <dc:creator>Mike Sedzielewski</dc:creator>
      <pubDate>Wed, 12 Oct 2022 08:11:43 +0000</pubDate>
      <link>https://dev.to/msedzielewski/whats-mach-and-how-it-can-make-you-10x-ecommerce-developer-2bk0</link>
      <guid>https://dev.to/msedzielewski/whats-mach-and-how-it-can-make-you-10x-ecommerce-developer-2bk0</guid>
      <description>&lt;p&gt;If you develop ecommerce solutions and think of steering your career towards software architecture, you might want to learn about this new trend. It’s about enterprise software aimed at improving the productivity of digital teams. Sounds odd? Meet MACH (&lt;strong&gt;&lt;em&gt;Microservices&lt;/em&gt;&lt;/strong&gt; based, &lt;strong&gt;&lt;em&gt;API-first&lt;/em&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;Cloud-native SaaS&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;Headless)&lt;/em&gt;&lt;/strong&gt;. While it might sound like a bundle of buzzwords, it's all about bringing better developer experience into ecommerce projects, helping you ship faster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5jHIbSXz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70oenz8njzryi6tsx3tt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5jHIbSXz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70oenz8njzryi6tsx3tt.png" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Microservices? It's so 2010s&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The history of MACH dates back to the 2010s but it wasn’t until 2020 when it got a name and caught the attention ofmainstream brands. What's this fuss about? In early 2010, Twilio and Stripe earned developers' love with their API-centric approach. Up-to-date documentation, code samples for every major platform, and free tiers to test the solution inside out changed the way developers produce commerce software. It didn't take long until a few business-oriented engineers noticed that this approach can make a dent in the core ecommerce areas. &lt;/p&gt;

&lt;p&gt;Before I give you a hint what’s so special about MACH tools, a disclaimer: everybody that have been in the industry long enough realize that devtools revolve around the perpetual hype cycle: bright and shiny; startups use it -&amp;gt; claimed by an enterprise -&amp;gt; consultants necessary for maintenance -&amp;gt; downfall but still in use -&amp;gt;&lt;a href="https://twitter.com/memegento"&gt;memes&lt;/a&gt; emerge. &lt;/p&gt;

&lt;p&gt;MACH tools will follow this path no matter what. But the good news is these tools have just entered the 2nd phase. This means they still have a long way ahead but, at the same, they've grown with &lt;a href="https://www.enterpriseready.io/#features"&gt;enterprise features&lt;/a&gt; so that they can be recommended in the corporate environment too.&lt;/p&gt;

&lt;p&gt;So, why MACH tools now? Well, it's about speed. In ecommerce, speed wins the market. As more and more commerce happens online, the more focus is put on helping digital teams roll out and test new commerce experiences (or devise new ways of monetizing our attention).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fewer ASAPs with better APIs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How does MACH help with the speed of the digital team? I didn't use "digital team" without a reason. MACH tools make work easier for both developers and ecommerce operators (marketers, sales, support, logistics). &lt;/p&gt;

&lt;p&gt;First of all developers are given dozens of standalone, battle-tested features enclosed in API endpoints. On one hand, they free up a substantial amount of time – there are building blocks who took a year for a whole team to complete, polish, and document its API request/response. On the other, with the headless approach you get to decide how the UI works. In a nutshell, it's a middle ground between &lt;a href="https://www.divante.com/blog/build-vs-buy-a-winning-cto-guide"&gt;build and buy&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What about operators? In fact, they are the first-class commerce software users. Sometimes they use it more often than consumers. Internal tools tend to get worse UX and support than software running the pixel-perfect checkout view. MACH tools address this case with operator-friendly admin panels/dashboards. They're optimised and documented for marketing/support/inventory agents so they can get their jobs done.&lt;/p&gt;

&lt;p&gt;When you think about it, it's actually the devs who benefit twice. They get business logic out of the box (with the freedom to update frontend with the new framework that dethroned legacy stuff from the last year). But they also get fewer meetings and ASAP requests from the marketing team because it all can be managed within a dedicated UI. And, in case of questions, there’s always the vendor support teams🙋 What's not to like about it?&lt;/p&gt;

&lt;p&gt;Finally, the SRE teams have a reason to be happy too. Headless platforms brag about being Black Friday-ready throughout the whole year. Because MACH platforms serve API requests across the globe they expect fans to be spinning faster for some TV ad in Big Brother all the time. When building software from scratch, there's always someone asking: but will it scale? In the MACH world, this is guaranteed from day one. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OK, show me examples&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every software platform that lives long enough to become enterprise-grade develops an allergy to explaining things in simple terms. Benefits, buzzwords, battlestar galactica… the webpage overgrows with terms aimed at making the brand look bigger and showing that it’s gonna fix all issues the next day you buy. In my opinion, most of the MACH companies don't go this route. &lt;/p&gt;

&lt;p&gt;As dev-focused tools, they explain their offer with the IO-centric approach. If the product homepage still looks too vague for you, you can always turn to the API references to find your answer in JSON.&lt;/p&gt;

&lt;p&gt;To give you a sneak peek into what commerce building blocks are already on the market, I prepared TLDR versions of each MACH member. Inspired by &lt;a href="https://expeditedsecurity.com/aws-in-plain-english"&gt;AWS in Plain English&lt;/a&gt;, I’ve gone through the MACH library and here it is – a short, ™️-less, and, not-so-serious explanation of MACH members. &lt;/p&gt;

&lt;p&gt;(Note: the list isn't exhaustive because every quarter dozens of new headless SaaS are launched. Here I focused on those that were qualified by the ecommerce veterans formed as MACH tech council.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.algolia.com/"&gt;Algolia&lt;/a&gt;, &lt;a href="https://constructor.io/"&gt;constructor.io&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; Typo-tolerant product search with instant results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Help shoppers find products with autocomplete and immediate search results filtered and designed according to customer attributes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; Amazon search, but prettier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://amplience.com/"&gt;Amplience&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; Contentful/Contentstack/Storyblok x Cloudinary👇&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.bigcommerce.com/"&gt;Bigcommerce Enterprise&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; Headless version of Bigcommerce with extra hosting, security, and support options.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Manage orders, carts and product catalog when you’re a mid-market to enterprise company.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; Shopify Plus but Bigcommerce was first to use “headless”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://bluestonepim.com/"&gt;Bluestone PIM&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; CMS structured as a product catalog tree which synchronizes with marketplaces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Synchronize product information and prices across any sales channel. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; Product_Catalog_August2021_final.xlsx shared on Dropbox that sends changes to marketplaces on every “Save”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://boldcommerce.com/"&gt;Bold Commerce&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; SDKs for building checkout pages with support for subscriptions and bundling. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Test which checkout flow works best for different devices, customer segments, pricing rules, and compliance requirements on top of Shopify, Bigcommerce, or commercetools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; If Shopify, Bigcommerce, or commercetools had an extra team to untangle checkout UI complexity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://cloudinary.com/"&gt;Cloudinary&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; Image and video storage with transformation/transcoding features and CDN.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Store and modify media for your product pages. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; Imagemagick and ffmpeg in the cloud, with support.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://commercetools.com/"&gt;Commercetools&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; All-around ecommerce platform with an extendable data model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Manage orders, carts, and product catalog with geographical and performance scalability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; Developer-friendly Magento in the cloud, minus the front-end.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.contentful.com/"&gt;Contentful&lt;/a&gt; &amp;amp; &lt;a href="https://www.contentstack.com/"&gt;Contentstack&lt;/a&gt; &amp;amp; &lt;a href="https://www.storyblok.com/"&gt;Storyblok&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; Mobile-friendly CMS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Store and update content of your product pages with device, geographical, and performance scalability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; Wordpress but works fine with mobile apps, even under really heavy traffic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://enactor.co/"&gt;enactor&lt;/a&gt;,&lt;a href="https://fluentcommerce.com/"&gt;fluentcommerce&lt;/a&gt; &amp;amp; &lt;a href="https://www.newstore.com/"&gt;NewStore&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; Inventory tracking with a graphical editor for order routing and mobile POS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Track product availability and orders across multiple stores, with the support for online and offline fulfilment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; Your fulfilment team’s checklist looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--inTjPEOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mf1ex4n2cp4lhgqht8oy.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--inTjPEOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mf1ex4n2cp4lhgqht8oy.jpeg" alt="Image description" width="250" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.vuestorefront.io/"&gt;Vuestorefront&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; Components for building UI on top of headless commerce platforms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Build internationalized, mobile-friendly, single-page shop storefronts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; Your storefront is finally taken care of by a horde of senior frontend developers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.occtoo.com/"&gt;Occtoo &lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; Customer data platform.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Connect several ecommerce systems to exchange data in real-time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; Ecommerce-focused Segment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://personifyxp.com/"&gt;Personify XP &lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; A script replacing parts of the website according to visitor attributes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Insert more relevant content to a visitor clicking in your shop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; A proven hierarchy of 'ifs' you can use to make your product page more personalized to a visitor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://poqcommerce.com/"&gt;poq&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; Native mobile apps builder with a drag &amp;amp; drop editor. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Build a mobile app for your shop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; Every shopping app looks the same, so why not replace mobile software developers with software itself?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://uniform.dev/"&gt;uniform&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; A UI-controlled script that replaces parts of a website according to visitor attributes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Make static websites dynamic again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; A jamstack version of Optimizely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.voucherify.io/"&gt;Voucherify&lt;/a&gt; &amp;amp; &lt;a href="https://talon.one"&gt;Talon.one&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; Rules engine for incentives and rewards with an admin panel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Control who and when can get a discount or loyalty points.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; Your marketer can deactivate this one coupon code without waiting for the next spring.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://vtex.com/us-en/platform-overview/"&gt;VTEX&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One line explanation:&lt;/strong&gt; All-around ecommerce platform with a great number of API endpoints for particular sectors. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this to:&lt;/strong&gt; Run ecommerce with geographical, performance, vertical and [put yours] scalability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s like:&lt;/strong&gt; You merged all other MACH Alliance members into the MEGAMACH platform.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fine, show me the code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you want close-to-real world examples, why not take a look at &lt;a href="https://machathon-2022.devpost.com/project-gallery"&gt;winner repos&lt;/a&gt; of the recent hackathon organised by MACH.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1mMCmPbL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0ueko4tlifs7x9ve6yv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1mMCmPbL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0ueko4tlifs7x9ve6yv.jpg" alt="Image description" width="800" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The best way to learn how MACH speeds up developer productivity (as well as where it becomes a pain in the neck) is to follow folks who have maintained MACH-based solutions for a while now (&lt;a href="https://www.linkedin.com/posts/machalliance_followfriday-mach-digitaltransformation-activity-6984106598222733312-r-eO/"&gt;MACH advocates&lt;/a&gt;) or meet them at one of &lt;a href="https://www.machalliance.com/events"&gt;MACH events&lt;/a&gt;. And if you can’t, you can always turn the &lt;a href="http://machalliance.com/podcast"&gt;MACH radio&lt;/a&gt; on.&lt;/p&gt;

</description>
      <category>ecommerce</category>
      <category>architecture</category>
      <category>career</category>
      <category>api</category>
    </item>
    <item>
      <title>How we moved from MongoDB to Postgres without downtime and cut our costs by 30%</title>
      <dc:creator>Mike Sedzielewski</dc:creator>
      <pubDate>Thu, 06 May 2021 10:11:44 +0000</pubDate>
      <link>https://dev.to/msedzielewski/how-we-moved-from-mongodb-to-postgres-without-downtime-and-cut-our-costs-by-30-7fd</link>
      <guid>https://dev.to/msedzielewski/how-we-moved-from-mongodb-to-postgres-without-downtime-and-cut-our-costs-by-30-7fd</guid>
      <description>&lt;p&gt;Voucherify was born in 2015 as a weekend hackathon project run by our small-scale software house, &lt;a href="https://rspective.com"&gt;rspective&lt;/a&gt;. Initially, it was backed up by a &lt;strong&gt;MongoDB database&lt;/strong&gt;. Truth be told, this choice was random – it was the most common database we used in our projects. We already had some experience with it so Mongo was a pretty natural component at that stage. However, as Voucherify's scale grew, we’ve added a second database – &lt;strong&gt;PostgreSQL&lt;/strong&gt; – that seemed to be more suitable for the upcoming features. Then for some time we kept part of our data in Mongo, and the other part in Postgres, until the day we decided to move it all to Postgres. &lt;/p&gt;

&lt;p&gt;When we started out, we already had around &lt;strong&gt;five years of data collected&lt;/strong&gt;, spread around multiple database instances, located on three continents, each dedicated to a different Voucherify cluster. Millions of voucher codes that could be updated anytime. Around a terabyte of constantly changing data. And to make matters worse, a lot of code had to be prepared for the upcoming breaking change. If presented on a timeline, we spent three months rewriting and testing new code and next &lt;strong&gt;three months&lt;/strong&gt; migrating all the data.&lt;/p&gt;

&lt;p&gt;Why then go through all this trouble? We had two valid reasons to do that.&lt;/p&gt;

&lt;p&gt;First of all, as you can easily imagine, maintaining two different database types creates a &lt;strong&gt;cascade effect of doubled codebase, paradigms and concepts&lt;/strong&gt; you have to keep in mind while adding new features. It was also the source of problems with the initial setup followed by issues popping up randomly (usually, on Friday afternoons). If one of them looks redundant, then all these issues sum up and cause tension and frustration in the engineering team.&lt;/p&gt;

&lt;p&gt;Secondly, Compose – a SaaS platform serving MongoDB that we were using, was &lt;strong&gt;very expensive&lt;/strong&gt; in comparison to alternatives. It became a significant percentage of our monthly expenses. Additionally, we were not satisfied with the quality of the support we got. Sometimes response delays could be as long as several days. In some cases, the only offered solution was to restart the database, with no good explanation of why the weird stuff happened in the first place or whether they plan to fix that in the future.&lt;/p&gt;

&lt;p&gt;To succeed with the migration and maintain platform stability when the traffic was high, we split it into a couple of tasks – each corresponding to a different entity. Most of them were easy migrations of relatively small chunks of data that was updated rarely. Each of these tasks has its own story, but this article is going to tell the story of the last task. It was about two core entities – vouchers and campaigns – that serve as primary objects in Voucherify API. As you can imagine, these were kept in Mongo for the longest. You could say that &lt;strong&gt;the core of our system was built around the database that had to be replaced&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We used &lt;strong&gt;AWS’s Database Migration Service&lt;/strong&gt; to help us with migration. The primary motivation was to reduce the time of preparing the setup for the migration tool, by relying on a SaaS solution tested by hundreds of developers already. &lt;/p&gt;

&lt;p&gt;We decided to create new temporary tables for each Mongo collection, and somehow safely merge them with production tables in the next steps. The PostgreSQL database has a nice feature that helped us, called table inheritance. It gave us a possibility to join two tables together in a hierarchical order to obtain a parent table having multiple independent child tables.&lt;/p&gt;

&lt;p&gt;Here is what we did:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sanity check of data in MongoDB.&lt;/li&gt;
&lt;li&gt;Creating child tables with Postgres Inheritance.&lt;/li&gt;
&lt;li&gt;Applying transform triggers.&lt;/li&gt;
&lt;li&gt;Running Amazon Database Migration Service scripts.&lt;/li&gt;
&lt;li&gt;Sanity check of data in child tables.&lt;/li&gt;
&lt;li&gt;Moving “deleted” data from child to parent table.&lt;/li&gt;
&lt;li&gt;Switching applications logic to use Postgres.&lt;/li&gt;
&lt;li&gt;Anomaly detection.&lt;/li&gt;
&lt;li&gt;Moving “active’ data from child to parent table.&lt;/li&gt;
&lt;li&gt;Stopping and removing DMS tasks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Read the whole post on &lt;a href="https://www.voucherify.io/blog/how-we-moved-from-mongodb-to-postgres-without-downtime-and-cut-our-costs-by-30"&gt;our blog&lt;/a&gt; &lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>postgres</category>
      <category>devops</category>
      <category>aws</category>
    </item>
    <item>
      <title>How to use the cloud to build applications faster</title>
      <dc:creator>Mike Sedzielewski</dc:creator>
      <pubDate>Tue, 06 Nov 2018 16:32:28 +0000</pubDate>
      <link>https://dev.to/msedzielewski/how-to-use-the-cloud-to-build-applications-faster-1emk</link>
      <guid>https://dev.to/msedzielewski/how-to-use-the-cloud-to-build-applications-faster-1emk</guid>
      <description>&lt;p&gt;It seems like everybody wants their apps to run faster and faster. Hundreds of posts on application performance are published every year. But articles about creating applications quickly are pretty rare to find. That’s a pity because when push comes to shove this is what counts for business. Development productivity is the knowledge which allows you to tell a CTO/tech lead apart from a regular developer. Let’s talk about it then. In this post, we describe 3 modern software development approaches you can use to deliver features like a well-oiled assembly line.&lt;/p&gt;

&lt;p&gt;Speed of delivery is key to winning in the market. The time of “&lt;strong&gt;build -&amp;gt; launch -&amp;gt; measure &amp;amp; adapt&lt;/strong&gt;” cycle is a key metric for the majority of software produced today. That’s why today’s engineering teams come up with more and more sophisticated tools and practices to reduce time to ship. These include continuous deployment processes, build automation tools, coding guidelines, and static code analysis tools. All of this to create a controllable environment for smooth software delivery lifecycle with dozens of coders.&lt;/p&gt;

&lt;p&gt;Nonetheless, while these artifacts are useful, it seems like some teams focus too much on optimizing them. Refining build pipelines or developer environments doesn’t always lead to cutting time to market — sometimes it can even have a negative impact on delivery speed.&lt;/p&gt;

&lt;p&gt;Our experience shows that turning your focus to 2 aspects of software development lifecycle brings better results to shipping speed. These are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;achieving code simplicity&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;building a rapid feedback setup&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While they can be approached from many angles, I’d like to focus on one in particular — API-first SaaS platforms.&lt;/p&gt;

&lt;h2&gt;
  
  
  API-first building blocks instead of your clunky POC
&lt;/h2&gt;

&lt;p&gt;Let’s start with a short intro of these solutions. API-based or API-first platforms provide a particular piece of functionality wrapped with an API that is easy to integrate with. You can use these endpoints to implement a well-adapted solution without the need of starting from scratch.&lt;/p&gt;

&lt;p&gt;There are a few hard-to-miss features of API-based solutions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;the main business value comes from the API and webhooks, and the user interface (if there is any) plays a secondary role, and is used mostly to administer the account&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;they provide a thorough developer documentation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;they have dedicated teams to take care of security and availability&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Profit? The business gets the speed and flexibility at the same time. And savings of course. As a user of such a service, you usually pay for the actual usage, the number of requests for example.&lt;/p&gt;

&lt;p&gt;So what’s that got to do with 2 goals of &lt;strong&gt;fast delivery&lt;/strong&gt; we’ve mentioned?&lt;/p&gt;

&lt;p&gt;The first one is straightforward. You just need fewer lines of code to implement the solution the task is about. Sure, there’s some learning curve at the beginning, but overall the time you spend on familiarizing yourself with a new API — usually with decent documentation and examples — is shorter than what it takes to create a feature with a regular “trial and error” approach.&lt;/p&gt;

&lt;p&gt;Unless you’re a seasoned developer in a particular area, the solution provided by the platform will be more robust. And even if there are some errors or confusion, the support team will help you handle the case.&lt;/p&gt;

&lt;p&gt;The second goal naturally stems from the first one. If you implement the feature quicker, then you can test it with users sooner (thanks Sherlock). But to gather feedback properly, you also need a way to collect and visualize data for the metric the business is after. API-based platforms might be helpful here again because, usually, they provide detailed usage statistics (also available through API) and sometimes even whole reporting modules.&lt;/p&gt;

&lt;p&gt;So all in all, putting a feature together with API-based platforms is a better approach than your quick-and-dirty proof of concept.&lt;/p&gt;

&lt;p&gt;OK, let’s see an example.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case:&lt;/strong&gt; imagine an early stage but rapidly growing online marketplace which connects suppliers and customers. The process of matching ones with the others is done manually by operations agents. With increasing traffic, the company needs more and more agents to process the orders. They decide to ask the tech team to automate this activity. Matching takes into account several parameters: time slot, location, customer preferences, supplier category, supplier rank, and of course the amount of money they make on every order.&lt;/p&gt;

&lt;p&gt;Now the goal of the project project is to reduce the time of agents while keeping the profitability of the matching function.&lt;/p&gt;

&lt;p&gt;The first idea which came from the management was to commission a machine learning algorithm and connect it to the CRM platform. But the CTO was skeptical. He knew it would be an expensive ride. Ultimately, he was afraid it would take a while to develop a solution which yields results similar or better than agents. He forced an alternative approach which focused on unburdening the operations team in short term.&lt;/p&gt;

&lt;p&gt;He analyzed the data and found out some patterns. Then, he decided to replace the human factor with SMS. The engine analysed incoming orders and sent the “Do you accept this XYZ job? Yes/No” message to several suppliers. The process sent SMSes according to a pattern including aforementioned parameters. Whoever accepted first, won the order.&lt;/p&gt;

&lt;p&gt;This was quick to implement and worked out very well! Of course, the solution didn’t cover 100% of cases but it significantly reduced the ops team effort by 60%, gaining more resources for other operational tasks. &lt;strong&gt;It was a matter of days, not weeks or months&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now the key part is that the quick delivery wouldn’t have taken place without the help of API-first platforms.&lt;/p&gt;

&lt;p&gt;First, instead of building the SMS gateway, they team went for &lt;a href="https://www.twilio.com/"&gt;Twilio&lt;/a&gt;. Second, instead of implementing a cron-like functionality, they used &lt;a href="https://www.easycron.com/"&gt;EasyCron&lt;/a&gt;. Third, to calculate geo-distances, they tapped into Google Maps API. The whole solution was basically just a loop and a bunch of ifs, and several HTTP requests.&lt;/p&gt;

&lt;p&gt;In summary, they quickly managed to get an important feature live and achieved business goals in no time. On top of that, the code responsible for this functionality was super simple and thus &lt;strong&gt;open for modifications&lt;/strong&gt; (which they did later — automating 90% of order allocation).&lt;/p&gt;

&lt;p&gt;But API-first platforms have their caveats too:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The most important thing you need to verify as part of your SaaS research is limits. API-first vendors impose thresholds to simply make money as well as to protect their service from unexpectedly high traffic. Make sure then the limits are aligned with your use case budget.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The second is a fallback plan — depending on the impact on the business, your system should be accordingly prepared for the outage either of a vendor’s platform or yours. Features like system down/maintenance alerts and webhooks which repeat failed requests help in such cases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure the provider you want entrust offers a support policy which goes along with your business case.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No bigger company will allow for integration with a 3rd party system if it doesn’t provide &lt;a href="https://www.enterpriseready.io/"&gt;enterprise-grade features&lt;/a&gt;. Prepare a list of what’s required in your org.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Recommended reading :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.voucherify.io/blog/feature-as-a-service-new-and-noteworthy"&gt;API-first SaaS collection&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://medium.freecodecamp.org/how-to-use-api-first-platforms-to-build-your-websites-faster-e917e8318ee"&gt;How to use API-first platforms to build your websites faster&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://chiefmartec.com/2017/02/introduction-ecommerce-apis-non-developers/"&gt;An introduction to ecommerce APIs for non-developers&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Business apps is copy-and-paste-and-change-one-thing
&lt;/h2&gt;

&lt;p&gt;A seasoned business application developer would say that business software products are more or less copy’n’paste. This has certainly been a leitmotif for Salesforce founders. Having this in mind, they’ve built a CRM platform which powers hundreds of thousands business apps around the world. So why has Salesforce managed to attract so many customers and why are we talking about this at all?&lt;/p&gt;

&lt;p&gt;Salesforce started as a SaaS CRM solution. They were one of the first players on the market and their sales pitch back then was “NO SOFTWARE”. They aimed at attracting companies trying to automate their sales processes which were fed up with sluggish on-premise software. Their SaaS offer turned up to be a massive success.&lt;/p&gt;

&lt;p&gt;But fast-forward to the second decade of the 21st century, we can see that Salesforce is not “NO SOFTWARE” anymore. Actually today, they &lt;a href="https://hbr.org/2015/01/the-strategic-value-of-apis"&gt;claim&lt;/a&gt; that 50% of their profits comes from the usage of &lt;strong&gt;Salesforce API&lt;/strong&gt;. What happened to “NO SOFTWARE” then?&lt;/p&gt;

&lt;p&gt;Well, SF realized that although 80% of CRM application works the same, companies still needs software services to integrate other systems and customize data flow.&lt;/p&gt;

&lt;p&gt;With this observation, they started to give companies the ability to configure the setup. It started off with custom fields, simple triggers, lookups, reports etc. These capabilities turned out to be in high demand, so the SF team decided to push forward in this direction.&lt;/p&gt;

&lt;p&gt;They extended configuration options by adding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;programmable software environment with their proprietary language called APEX&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;created Lightning UI framework to create new views right in Salesforce&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;exposed API and webhooks-like functionality to connect external systems&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In other words — they bet on software.&lt;/p&gt;

&lt;p&gt;With this setup, you can automate helluva lot of sales processes. But it’s not only about sales. Through acquisitions and development, SF can now cover various departments making the whole business tick. The best thing about that? &lt;strong&gt;Developer productivity&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;With a handful of tools, a single experienced SF developer can provide more value than a dozen of coders building a business app from zero.&lt;/p&gt;

&lt;p&gt;And we’ve been there. Remember the fast-growing online marketplace company from the previous example? They bet on Salesforce almost from day one. After 3 months of running on Google Spreadsheets, they transferred their small-back-then departments to SF and never regretted this decision. In hindsight, SF allowed them to grow for the next 3 years. How did it work?&lt;/p&gt;

&lt;p&gt;Salesforce was treated as a single source of truth, there was no database other than that. Part of functionality was developed with APEX and Lightning right in Salesforce and the other part using external system in Node.js connected with API. By connecting other API-based platforms through the API, they achieved very high developer productivity.&lt;/p&gt;

&lt;p&gt;The other Salesforce features that led to high speed in software delivery:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When the company change the business model and, in turn, the database model, they could react super quickly by exporting data through &lt;a href="https://dataloader.io/"&gt;Data Loader,&lt;/a&gt; rearranging them in Excel(!), and putting them safely (with the right format) back to Salesforce.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Whenever they were hitting limits, they did cost-benefit analysis on how to proceed with a feature — either to extend quota or to figure out a work around. For example, when data analytics queries started to utilize a large part of quota, they replicated the internal database to a Postgresql instance (through &lt;a href="https://www.heroku.com/connect"&gt;Heroku Connect&lt;/a&gt;) and changed the data source accordingly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Whenever the business asked for a new feature, there was a high chance that AppExchange marketplace had some solution&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But Salesforce is not all bells and whistles. Similarly to MS Sharepoint, the SF developer experience leaves a lot to be desired. Cumbersome IDE, poor support for multi-developer environments, poor source control technologies integration, long deployments — this all makes a software developer cringe. Fortunately, they’ve noticed their bad and have been fixing it with &lt;a href="https://developer.salesforce.com/platform/dx"&gt;Salesforce DX&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recommended reading:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.voucherify.io/blog/building-an-online-marketplace-from-scratch-introduction"&gt;Building an online marketplace from scratch [series]&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.red-gate.com/simple-talk/opinion/opinion-pieces/the-salesforce-platform-the-return-of-the-citizen-programmer/"&gt;The Salesforce Platform: The Return of the Citizen Programmer&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.computerworld.com/article/3284424/enterprise-applications/what-is-quick-base-a-low-code-database-platform-for-citizen-developers.html"&gt;What is Quick Base? A low-code database platform for citizen developers&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Quick and not-so-dirty internal apps
&lt;/h2&gt;

&lt;p&gt;Excel supports (too) many business processes across departments. Most of them are fed up with data with a regularly scheduled database export, some of them are even connected to a DB directly. Although Excel is a real powerhouse for various analytics, both off-hand charts and robust year-to-year summaries, it’s still one of the most criticized approach to business intelligence. Reason? It’s error-prone, it’s hard to track changes, and finally, sharing among users and roles is hindered.&lt;/p&gt;

&lt;p&gt;You can of course use 2 previous approaches to replace them, but often either it’s not worth the effort or the new solution won’t be &lt;strong&gt;flexible enough&lt;/strong&gt;. So, what can a CTO do in this case?&lt;/p&gt;

&lt;p&gt;One way forward is to tap into SaaS like &lt;a href="http://www.metabase.com/"&gt;Metabase&lt;/a&gt;, &lt;a href="https://redash.io/"&gt;Redash&lt;/a&gt; or &lt;a href="https://tryretool.com/"&gt;Retool&lt;/a&gt;. What they offer is the &lt;strong&gt;controllable access&lt;/strong&gt; to your database with out-of-the-box reporting and charting capabilities. Their user interface is intuitive and less error-prone than a regular spreadsheet. And when Excel is simply used as a list online, you can replace it with tools that are build just for this reason, such as &lt;a href="https://airtable.com/"&gt;Airtable&lt;/a&gt; or more advanced &lt;a href="https://www.smartsheet.com/"&gt;Smartsheet&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Whatever tool you use, in most cases it’ll be way faster to mimic or even overtake Excel than in case you’ve decided to implement it from scratch. Of course, you need to consider initial user onboarding effort, but it’s worthwhile because this approach will increase the &lt;strong&gt;productivity of internal apps users&lt;/strong&gt; in the long run.&lt;/p&gt;

&lt;h2&gt;
  
  
  The cloud is here, use it
&lt;/h2&gt;

&lt;p&gt;Your role as a CTO/tech lead/even regular developer is to solve business problems with the best yet the most cost-effective tools you find out there. Today, SaaS tools have become mature enough and developer-friendly to put them into your toolbelt. Depending on your decision-making level in your company and the problem specifics, you can outsource the solution to appropriate flavour of SaaS. You’ll get simpler and maintainable code which will lead to faster feature experiments, and ultimately, to better productivity in your team — hopefully better rewarded by the management :)&lt;/p&gt;

&lt;p&gt;/Photo by Egor Lyfar&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>career</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Hunting down large-scale Node.js application performance bottlenecks</title>
      <dc:creator>Mike Sedzielewski</dc:creator>
      <pubDate>Mon, 15 Oct 2018 15:20:54 +0000</pubDate>
      <link>https://dev.to/msedzielewski/hunting-down-large-scale-nodejs-application-performance-bottlenecks-lij</link>
      <guid>https://dev.to/msedzielewski/hunting-down-large-scale-nodejs-application-performance-bottlenecks-lij</guid>
      <description>&lt;p&gt;Here’s a case study from &lt;a href="https://rspective.com"&gt;rspective&lt;/a&gt; site reliability team. This time we want to share a story of our customer. To reduce the costs of infrastructure (above 60 000 EUR per month) our customer decided to give up AWS in favour of baremetal + kubernetes solution. This transfer brought up the expected benefits (way fewer machines hosting databases and cache, way cheaper CDN cost) but for unknown reasons, it also highlighted the problem of increased resource consumption and growing latency on machines which host Node.js applications. &lt;/p&gt;

&lt;p&gt;A threat of a partial return to expensive AWS hung over the business. So we decided to take a closer look at the problem from the inside.&lt;/p&gt;

&lt;p&gt;We start profiling. The first step and immediately the first tough nut to crack surfaces on our way. An application, which locally generates call- and flamegraphs, doesn’t work in production. We switch to the manual v8 profiling which means starting the node process with the &lt;code&gt;--prof&lt;/code&gt; flag. &lt;/p&gt;

&lt;p&gt;Unfortunately, downloading and processing logs fails in the node version 8.10. Cause? A bug. The same thing in 8.12, fortunately 10.x allows us to move on.&lt;/p&gt;

&lt;p&gt;We analyze the logs to check the CPU peaks and thus find out what takes up most of the processor time. We have a suspect - it's the “find” method of &lt;code&gt;lodash&lt;/code&gt;. We optimize it and that helps. Converting the data format from a table to an object is one of the remedies that gain 20-30 ms on latency for several endpoints.&lt;/p&gt;

&lt;p&gt;Clearly, we aren't satisfied yet. Profiling brings more suspects. One of them is a piece of code that impacts all of the request processed in the backend.&lt;/p&gt;

&lt;p&gt;It turns out that another element from &lt;code&gt;lodash&lt;/code&gt; - &lt;code&gt;cloneDeep&lt;/code&gt;, which was supposed to provide immutability and was introduced over a year ago - with the current volume of data has a negative impact on latency and consumption of a processor. &lt;/p&gt;

&lt;p&gt;This problem has been hard to capture because its influence on the overall performance has been growing gradually. As it usually happens during optimization, the long-sought trouble disappears after a simple change. In this case, it turns out to be replacing &lt;code&gt;cloneDeep&lt;/code&gt; with &lt;code&gt;Object.freeze&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We verify the patches for 1 kubernetes pod. The result - processor consumption decreases by 30%, the average latency for the whole supply is reduced from 140 ms to 30 ms. We decide for a rollout to all production machines. &lt;/p&gt;

&lt;p&gt;The final effect looks satisfactory. At 700 pods with applied patches, average processor consumption decreased from 30 to 8% - which means we can reduce the number of pods. &lt;/p&gt;

&lt;p&gt;By incrementally reducing batches of 100 pods, we reached 200 pod mark with CPU consumption of 44% peak time. Which is a better result than the initial peak time with 700 pods (~55%).&lt;/p&gt;

&lt;p&gt;What have we achieved? We have freed up a lot of resources and gained space to handle more traffic and upcoming features. And, of course, the client does not have to go back to the expensive AWS.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;ICYMI - we're hiring for &lt;a href="https://rspective.bamboohr.co.uk/jobs/"&gt;rspective&lt;/a&gt; and &lt;a href="https://www.voucherify.io/about"&gt;Voucherify&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>node</category>
    </item>
  </channel>
</rss>
