Prefilling billing data reduces friction in the checkout process by automatically populating form fields with customer information you already have.
Available Fields
| Field | SDK Property | HTML Attribute | Query Parameter |
|---|
| Email | billingData.email | data-fungies-billing-email | fngs-customer-email |
| First Name | billingData.firstName | data-fungies-billing-first-name | fngs-customer-first-name |
| Last Name | billingData.lastName | data-fungies-billing-last-name | fngs-customer-last-name |
| Country | billingData.country | data-fungies-billing-country | fngs-customer-country |
| State | billingData.state | data-fungies-billing-state | fngs-customer-state |
| City | billingData.city | data-fungies-billing-city | fngs-customer-city |
| ZIP Code | billingData.zipCode | data-fungies-billing-zip-code | fngs-customer-zip-code |
The legacy customerEmail property and data-fungies-customer-email attribute are still supported but deprecated. Use billingData.email instead.
Usage Examples
JavaScript SDK
Fungies.Checkout.open({
checkoutUrl: "https://yourstore.fungies.io/checkout-element/abc123",
settings: { mode: "overlay" },
billingData: {
email: "[email protected]",
firstName: "John",
lastName: "Doe",
country: "US",
state: "CA",
city: "Los Angeles",
zipCode: "90001"
}
});
HTML Data Attributes
<button
data-fungies-checkout-url="https://yourstore.fungies.io/checkout-element/abc123"
data-fungies-mode="overlay"
data-fungies-billing-email="[email protected]"
data-fungies-billing-first-name="John"
data-fungies-billing-last-name="Doe"
data-fungies-billing-country="US"
data-fungies-billing-state="CA"
data-fungies-billing-city="Los Angeles"
data-fungies-billing-zip-code="90001">
Buy Now
</button>
Query Parameters (Hosted Checkout)
https://yourstore.fungies.io/checkout/offer-id
[email protected]
&fngs-customer-first-name=John
&fngs-customer-last-name=Doe
&fngs-customer-country=US
&fngs-customer-state=CA
&fngs-customer-city=Los%20Angeles
&fngs-customer-zip-code=90001
Remember to URL-encode values that contain special characters (spaces, @, etc.).
Country Codes
The country field accepts ISO 3166-1 alpha-2 country codes:
| Code | Country |
|---|
US | United States |
GB | United Kingdom |
CA | Canada |
AU | Australia |
DE | Germany |
FR | France |
PL | Poland |
JP | Japan |
| … | Full list |
State/Province Codes
For countries that require state/province selection (US, Canada, Australia, etc.), use the appropriate subdivision codes:
United States:
CA - California
NY - New York
TX - Texas
- etc.
Canada:
ON - Ontario
BC - British Columbia
QC - Quebec
- etc.
Field Visibility
Billing fields are only visible in checkout when:
- Billing information is enabled in your checkout settings, or
- Your Stripe account is based in India (required by regulations)
If billing fields are hidden, the prefilled data will still be stored with the order.
Priority Order
When multiple sources provide billing data, this priority is used:
- Query parameters / SDK billingData - Highest priority
- Persisted customer data - From previous sessions (local storage)
- IP-based detection - Automatic country detection
- Default values - Fallback (e.g., United States)
This ensures that explicitly passed billing data always takes precedence over previously saved data.
Additional Query Parameters
Beyond billing data, hosted checkout supports these query parameters:
| Parameter | Description |
|---|
fngs-quantity | Product quantity |
fngs-discount-code | Discount code to apply |
Example with Discount
https://yourstore.fungies.io/checkout/offer-id
[email protected]
&fngs-customer-country=US
&fngs-discount-code=SAVE20
&fngs-quantity=2