> For the complete documentation index, see [llms.txt](https://help.fungies.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.fungies.io/for-saas-developers/using-customfields-to-parse-data-from-your-software-app/pre-fill-fields-e-mail-discount-in-checkout-url.md).

# Pre-fill fields (e-mail, discount) in checkout URL

### Custom Links for Hosted Checkout

#### Purpose

This feature allows to use custom links for the hosted checkout on their websites. It streamlines the checkout process by dynamically pre-filling user-specific details, such as the user’s email address and the quantity of the product being purchased. This is particularly beneficial for businesses selling subscriptions or products requiring customized inputs.

<figure><img src="/files/TYC8fYQxGDqtyifJAbX1" alt=""><figcaption><p>Hosted Checkout with pre-filled Customer E-mail + pre-filled Discount Code</p></figcaption></figure>

***

#### How It Works

You can add specific query parameters to the hosted checkout URL to dynamically pass values like:

* User Email: Pre-fills the email field for the end-user using the fngs-user-email parameter.
* Quantity: Pre-sets the quantity for the product using the fngs-quantity parameter.

Note: To use the fngs-quantity parameter for subscription offers, the Mutable Quantity feature must be enabled in the offer settings.

When the link with the query parameters is used to redirect a user to the hosted checkout page, these parameters are automatically applied, providing a tailored and seamless checkout experience.

***

#### Steps to Use

1. Construct the Custom Link:

Start with the base URL of the hosted checkout page:\
\
<https://example.com/checkout>

Add query parameters to the URL for dynamic values:

* fngs-user-email: The user's email address.
* fngs-quantity: The quantity of the product.
* fngs-discount-code: Discount code prefill.
* fngs-customer-country: The country of the customer (2-character country code) which will pre-fill the Country field with the country you set up here (e.g. \[your\_url]/checkout/\[trx\_id]?fngs-customer-country=US)
* Example:

<https://example.com/checkout?fngs-user-email=john.doe@example.com\\&fngs-quantity=3>

2. Enable Mutable Quantity (For Subscription Offers):\
   \
   If the offer involves subscriptions, ensure the Mutable Quantity feature is enabled in the offer settings. Without this setting, the fngs-quantity parameter will not be applied to subscription products.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfzayHwJ8SBkXGkaz6n0aXjxXerb6bTE6Wqb4qruRfupLLNjepZGSgxM9EKXPmncQvBuaKdBvqqi79J-DouxGAsbRAN5CIjYVvn6e136HiEEPsC_pXgpfshzj4CN30-yMe7IAPM?key=BrtvmpwdK3cgLr352VxlgHcl)

3. Redirect to the Link:

* Use the custom link in your website’s code to redirect users to the checkout page. Ensure the query parameters are correctly populated with dynamic values before redirection.

3. Verify the Checkout:\
   \
   The hosted checkout page will display:

* Prefilled Email: From the fngs-user-email parameter.
* Quantity: From the fngs-quantity parameter, if applicable.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXezvGvUtNivwOltHlY2XlzC7ALIv3EAJQwSrE5xzJpTOnJjhJq1JTugEtFdsDailozuXpGHWscDC2x9E0LouoVffoJlYOd7mgKtul1V9xaJ-JBiZUTtCOet7aoczuPRm0sVceMpFg?key=BrtvmpwdK3cgLr352VxlgHcl)

<br>
