Guides / Test data

How to create Chargebee test data

Last updated

Good tests need realistic customers and subscriptions. Here's how to create them, and how to make sure you can create the same set again next week.

What good test data looks like

Aim for a small set that covers your real cases, not hundreds of random records. For example:

The most important rule: keep the data in one place you can re-run. If test data only exists on the site, it's gone after the next cleanup.

The manual options

1. By hand in the Chargebee UI

Fine for two or three customers. Slow, and hard to repeat exactly.

2. Chargebee's bulk import

Chargebee lets you import customers and subscriptions from CSV files. It's faster than clicking, but the column format has to be exactly right, and finding out what failed takes time.

3. A script against the API

Create a customer with POST /api/v2/customers, then a subscription for that customer with the item prices you want. Scripts are repeatable, but someone has to write them, update them when the catalog changes and run them.

Tip: whichever way you choose, use clear IDs like test-eur-yearly-addons. You'll find records faster, and it's obvious they're test data.

The simple way with Testabee

Combine it with a site reset and every test run starts from the same data.

Fill your test site in one go

Free for one test site. No credit card needed.

Start free

More guides