Use this file to discover all available pages before exploring further.
Free plan users can optionally add a payment method so that if they exceed their included usage, they’re billed for the overage rather than blocked. This is done by having two plans: a Free plan (no overages) and a Pay-as-you-go plan (with overage pricing).This is useful when you want to:
Avoid blocking engaged free users who exceed limits
Convert free users to paying customers through natural usage growth
Offer a “soft limit” experience without requiring upfront payment
Free plan: 1,000 notifications per month included, blocked when exceeded
Pay-as-you-go plan: 1,000 notifications per month included, $1 per 1,000 notifications beyond the included amount
If a free user exceeds 1,000 notifications, they get blocked.
If they’ve switched to Pay-as-you-go (by adding a card), they’re charged $1 per 1,000 notifications at the end of the billing period.
Create a Pay-as-you-go plan with the same 1,000 notifications included, but with overage pricing:
Grant amount: 1,000 notifications
Price: $1 per 1,000 notifications per month
Billing method: Usage-based
In advanced, toggle off the “Reset usage when enabled” flag. This ensures that when a user switches from Free to Pay-as-you-go, their existing usage carries over instead of resetting to 0.
Before sending a notification, check if the customer has remaining capacity.
import { useCustomer } from "autumn-js/react";export function SendNotification() { const { check } = useCustomer(); const handleSendNotification = async () => { const { data } = await check({ featureId: "notifications" }); if (!data?.allowed) { // User is over limit on Free plan // Prompt them to switch to Pay-as-you-go alert("You've run out of notifications. Add a payment method to continue."); return; } // Proceed with sending notification };}
When the user is approaching or has exceeded their limit, prompt them to switch to the Pay-as-you-go plan. Use attach with setup_payment: true to collect their card without charging upfront.
You can retrieve the user’s notification balance from the check or customer method, and use this to conditionally prompt them to add a payment method.
Once the user completes the setup, they’ll be switched from the Free plan to the Pay-as-you-go plan. Because “Reset usage when enabled” is off, their existing usage carries over. Any usage beyond 1,000 notifications will be billed at the end of the billing period.
After switching to Pay-as-you-go, the user’s check response will show overage_allowed: true. They can continue using the feature beyond their included limit.