Subscription renewal orders
On this page
What is a renewal order?
When an evergreen subscription reaches its billing date, StoreConnect creates a Salesforce Order record and charges the customer. By default this happens on the billing date itself.
A renewal order is that same Order record, created early — a set number of days before the billing date. The order exists in Salesforce before any payment is taken, with a checkout_step of pending_renewal. When the billing date arrives and the payment is charged, the payment is applied to the existing renewal order rather than creating a new one.
Creating orders in advance is useful when you need to:
- Report on upcoming subscription revenue before billing runs
- Allow customers to pay their renewal early
- Trigger Salesforce Flows or automations before the charge date (for example, to review or adjust the amount)
- Give customers visibility in their account area of when their next order will be raised
How renewal orders are created
The daily subscription processing job checks every active subscription. When the current date matches the date stored in Subscription__c.Renewal_Order_Date__c, the job creates the renewal Order and links it to the subscription via Subscription__c.Renewal_Order_Id__c.
The Renewal_Order_Date__c is calculated at subscription creation (and at each renewal) by subtracting the Renewal Order Days value from the subscription’s next billing date.
For example, if the next billing date is the 1st of the month and Renewal Order Days is set to 7, the renewal order is created on the 25th of the previous month.
If Renewal Order Days is blank or set to 0, no advance order is created — the order is created on the billing date as normal.
Configuring renewal orders on a product
Renewal orders are configured per subscription product using the Renewal Order Days field on Product2.
| Field label | API name | Description |
|---|---|---|
| Renewal Order Days | s_c__Subscription_Renewal_Order_Days__c |
Number of days before the billing date to create the renewal order. Leave blank to create the order on the billing date. |
- Open the subscription product in Salesforce.
- Locate the Renewal Order Days field (add it to the page layout if it is not visible — see Add a subscription product).
- Enter the number of days in advance you want the renewal order created.
- Save the product.
The setting takes effect from the next renewal cycle. Existing subscriptions created from this product will have their Renewal_Order_Date__c updated when the subscription is next processed.
Renewal order fields on the Subscription record
When a renewal order has been created (or is scheduled), two fields on Subscription__c are populated:
| Field label | API name | Description |
|---|---|---|
| Renewal Order Date | s_c__Renewal_Order_Date__c |
The date the renewal order will be (or was) automatically generated. |
| Renewal Order | s_c__Renewal_Order_Id__c |
Lookup to the generated renewal Order record. Blank until the order is created. |
Add these fields to your Subscription__c page layout if your team monitors subscription records and needs visibility of upcoming renewal orders.
The renewal order in Salesforce
A renewal order is a standard Salesforce Order record. It moves through the following checkout step states:
| Checkout step | Meaning |
|---|---|
pending_renewal-syncing |
Order has been created ahead of billing. No payment has been taken yet. |
payment |
The subscription charge job has run and is processing the payment. |
payment-finalized |
Payment has been captured. |
complete |
Order is fully complete. |
The order starts in pending_renewal-syncing and remains there until the billing date, when the charge job picks it up. If a renewal order has been stuck in pending_renewal-syncing longer than expected, the subscription has not yet been charged — check whether the charge job has run or encountered an error.
If you have Flows, Process Builders, or other automation that processes subscription orders, check whether those automations should behave differently for pending_renewal-syncing orders. For example, you may want to:
- Exclude
pending_renewal-syncingorders from revenue recognition until the payment is charged - Trigger a review step on
pending_renewal-syncingorders before the billing date - Send a renewal notification to the customer when a
pending_renewal-syncingorder is created
Surfacing renewal orders in your store with Liquid
The subscription Liquid drop exposes two properties for renewal orders:
| Property | Type | Description |
|---|---|---|
renewal_order |
Order | The Order associated with the next renewal. Returns nil until the renewal order has been created. |
renewal_order_date |
Timestamp | The date the renewal order will be generated. |
Use these to show customers when their next renewal order will be raised, or to link through to the renewal order once it exists.
Example — showing the renewal order date on a subscriptions page:
liquid
{% if subscription.renewal_order_date %}
Your next renewal order will be created on {{ subscription.renewal_order_date | date: "%B %d, %Y" }}.
{% endif %}
Example — linking to the renewal order once it exists:
liquid
{% if subscription.renewal_order %}
<a href="{{ subscription.renewal_order.url }}">View your renewal order</a>
{% endif %}
The default theme’s subscription index page includes translation keys for these states:
| Key | Default value |
|---|---|
accounts.subscriptions.index.renewal_order |
Renewal Order |
accounts.subscriptions.index.no_renewal_order |
No renewal order |
If your theme overrides the subscriptions index template, add these keys to your theme translations to display renewal order status.
Taking payment on a renewal order manually
StoreConnect’s automatic charge job handles renewal order payment and keeps the subscription record up to date. If a customer needs to pay early, the preferred approaches are:
- Customer pays from their account — the customer can pay directly from their subscription page on your store. This goes through the full subscription payment flow and updates all subscription fields automatically.
- Send the customer a payment link — you can send the customer a direct link to their subscription payment page (
/account/subscriptions/{id}/payment). This uses the same flow as above.
If you use the Take Payment action in Salesforce to pay a renewal order directly, that path processes the payment against the order but does not update the subscription. You can handle this with a Salesforce Flow or by updating both records manually.
Automating the update with a Flow
You can build a record-triggered Flow on the Payment object to detect when a renewal order has been paid via Salesforce and update the order and subscription automatically.
Trigger condition: fire when a Payment record is created where:
- Origin (s_c__origin__c) equals SF01 (Salesforce payment)
- The related Order’s Checkout Step contains pending_renewal
From the Payment record you can navigate to the related Order (s_c__Order_Id__c) and from the Order to the related Subscription (s_c__Renewal_Order_Id__c on the Subscription, or via the Order’s subscription relationship) to apply the same field updates described below.
See Payment origin codes for the full list of origin values.
What to update on the order
| Field | What to set |
|---|---|
Checkout Step (s_c__checkout_step__c) |
Set to complete |
What to update on the subscription
| Field | What to set |
|---|---|
Next Renewal Date (s_c__Next_Renewal_Date__c) |
Advance by one term period (e.g. if the subscription bills monthly and the current value is June 1, set it to July 1) |
Next Billing Date (s_c__Next_Billing_Date__c) |
Set to the new Next Renewal Date, plus the billing delay if one is configured on the subscription |
Renewal Order Date (s_c__Renewal_Order_Date__c) |
Set to the new Next Renewal Date minus the product’s Renewal Order Days (leave blank if Renewal Order Days is not configured) |
Renewal Order (s_c__Renewal_Order_Id__c) |
Clear — set to blank |
If the subscription was delinquent before payment, also clear these fields:
| Field | What to set |
|---|---|
Delinquent Date (s_c__Delinquent_Date__c) |
Clear |
Delinquent Reason (s_c__Delinquent_Reason__c) |
Clear |
Delinquent Order (s_c__Delinquent_Order_Id__c) |
Clear |
The term period and billing delay for the subscription are shown on the subscription record’s Term Length, Term Unit, Billing Delay Length, and Billing Delay Unit fields.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.