Skip to main content
Card-required trials give customers full access to a paid plan for a limited time. Payment information is collected upfront, and customers are billed after the trial ends. Customers can cancel anytime during the trial period. If they cancel, their account downgrades when the trial expires. If they don’t cancel, billing begins automatically. Companies using this model include Lindy, Descript and Fxyer.

Configure Pricing

You can toggle on a free trial for a plan when creating it, or in the “plan settings” section. By default, the “card required” flag is set to true.

You can optionally charge a small upfront fee for trial access, often used to qualify leads and reduce trial abuse while maintaining low barrier to entry.Create an add-on plan, with a one-time price. We will attach the plan with a free trial, and the trial-fee add on at the same time.

Implementation

Enabling the trial

Enable the trial with the normal plan enablement flow. Only customers that have not used the trial before will be able to access it.
import { useCustomer } from "autumn-js/react";

const { checkout } = useCustomer();

<Button onClick={() => checkout({ productId: "pro" })} />;
import { useCustomer } from "autumn-js/react";

const { checkout } = useCustomer();

<Button onClick={() => checkout({ productIds: ["pro", "trial_fee"] })} />;
You may want to block certain users from accessing the trial. You can pass in free_trial: false into the checkout/attach request to disable the trial.
After the trial ends, the customer will be automatically charged the full price of the plan.

Ending the trial early

You can end the trial early by cancelling the plan immediately, and attaching it again. You may want to pass in a reward into the attach request to give the customer a discount for upgrading early.
import { useCustomer } from "autumn-js/react";

const { cancel, attach } = useCustomer();

const handleEarlyEnd = async () => {
    await cancel({
        productId: "pro",
        cancelImmediately: true,
    });
    await attach({
        productId: "pro",
        // give the customer a discount for upgrading early
        reward: "early_end",
    });
    
    console.log("Trial ended early");
};

<Button onClick={handleEarlyEnd} />;

Cancelling the trial

Customers can cancel the trial at any time. If they cancel, the plan will expire when the trial ends. If there is an auto-enable plan (eg your free tier), this will then be enabled. You can uncancel the trial plan by attaching it again.
import { useCustomer } from "autumn-js/react";

const { cancel } = useCustomer();

<Button onClick={() => cancel({ productId: "pro" })} />;

  1. Enabling the trial
  2. Ending the trial period
  3. Ending the trial early
  4. Cancelling trial
You can test using stripe test clock