How Checkout Links Work
Any anchor link or button with a redirect URL in the following format will open the Fermion checkout page:The checkout page is automatically generated by Fermion and includes all
necessary payment processing, security measures, and user authentication.
URL Parameters
Fermion’s checkout system supports several URL parameters to customize the checkout experience:Required Parameters
product-slug
: The slug of your digital product or course that you want users to purchase. This field is mandatory and cannot be omitted.
Optional Parameters
-
discount-code
: Any discount code that needs to be automatically applied to the user’s checkout session. The discount code must exist in your product’s discounts section area. If the code doesn’t exist or has expired, users will see an “Invalid discount code” warning but can still complete checkout at full price. -
digital-product-price-id
: The specific price ID for the digital product, useful if you have multiple pricing plans. -
total-installments-count
: The number of installments for partial payment plans. Only required if the selected plan is an installment plan. -
prefilled-name
: Pre-fills the user’s name on the checkout form. Useful when your landing page collects user input. -
prefilled-email
: Pre-fills the user’s email address on the checkout form. Useful when your landing page collects user input. -
prefilled-phone-number
: Pre-fills the user’s phone number on the checkout form. Useful when your landing page collects user input. -
smart-checkout-redirect
: Set totrue
to automatically redirect to the best available payment gateway whenprefilled-email
andprefilled-name
are present. This reduces one step for users to complete. - UTM Parameters: For marketing attribution, you can add any of the following:
-
utm_source
,utm_medium
,utm_campaign
,utm_id
,utm_term
,utm_content
Make sure to properly encode all parameter values to avoid breaking the
checkout flow. Special characters in names, emails, or discount codes must
be URL-encoded.
Code Examples
Basic Checkout Link
Checkout Link with Discount Code and UTM Parameters
Checkout Link with Pre-filled Information and Installments
Complete Checkout Link with All Parameters
JavaScript Implementation
For dynamic checkout links that collect user input from your landing page, use this JavaScript function to safely construct the checkout URL:The JavaScript approach using
URLSearchParams
automatically handles URL
encoding, making it the safest way to construct checkout links with user
input.Manual URL Construction
If you prefer to construct URLs manually, ensure you useencodeURIComponent()
for all parameter values:
Failing to properly encode parameter values can break the checkout flow,
especially when dealing with special characters in names, emails, or
discount codes.
Integration with Custom Landing Pages
To integrate checkout links with your custom landing pages:- Create your custom page in Fermion’s instructor dashboard
- Design your landing page with HTML, CSS, and JavaScript
- Add checkout buttons/links using the
/api/buy-digital-product
URL format - Test the checkout flow to ensure all parameters work correctly
- Publish your page when ready
Your custom landing page will maintain full design control while seamlessly
integrating with Fermion’s secure checkout system.
Best Practices
- Always test checkout links before publishing your landing page
- Use the JavaScript approach when collecting user input to ensure proper encoding
- Keep discount codes simple and avoid special characters when possible
- Validate user input before constructing checkout URLs
- Provide fallback options in case discount codes are invalid or expired
- Use UTM parameters to track marketing attribution and campaign performance
The checkout page automatically handles payment processing, user
authentication, and product access management, so you can focus on creating
compelling landing pages that drive conversions.