Use this guide when you want to offer customers an upgrade or plan switch from a headless storefront, Magento account area, Salesforce Commerce Cloud account area, or another external customer experience. This flow is useful when the new plan should only become active after the customer pays an initial amount. A common example is upgrading from a monthly recurring plan to a prepaid 6-month plan with a lower monthly equivalent price.Documentation Index
Fetch the complete documentation index at: https://docs.firmhouse.com/llms.txt
Use this file to discover all available pages before exploring further.
Paid plan switch offers are currently in private beta.
How it works
- You build the upgrade promotion UI in your own storefront or account area.
- When the customer accepts the offer, your app calls
switchSubscriptionPlan. - Firmhouse creates an
Offerand returns anacceptUrl. - You redirect the customer to
acceptUrl. - The customer completes payment through your configured payment provider.
- Firmhouse records the payment, finalizes the invoice, switches the subscription to the new plan, and creates related records.
- Firmhouse redirects the customer to your success or failure URL if you passed those URLs to the mutation.
- You can listen for webhooks to know when the offer was accepted.
updateSubscribedPlan instead.
Create the upgrade UI
Create a section in your storefront or account area that explains the upgrade and why it is useful to the customer. This can be:- a dashboard widget
- a modal behind an Upgrade button
- a plan comparison screen
- a campaign landing page for logged-in customers
switchSubscriptionPlan.
Start the paid switch flow
CallswitchSubscriptionPlan with the current subscription ID and the target plan ID.
offer.acceptUrl. Firmhouse opens the payment flow for the requested initial payment.
Offer URLs expire after 30 minutes. Create the offer when the customer explicitly starts the upgrade flow, not ahead of time.
Redirect customers back to your site
PasssuccessUrl and failureUrl if you want customers to return to your own website after the payment flow.
successUrlafter the customer successfully pays and accepts the offer.failureUrlwhen the offer URL has expired or the offer cannot be accepted.
Listen for accepted offers
When the customer accepts the offer, Firmhouse marks the offer as completed and emits anoffer_completed webhook.
Use that webhook to update your external customer account area, analytics, CRM, or marketing automation.