The subscription options displayed on the checkout page of your app (/menu/checkout) are generated automatically based on the subscription plans you have defined and which plans are currently available to the user (e.g. a user on iOS will not see subscription plans that are only available on Android). (For more information on the ways you can customize the display of subscription plans on the checkout page, see this article.)
Sometimes you may want to generate a customized URL to send to users - for example, to prefill a promo code or automatically direct a user to the payment flow for a pre-selected subscription plan. The options available are as follows:
Prefill a promo code
To automatically fill the promo code box on the checkout page, you can append the promo code to the menu checkout URL:
https://demo.treefortsystems.com/menu/checkout/YOUR_PROMO_CODE_HERE
You can also specify the promo code using a query parameter, promoCode:
https://demo.treefortsystems.com/menu/checkout?promoCode=YOUR_PROMO_CODE_HERE
In each of these cases, the checkout page is loaded with YOUR_PROMO_CODE_HERE pre-validated in the box. The promo code can be a Treefort coupon code (to entitle content, redeem a group membership, or redeem a Stripe subscription), a Stripe promo code, a Stripe subscription coupon, or a GiftUp code.
Highlight a specific subscription plan
Normally the highlighted subscription plan on the checkout page is governed by the "Highlight" checkbox in the details of a subscription plan. If you want to override this, specify the plan query parameter:
https://demo.treefortsystems.com/menu/checkout?plan=460
(You can find the subscription plan ID on its card in the Subscription Plans tab of the dashboard.)
Automatically proceed to payment or coupon redemption
In some workflows the ideal user experience is to bypass the pricing page entirely. For example, you might generate group membership codes for users and want to send them a link that immediately redeems that code. Or you might advertise a particular plan and want a link that takes users directly to the payment page for that plan. To accomplish this, use the passthrough query parameter:
https://demo.treefortsystems.com/menu/checkout?passthrough=1
Without any other parameters, passthrough will automatically select the first highlighted option and proceed to the payment page.
You can combine the passthrough option with the other checkout parameters to select which plan the user will be redirected to. For example, the following URL will automatically redeem the coupon code LIFETIME_MEMBERSHIP:
https://demo.treefortsystems.com/menu/checkout?promoCode=LIFETIME_MEMBERSHIP&passthrough=1
Or this URL would automatically direct to the payment page for subscription plan ID 29:
https://demo.treefortsystems.com/menu/checkout?plan=29&passthrough=1
If both plan and promoCode are specified, and if there is a conflict between the two (i.e. they would highlight different plans), the promoCode will take precedence.
Limit subscription plan options to those unlocking an offering
If you want to direct users to plans that will unlock a particular offering, use the offeringIds parameter:
https://demo.treefortsystems.com/menu/checkout?offeringIds=40
(Find the offering ID from its card on the Offerings tab of your dashboard.)
You can specify offeringIds multiple times to show all plans that unlock at least one of them:
https://demo.treefortsystems.com/menu/checkout?offeringIds=40&offeringIds=41
Redirect to a content item after checkout
To redirect a user to a content item after the user completes checkout, use the checkoutContentId option:
https://demo.treefortsystems.com/menu/checkout?checkoutContentId=12
