Products

Selling Monthly / Annual Memberships (Auto-Renewal)

How to set up a membership product, how buyers pay, what happens to access on renewal or cancellation, and what refunds do.

On this page

Membership products charge automatically every month (or year), and the customer's access extends with each billing period. If they don't renew, access runs out at the end of the current period.

How to set it up (have your AI do it)

Pass these fields to upsert_product:

  • type: subscription
  • billingInterval: monthly or yearly
  • entitlementType: the access the purchase grants; if it should unlock course viewing, also pass communitySlug (the community the courses live under)
  • priceCents + currency: the price per billing period
⚠️ If you leave out billingInterval, it defaults to monthly. Only products with type=subscription are billed as a subscription, but to keep things unambiguous, please pass one_time explicitly for one-time products.

How buyers pay

"Buy now" on the product page → they're taken to Stripe's subscription checkout page (which clearly states the per-period amount, that it auto-renews, and that it can be canceled anytime) → they're returned to your site once payment is done.

  • Memberships must be purchased on their own: if there are other items in the cart, the buyer is prompted to check out separately
  • Only 1 unit can be bought at a time. Coupon codes work, and the discount applies to every renewal, not just the first payment

What happens automatically afterward

  • A successful renewal: access is extended to the end of the new period, and a renewal order is added
  • The customer cancels (whether you cancel it in the Stripe dashboard, or the customer cancels on the Stripe page): access continues until the end of the current period — it isn't revoked right away
  • A full refund: access is revoked immediately, and the subscription stops at the same time (no charge next month)
  • A partial refund (a price adjustment or goodwill credit): only the money is refunded — the order stays marked as paid, and access, tags, community membership, and the subscription are all left unchanged; the customer gets a "partial refund" notification. The full-refund behavior only kicks in automatically once the cumulative refunds add up to the full amount

Prerequisite: enable all the right Stripe webhooks

In the Stripe dashboard → Developers → Webhooks → your endpoint, besides the usual payment events, also enable:checkout.session.completed, invoice.paid, customer.subscription.updated, customer.subscription.deleted.Missing any of these means the first purchase might not activate access, or renewals might not extend it.

Reminding customers when a renewal charge fails (dunning)

When a customer's card has expired or there isn't enough balance, the renewal charge fails and the subscription becomes past_due. Stripe automatically retries a few times on its own schedule, and only cancels the subscription if every retry fails.

During this window, you should proactively remind the customer to update their card, or you'll lose the subscription:

  • Have your AI create an automation rule: trigger event payment_failed, action send_email (an email saying "Your renewal payment didn't go through — click here to update your card")
  • Use {{ ctaUrl }} for the button in the email — this links to Stripe's payment page, where the customer can update their card and have the charge retried right there
  • Want to remind them more than once? Add a wait step (e.g. wait 3 days) in the action, then send another email
  • You can branch on conditions: isRenewal being true means it's a renewal failure; attemptCount tells you which retry attempt this is

You can also use in the email: {{ productName }} (which membership), {{ amount }} / {{ currency }} (how much), and nextPaymentAttempt (when the next automatic retry happens).

The fields above (isRenewal attemptCount ctaUrl productName nextPaymentAttempt) only come with renewal payment failures. A failed one-time payment only carries reason (why it failed), declineCode, productId and amount, so there's no update-your-card link for the email.

Expiration reminders / expiration notices

For memberships with an expiration date (ones that don't auto-renew, or whose subscription has been canceled), the system checks every day and:

  • Sends an expiration reminder at 7 days, 3 days, and 1 day remaining, using your site's entitlement-expiring email template — to change the wording, edit that template directly. {{ daysRemaining }} is how many days are left, {{ expiresAt }} is the expiration date (in the customer's time zone), and {{ ctaUrl }} is the renewal link
  • If that template is disabled or deleted, the system's default reminder email is sent instead — reminders never get skipped
  • On the expiration day, access is automatically revoked, a "Subscription expired" tag is applied, and an expiration notice is sent
  • Where the renewal button goes: to the funnel if the product has one attached, otherwise to the product's own page (not the store homepage)

To test this: have your AI call set_entitlement_expiry to set a customer's expiration time to +20h (to test the reminder) or -1h (to test the expiration revocation).

Things to ask your AI to look up

  • list_subscriptions: who's subscribed to which membership, through what date, and the status (active / canceled / past_due)
Last updated: October 6, 2026
Still stuck? Just ask

Write your question — we look in the docs first, and hand it to AI support if the answer is not there.

If you have connected an AI, you can ask it directly — it reads these same docs, and it can make the change for you.Or email us at support@dlxai.ai.
We use essential cookies; "Accept" also records device traits to prevent abuse. Cookie Policy