Generate a QR Code for a Referral Link (API)

Connor Johanning Updated by Connor Johanning

Overview

Friendbuy now offers an API endpoint that allows you to generate QR codes for Advocate referral links. This endpoint lets you easily create scannable QR codes that can be displayed across multiple channels - such as mobile apps, print inserts, or marketing emails - helping customers share referral links more seamlessly.

This API will:

  • Generate a QR code image for the Advocate’s referral link.
  • Save the image to S3.
  • Return a CloudFront-hosted URL to that image.

You can review the full technical reference here: Friendbuy Developer Docs → POST /personalReferralLink

Use Cases

  • In-app display: Show each Advocate’s QR code directly in their mobile app profile.
  • Printed materials: Include personalized QR codes on packaging, posters, or direct mail inserts.
  • Email marketing: Add a QR code to referral emails for a more visual sharing option.

How It Works

Make an API call to the/personalReferralLink endpoint. The body of your request should include, the customerId, email, campaignId and the channel. "Channel" should be set to "qr".

When called, the API:

  1. Generates a QR code image representing the Advocate’s referral URL.
  2. Uploads the image to Amazon S3.
  3. Returns the CloudFront URL where the image is hosted.

Example Payload

FAQs

Q: Is the referral link unique to each Advocate? A: Yes. Each QR code maps directly to that Advocate’s personalized referral link.

Q: Does this API replace the existing referral link endpoint? A: No. It extends it — the QR Code API is a dedicated use case of the same endpoint, optimized for image generation.

Q: Where are the QR code images stored? A: Each QR code image is stored in Amazon S3 and accessed via a CloudFront URL returned in the response.

Q: Can I customize the QR code design or branding? A: Not currently. The generated QR code uses Friendbuy’s default format, but customization options may be added in future releases.

How did we do?

Contact