Automatic Renewals
Automatic Renewals turns a recurring plan into a subscription at the payment provider. The provider charges each renewal and retries failed payments, and Core Forms extends the license after every successful charge.
Without this module, every Core Commerce purchase is a one-time payment and customers renew by hand. With it, a buyer who chooses a yearly plan is charged again every year until they or you turn renewal off.
Turn on automatic renewals
- Go to Core Forms > Modules and turn on Automatic Renewals. It needs Licensing and Storefront and Payments, and turns them on if they’re off.
- Add each provider’s keys under Core Forms > Settings > Payments. See Payments for each provider’s keys.
- Open Core Commerce > Settings and scroll to Automatic renewals.
- For each provider, leave Charge recurring plans automatically with Stripe (or the provider’s name) ticked, or untick it to keep that provider one-time.
- Add the webhook events listed under each provider at the provider’s dashboard, using the Endpoint shown there.
- Click Save renewal settings.
The setting applies to new purchases. Licenses sold before keep renewing by hand.
What becomes a subscription
Only a purchase of exactly one plan that renews every day, week, month or year becomes a subscription. These stay one-time payments:
- an order with more than one plan;
- lifetime plans;
- renewals and license upgrades;
- an order whose first payment is higher than the renewal price, for example because of a paid checkout question;
- a provider you’ve unticked in the Automatic renewals section, plus Square and FluentCart, which don’t renew automatically.
The renewal price is the plan price times the quantity, minus a coupon set to Every payment, including automatic renewals, plus tax when prices exclude tax.
The checkout tells buyers what to expect, such as “Renews automatically every year”. When only some payment methods renew, it names them and adds “one-time with other methods”.
Gateways that renew automatically
| Gateway | First payment can be lower than the renewal | Renewal can be turned back on after it’s off |
|---|---|---|
| Stripe | Yes, through a one-time discount at Stripe | Yes |
| PayPal | Yes, as a one-cycle paid trial | Yes, until the subscription is cancelled at PayPal |
| Mollie | Yes | Yes, as a new subscription on the saved payment method |
| Razorpay | No | No |
| Polar | No | Yes, until the subscription ends |
| Paddle | No | Yes, until it’s canceled or paused |
| Creem | No | Yes, until it’s canceled |
| Dodo Payments | No | Yes, until it’s cancelled or expired |
| Flutterwave | No | Yes |
| Mercado Pago | No | Yes, until it’s cancelled |
| Paystack | No | Yes |
When the first payment must equal the renewal and a first-payment coupon would make it lower, the purchase stays one-time on that gateway.
Plan trial days lengthen the first license term. They don’t create a free trial at the gateway, and gateways other than Stripe, Mollie and Dodo Payments keep a plan with trial days one-time.
Set up each gateway’s webhooks
The Automatic renewals section lists the events each provider needs. All of them use the gateway’s endpoint, such as https://example.com/wp-json/cf/v1/payments/stripe/webhook.
| Gateway | Events to add for renewals |
|---|---|
| Stripe | invoice.paid, invoice.payment_failed, customer.subscription.updated, customer.subscription.deleted, plus checkout.session.completed and charge.refunded |
| PayPal | BILLING.SUBSCRIPTION.ACTIVATED, BILLING.SUBSCRIPTION.SUSPENDED, BILLING.SUBSCRIPTION.CANCELLED, BILLING.SUBSCRIPTION.EXPIRED, BILLING.SUBSCRIPTION.PAYMENT.FAILED, PAYMENT.SALE.COMPLETED, PAYMENT.SALE.REFUNDED, PAYMENT.SALE.REVERSED |
| Razorpay | subscription.activated, subscription.charged, subscription.pending, subscription.halted, subscription.cancelled, subscription.completed, refund.processed |
| Polar | order.paid, order.refunded, subscription.active, subscription.canceled, subscription.uncanceled, subscription.revoked, subscription.past_due |
| Paddle | transaction.completed, subscription.activated, subscription.updated, subscription.past_due, subscription.canceled, adjustment.created, adjustment.updated |
| Creem | checkout.completed, subscription.active, subscription.paid, subscription.update, subscription.scheduled_cancel, subscription.canceled, subscription.expired, subscription.past_due, subscription.unpaid, refund.created |
| Dodo Payments | payment.succeeded, payment.failed, refund.succeeded, subscription.active, subscription.updated, subscription.renewed, subscription.on_hold, subscription.cancelled, subscription.expired, subscription.failed |
| Flutterwave | charge.completed, subscription.cancelled, refund |
| Mercado Pago | payment, subscription_preapproval, subscription_authorized_payment |
| Paystack | charge.success, subscription.create, invoice.update, invoice.payment_failed, subscription.not_renew, subscription.disable, refund.processed |
| Mollie | None. Mollie calls the webhook URL that Core Forms sends with each payment. |
- Stripe: include
charge.refunded, or refunds of renewal charges made in Stripe won’t reach Core Forms. - PayPal: save the Webhook id under Settings > Payments. PayPal renewals don’t start without it.
- Razorpay: ask Razorpay to turn on Subscriptions for your account first.
What happens at each renewal
- The first charge is the original purchase. It issues the license and sends the order confirmation as usual.
- Each later charge creates a renewal order numbered
CFR-plus the date, and extends the license to the provider’s new period end. - If the provider sends no usable period end, Core Forms adds one billing term to the later of today and the current expiry.
- The renewal keeps the tax rate of the original order. With Invoices on, each renewal gets its own invoice number.
There’s no grace period. A daily job expires licenses whose expiry has passed, and a later successful charge makes the license active again.
Failed payments
The provider retries failed charges on its own schedule. Core Forms doesn’t retry.
When a charge fails, the subscription shows as past due. With the Customer Emails and Reminders module on, the customer gets a Renewal payment failed email with the provider’s payment link where one exists, such as Stripe’s hosted invoice page.
Turning renewal off and back on
Customers manage renewal from their account. Each license in the Licenses section has Turn off automatic renewal, with the confirmation “Turn off automatic renewal? Your license stays active until the end of the current term.” Once it’s off, Turn automatic renewal back on appears. Both buttons disappear after the term ends.
When a provider can’t restart a stopped subscription, the customer sees “Automatic renewal can’t be turned back on for this subscription. Your license stays active until the end of the term, and you can renew it from your account then. Nothing was changed.”
There’s no cancel button in wp-admin. To stop a subscription yourself, cancel or pause it at the provider. Its webhook updates the license in Core Forms. The REST API refuses local edits to provider subscriptions with “Change this subscription through its payment provider. Local edits cannot change billing.”
Refunds
Refunds start at the provider. Core Commerce has no refund button.
- A full refund of a renewal charge rolls back only that renewal. The license expiry moves back, and the license stays active if time remains.
- A partial refund changes nothing in Core Forms.
- A refund of the first charge refunds the original purchase. Its licenses are disabled, and the subscription stops at the provider too: Stripe cancels it at once, and the other providers stop renewing it.
Emails
Renewal emails need Customer Emails and Reminders. Without it, Core Forms sends no renewal confirmation, failed payment, renewal turned off or refund email. With it, licenses that renew automatically get Automatic renewal coming up in the 7 days before each charge, instead of the manual renewal reminders.
Turn the module off
Automatic Renewals is protected. While any subscription at a provider is active or past due, the module stays on, even with wp core-forms module disable --force.
Subscriptions whose renewal is already off don’t count. Once nothing is renewing, you can turn the module off. New purchases are then one-time payments, and Core Forms stops recording renewal charges. It doesn’t cancel anything at the provider, so cancel running subscriptions there first.
For developers
GET /wp-json/core-forms/v1/commerce/subscriptionslists subscriptions, filtered bystatusorproduct_id.PATCHon a provider subscription returns 409provider_subscription_required.cf_commerce_order_paidfires with the kindrenewalafter each automatic renewal.cf_license_renewedfires only for manual renewals.cf_checkout_billing_labelfilters the checkout’s renewal label.- New gateways can renew automatically by implementing
Core_Forms\Payments\RecurringGateway.