Skip to main content
Rewards like discounts and free products are a powerful way to incentivize customers. You can give these rewards directly via promo codes, or automatically through a referral program.

Rewards

Autumn’s rewards are an enhanced layer over Stripe’s coupons. You can create:
  • Percentage discounts — a percentage off invoices
  • Fixed discounts — a fixed amount off invoices
  • Free products — grant a free add-on product to customers

Setting up

  1. Navigate to the Products page, and click the Rewards tab
  2. Click ”+ Reward”
  3. Fill out the fields: Name, Promo Code, Discount value
  4. Select which products it should apply to
  5. Click “Create”

Free products

You can give away any add-on product to a customer with a promo code.
Example
A customer has access to 50 AI messages per month. They redeem a code for a free booster pack of an additional 100 messages per month.
To create a free product reward, under reward Type, select “Free Product”. Then choose the add-on product from the selector. You must have at least one add-on product created before doing this.
Free product promo codes cannot be redeemed through Stripe’s checkout page. Use the redeem endpoint instead.

Referral Programs

Referral programs automatically grant rewards to customers who bring on new customers. You define the program in the Dashboard, then implement it in your application with just two API calls.

Setting up

  1. Navigate to the Products page, and click the Rewards tab
  2. Click ”+ Referral Program”
  3. Give the program an ID (you’ll use this in the API) and select a reward to grant
  4. Choose the trigger event — when the new customer signs up, or when they purchase a product
  5. Set a max redemptions limit (how many times one referrer can be rewarded)
  6. Choose who receives the reward — the referrer only, or both the referrer and the new customer

Referral program configuration

FieldDescription
Program IDIdentifier used to refer to the program in the API
RewardThe reward to grant (discount or free product)
Trigger eventcustomer_creation (on sign up) or checkout (on product purchase)
ProductsWhich products trigger the reward (checkout trigger only)
Exclude trialSkip triggering for trial subscriptions
Max redemptionsLimit how many times one referrer’s code can be used
Received byreferrer only, or all (both referrer and redeemer)

Creating a referral code

Generate a referral code for the customer making the referral:
import { useReferrals } from "autumn-js/react";

const { data, refetch } = useReferrals({ programId: "free-month" });

await refetch();

console.log(data?.code); // "4EXWV1"

Redeeming a referral code

From the new customer, redeem the referral code:
import { useReferrals } from "autumn-js/react";

const { redeemCode } = useReferrals({ programId: "free-month" });

const response = await redeemCode({ code: "4EXWV1" });

console.log(response.rewardId); // "free-month"

How it works

  1. A referrer generates a unique code via the create code endpoint
  2. A new customer redeems the code via the redeem code endpoint
  3. If the trigger is customer_creation, the reward is applied immediately on redemption
  4. If the trigger is checkout, the reward is applied when the redeemer purchases an eligible product
  5. The reward is granted to the referrer only, or both referrer and redeemer, depending on the program configuration

Validation rules

  • A customer cannot redeem their own referral code
  • A customer can only redeem one code per referral program
  • Referral codes respect the max redemptions limit set on the program
  • If exclude trial is enabled, checkout rewards won’t trigger for trial subscriptions
In the customer details page, you can see which customers have made referrals and been referred.