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.

{
email: "example@google.com"
}

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.

{
customer_id: "cus_FtWXI6U0YxebLd"
}

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 Servicebot (connected to 'Live Mode' in Stripe). The hash is generated with your Servicebot ID and the customer's email or Stripe Customer ID, whichever you are using to identify users.

{
hash: "0709c7f107ed6326aaeaa3810330834870591f3924943e7bce66a826ac532045"
}

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‚Äč

{
theme: {
stripeElement: {
style: {
base: {
color: 'red',
fontSize: '30px',
height: '40px'
}
}
}
}
}

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.

{
handleResponse: async function(payload) {
console.log("Event ", payload.event);
console.log("Response Object ", payload.response);
}
}

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.

{
coupon: "coupon_id"
}

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.

{
options: {
metadata: {
key1: "Value 1",
key2: "Value 2"
}
}
}

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.

{
options: {
default_tax_rates: [
"txr_1HZfxhEGJvDU3rtbcukgdicw"
]
}
}