B
B
Billflow
Search…
Checkout Form Configs
Checkout Form Configuration Options

Required Configs

email

Type
Required
Description
String
Yes OR customer_id
The customer's email address. This will automatically populate checkout, or be used to identify current subscribers. Can alternatively use customer_id.
1
{
3
}
Copied!

customer_id

Type
Required
Description
String
Yes OR email
The customer's Stripe Customer ID. This will be used to identify existing subscribers or subscribe new customers. You must have already created the Stripe Customer object to use this.
1
{
2
customer_id: "cus_FtWXI6U0YxebLd"
3
}
Copied!

hash

Type
Required
Description
String
Yes
An HMAC string used for authenticating the user loading the embed more securely. This is required in order to go to 'Live Mode' in Billflow (connected to 'Live Mode' in Stripe). The hash is generated with your Billflow ID and the customer's email or Stripe Customer ID, whichever you are using to identify users.
1
{
2
hash: "0709c7f107ed6326aaeaa3810330834870591f3924943e7bce66a826ac532045"
3
}
Copied!

Available Configs

theme.stripeElement

Type
Required
Description
Object
No
Add custom Stripe Element Styles. Inside the stripeElement object, it is exactly the same as how Stripe works
1
{
2
"billing_page_id":"YOUR_BILLING_PAGE_ID",
3
...
4
...
5
"theme":{
6
"stripeElement":{
7
"style":{
8
"base":{
9
"fontSize":"14px",
10
"lineHeight":"40px",
11
"color":"white",
12
"fontFamily":"-apple-system",
13
"borderRadius":"4px",
14
"::placeholder":{
15
"color":"white"
16
}
17
}
18
}
19
}
20
}
21
}
Copied!

handleResponse

Type
Required
Description
Function
No
Function that is called when users signup, change plan (upgrade/downgrade), resubscribe, or update Credit Card. Used to update user data, do redirects, or provide notifications. Payload contains an event name and a response object. Learn More.
1
{
2
handleResponse: async function(payload) {
3
console.log("Event ", payload.event);
4
console.log("Response Object ", payload.response);
5
}
6
}
Copied!

coupon

Type
Required
Description
String
No
Stripe coupon ID. Pass in to have a coupon automatically applied to all prices on the page. Also works with Stripe Promo Codes.
1
{
2
coupon: "coupon_id"
3
}
Copied!

service

Type
Required
Description
String
No
The Billflow service. Use this to dynamically pass in different service to the billing page.
1
{
2
service: "Your Service"
3
}
Copied!

tier

Type
Required
Description
String
No
Tier name as defined by the sb_tier metadata tag. Pass in tier & interval to dynamically show specific checkout forms.
1
{
2
tier: "Basic"
3
}
Copied!

interval

Type
Required
Description
String
No
Interval string for the desired tier. Eg: day, month, year
1
{
2
interval: "month"
3
}
Copied!

interval_count

Type
Required
Description
Integer
No
This is only required if you are using a custom interval like 'every 6 months' or 'every 2 weeks'. It will be the number for the custom interval.
1
{
2
interval_count: 6
3
}
Copied!

Options

options.metadata

Type
Required
Description
Object
No
An object of key-value pairs. They will be added to the metadata of the Customer and Subscription in Stripe when they are created.
1
{
2
options: {
3
metadata: {
4
key1: "Value 1",
5
key2: "Value 2"
6
}
7
}
8
}
Copied!

options.default_tax_rates

Type
Required
Description
Array
No
An array of Stripe tax rate IDs to be applied to a subscription on creation. You can learn more about Stripe tax rates here. The tax rate will be applied on subscription creation.
1
{
2
options: {
3
default_tax_rates: [
4
"txr_1HZfxhEGJvDU3rtbcukgdicw"
5
]
6
}
7
}
Copied!

options.quantity

Type
Required
Description
Object
No
Use to set the quantity of a subscription during creation. Can pass in an integer or an object of key-value pairs. The unit_label is defined on the Stripe product and used to define which quantity is being set. If an integer is passed, it will apply the quantity to all products on the tier, if an object is passed with the unit_labels as keys, it will assign that quantity to the respective unit_label.
Eg: 5
OR
Eg: {product_unit_label1 : 10, unit_label2: 20}
1
{
2
options: {
3
quantity: {
4
super_user: 3,
5
user: 5,
6
},
7
}
8
}
Copied!
Last modified 8mo ago