🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Chargebee Premium Add-on Setup Guide

Updated 6 min read Gravity Forms Integrations A–Z
On this page
  1. Video walkthrough
  2. What you need
  3. Get your Chargebee site and API key
  4. The settings page
  5. Your site, your key and the test button
  6. Add a feed to your form
  7. The customer
  8. The subscription
  9. Only send when you want to
  10. On the front end
  11. What is saved on the entry
  12. Notifications and events
  13. Retries never double-create
  14. Security and privacy
  15. Troubleshooting

Video walkthrough

Gravity Forms Chargebee Add-On Setup Guide: Customers & Subscriptions (WordPress Side)
Video setup guide: Gravity Forms Chargebee Watch on YouTube

The Gravity Forms Chargebee Premium Add-on connects your Gravity Forms to Chargebee so that every submission becomes a Chargebee customer, and, when you want it, a running subscription. When someone fills in a plan sign-up, a sales enquiry, an upgrade request or an event registration, the add-on finds that person in Chargebee by email, or creates them, and can then start a subscription for them: a plan item price, a quantity and any add-ons, all mapped from your form.

Everything happens on your own Chargebee site through the Chargebee REST API, with your own API key. The add-on never blocks your form: the visitor sees your normal confirmation, and the customer and subscription are created quietly on your server afterwards. A failed call is written to the entry as a clear note rather than shown to the person filling in the form.

What you need

  • WordPress with Gravity Forms 2.9 or newer.
  • PHP 7.4 or newer.
  • An active license key for this add-on.
  • A Chargebee account, and the item prices you want to subscribe people to already set up in your Product Catalog.

If Gravity Forms is missing or older than 2.9, the add-on shows a notice in the WordPress admin and does nothing else, so a form is never left half connected.

Get your Chargebee site and API key

The add-on signs in to the Chargebee API with your own credentials, using HTTP Basic authentication: your API key is the user name and the password is empty. You create the key yourself, and it is entirely self-serve.

Sign in to Chargebee, open Settings, then Configure Chargebee, then API Keys, and create a full-access key. Copy it and keep it somewhere safe. You also need your site name, which is the part before .chargebee.com in your Chargebee address: for acme.chargebee.com the site is acme. There is nothing to approve with us and no partner onboarding; the key belongs to your Chargebee account.

The settings page

Install and activate the add-on like any plugin, after Gravity Forms. Then open Forms → Settings → Chargebee. This one page holds the license key and your Chargebee connection.

The Chargebee settings page in Gravity Forms: license key, Chargebee site, API key and a test connection button that lists item prices
The settings page: your Chargebee site, your API key and a test button.

Your site, your key and the test button

Enter your Chargebee site (just the subdomain, or a full URL, either is accepted) and the API key you generated. The key is stored encrypted at rest, so the plain value is never left sitting in the database. After the field is saved it is shown masked, and you can replace it at any time. If you would rather keep the key out of the database entirely, define the GFCB_API_KEY constant in wp-config.php and the add-on uses that instead.

Next to the key is a Test connection button. Press it and the add-on asks Chargebee for your item prices and lists a few of them. A green result means the site and key talk to Chargebee; a clear message tells you if the key is wrong. Run the test once whenever you paste a new key, so you learn about a typo here and not from a form that quietly fails.

Add a feed to your form

Open the form you want to connect, go to Settings → Chargebee on that form, and add a feed. A feed maps the form fields to the Chargebee customer and, optionally, to a subscription.

The Chargebee feed in Gravity Forms: customer email, name, company and phone, and an optional subscription with plan item price, quantity and add-ons
The feed: map the customer and, if you want, the subscription with merge tags.

The customer

The customer email is the one required field, because it is how a customer is found. Map it to your email field with a merge tag, for example {Email:2}. The add-on looks for a Chargebee customer with exactly this email; if there is one, it is used, and if there is none, a new customer is created. The first name, last name, company and phone are optional and are mapped the same way.

The Update existing option decides what happens when a matching customer is already in Chargebee. Leave it on and the matched customer is updated with the mapped fields; turn it off and an existing customer is left exactly as it is, while new customers are still created.

The subscription

The subscription section is optional. Leave it off and the feed syncs the customer only. Turn on Start a subscription for this customer and give a plan item price: the id of a plan item price from your Chargebee Product Catalog, for example basic-USD-Monthly. It can be a fixed id or a merge tag, so a form choice can pick the plan; use the :value modifier, for example {Plan:5:value}.

The quantity sets how many of the plan item price to subscribe (it defaults to 1, and a merge tag such as a seats field works too). Add-on item prices let you attach extra charges: list their ids one per line or comma separated, each as id or id:quantity, for example extra-seats-USD-Monthly:3. The subscription is created with Chargebee’s subscription-for-items API, so plans and add-ons are all item prices.

Only send when you want to

Each feed has conditional logic, so you can send to Chargebee only when a rule is met, for example only when a plan is chosen, or only for a particular enquiry type. You can also add more than one feed to the same form to route different submissions to different plans.

On the front end

Your visitors see nothing new. They fill in your form and get your normal confirmation; the work with Chargebee happens quietly on your server afterwards.

A front-end Gravity Form with a plan choice and seats, used to create a Chargebee customer and start a subscription
A plan sign-up form as a visitor sees it; the work with Chargebee happens after the confirmation.

What is saved on the entry

After a submission is processed, the Gravity Forms entry keeps the Chargebee customer link and, when a subscription was started, the Chargebee subscription link, so you can open either straight from the entry. A success note records exactly what was done, and the ids are available as merge tags — {chargebee_customer_id}, {chargebee_customer_url}, {chargebee_subscription_id} and {chargebee_subscription_url} — for your notifications.

A Gravity Forms entry screen showing the Chargebee note with the customer link and the subscription link
The entry note with the customer and subscription links.

Notifications and events

The add-on adds two notification events, Chargebee customer synced and Chargebee sync failed, so you can email your team when a customer and subscription are created, or when something needs a look. The Chargebee merge tags work in those notifications, so a message can link straight to the new customer or subscription.

Retries never double-create

If you resend a feed, or Gravity Forms retries one, the add-on will not create a second customer or a second subscription. The customer is matched by exact email, and the subscription is created with a deterministic id tied to the entry and feed. If an earlier try created the subscription but the reply was lost, the add-on finds it again by that id instead of making a new one, and a feed that is already running for an entry is never sent twice.

Security and privacy

The API key is encrypted at rest with AES-256-GCM and is never shown again, never written to an entry note and never put in a log. Every request uses HTTPS with certificate verification on, a redirect is never followed so the credentials cannot leak to another host, and the add-on only ever contacts your own <site>.chargebee.com. The connection test and the feed both run under a capability and nonce check, so only your own staff can trigger them.

Troubleshooting

If a submission does not reach Chargebee, open the entry and read the note: it says exactly which step stopped and why, without ever printing your key. A wrong key or site shows up straight away in the Test connection result. An invalid email in the form means no request is made and the entry says so. If an item price id is wrong, Chargebee’s own message is passed back in the note so you can fix the id in the feed. Because a failed call never blocks the form, your visitor always gets your confirmation, and you keep a clear record of anything to retry.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr