Integrating Referral Programs with Shopify: A Complete Guide

Integrating Referral Programs with Shopify: A Complete Guide

Arjun Vijayan•18 November 2025•Updated 5 November 2026

Integrating a referral program directly within Shopify ensures a frictionless experience for both your existing customers and their friends. With the right setup, you’ll drive higher participation, accurate tracking, and fully automated payouts via UPI. This guide covers everything you need to get started.

1. Why integrate your referral program with Shopify?

  • Frictionless UX: Embedding widgets on order status and account pages captures customers at peak engagement moments.
  • Accurate Attribution: Native integration tracks clicks, shares, and conversions without gaps.
  • Automated Payouts: Instant UPI cashback via RazorpayX streamlines reward fulfillment and boosts brand trust.

2. How do you install and set up a Shopify referral app?

A. Choose & Install Your Referral App

  1. Select from Shopify App Store: Search for a referral app that supports UPI or custom payout integrations.
  2. Grant Required Permissions: Ensure the app has access to Orders and Customers. Prefer apps built on Shopify’s theme app extensions and checkout extensions rather than script tags.

B. Initial Setup

  1. API Credentials: Enter your referral platform’s API key and secret in the app’s settings page.
  2. Brand Customization: Configure brand colors, logo, and default copy for “Refer & Earn” buttons.

3. Where do you add the referral widget?

A. Thank You and Order Status Pages

Shopify no longer runs custom scripts or additional scripts on these pages: they were switched off in August 2025 for Plus stores and in August 2026 for all other stores. Use your referral app’s extension instead:

  1. Go to Settings › Checkout and click Customize to open the checkout editor.
  2. Switch to the Thank you page and add your referral app’s block.
  3. Switch to the Order status page and add the block there too.
  4. Save and place a test order to confirm the widget appears after purchase.

B. Customer Account Area

  1. If your store uses the new customer accounts, add the app’s block in the same editor (it covers account pages too).
  2. Make sure the widget shows the referral link and share buttons (WhatsApp, Email).

C. Storefront Pages

Turn on the referral app’s app embed in Online Store › Themes › Customize › App embeds, or add its app block to the pages where you want a “Refer & Earn” button.

4. Which APIs and webhooks does a referral program use?

A. Theme App Extensions (Not Script Tags)

Older referral apps injected JavaScript into storefront pages with Shopify’s ScriptTag API. Shopify is retiring it: new script tags can’t be created after 1 October 2026, and existing ones stop running on storefronts on 1 March 2027. Modern apps render the widget through theme app extensions (app embeds and app blocks), which you control from the theme editor.

B. Webhook Setup

  1. In your referral app dashboard, subscribe to orders/create and orders/fulfilled events.
  2. Configure the webhook URL to point to your referral platform’s endpoint.
  3. On orders/fulfilled, implement logic to verify return-window completion before triggering payout.

5. How do you automate UPI cashback with RazorpayX?

  1. Connect RazorpayX Account: Enter your RazorpayX API keys in the referral app’s payout settings.
  2. Payout Trigger: Once the return window closes, the referral platform calls RazorpayX’s payout API to credit the referrer’s UPI address instantly.
  3. Confirmation: Referrers receive an SMS or WhatsApp notification confirming their cashback has been credited.

6. How do you troubleshoot a Shopify referral integration?

  • Test in Staging First: Avoid live-site disruptions by validating widget placement.
  • Check for Legacy Script Tags: If your current referral app still relies on script tags, ask the developer when it will move to theme app extensions.
  • Monitor Webhook Delivery: Ensure retries for failed webhook calls to avoid missed payouts.
  • Regular Audit: Catch discrepancies early and maintain customer trust.

Common Issues & Fixes:

  • Widget Not Appearing: Check the app embed is switched on in the theme editor and the app block is added in the checkout editor.
  • Missing Webhook Events: Confirm publicly accessible webhook URL returns a 200 OK.
  • Failed Payouts: Check RazorpayX API logs for authentication errors or insufficient funds.

Conclusion

A tight integration between Shopify and your referral platform is the cornerstone of a successful, scalable program. By following these steps—installing the app, embedding widgets, configuring webhooks, and automating UPI cashback—you’ll deliver a seamless experience that maximizes participation and drives sustainable growth.

Ready to see Referbro’s Shopify integration in action?

Get a Demo

Frequently asked questions

Subscribe to orders/create, to record referred orders, and orders/fulfilled, to confirm them. Trigger the payout only after the return window has closed.
On the Thank you and Order status pages, where customers are most engaged right after buying, and in the customer account area, with WhatsApp and email share buttons. Add them as app blocks in the checkout and account editor, not as custom scripts.
Connect a RazorpayX account in the referral app's payout settings. Once the return window closes, the app calls RazorpayX's payout API to credit the referrer's UPI address and sends a confirmation.
Check that the app embed is switched on in the theme editor and that the app's block is added in the checkout editor. If webhook events are missing, make sure the webhook URL is public and returns 200 OK.
No. Shopify has switched off additional scripts and script tags on the Thank you and Order status pages (August 2025 for Plus stores, August 2026 for everyone else). Use your referral app's checkout block instead.
Yes. Validate widget placement and webhook delivery in a staging or development store first, then monitor webhook retries so no payout is missed.