What is a Customer?
A Customer in Flowglad tracks the identity and billing relationship with someone who uses your product. Each customer has:- Identifiers: A Flowglad-generated
idand your ownexternalIdfor linking to your system - Contact info: Name and email address
- Billing data: Associated subscriptions, invoices, and payment methods
- State: Active or archived status
Customer Identifiers
Customers have two key identifiers:| Identifier | Description | Example |
|---|---|---|
id | Flowglad-generated UUID | a1b2c3d4-e5f6-7890-abcd-ef1234567890 |
externalId | Your system’s identifier | user_123, org_456 |
externalId is how you’ll typically reference customers in your code. It must be unique among active customers, but can be reused after archiving a customer.
Creating Customers
Customers are typically created automatically—you don’t need to explicitly create them in most cases.Automatic Creation (Recommended)
When you useFlowgladServer with a scoped customerExternalId, customers are automatically created when needed. The getCustomerDetails callback provides the customer’s name and email:
Via Dashboard
For manual customer creation:- Navigate to the Customers page
- Click “Create Customer”
- Fill in the customer details
- Click “Create”
Updating Customers
Update customer details like name and email usingupdateCustomer. This method updates the customer associated with the scoped customerExternalId:
getBilling() or other customer methods.
Archiving Customers
Archiving removes a customer from active use while preserving their historical data. This is the recommended way to handle customer churn, duplicates, or test data cleanup.Why Archive?
- Customer churned: When a customer cancels and you want to clean up
- Duplicate cleanup: Consolidate multiple customer records
- Test data: Remove test customers from your active data
- Free up externalId: Reuse the
externalIdfor a new customer
What Happens When You Archive
When you archive a customer:- Active subscriptions are canceled - Subscriptions with
activestatus are immediately canceled - The customer is marked as archived - The
archivedfield is set totrue - The externalId becomes available - You can create a new customer with the same
externalId - API returns 404 - The
GET /customers/:externalIdendpoint returns 404 for archived customers
How to Archive
Via Dashboard
- Navigate to the Customers page
- Find the customer you want to archive
- Click the actions menu (⋮) on the customer row
- Select “Archive Customer”
- Review the confirmation modal (shows subscription cancellation warning)
- Click “Archive” to confirm
Via API
Via SDK
Unlike
updateCustomer which operates on the scoped customer, archiveCustomer requires an explicit externalId parameter. This archives the customer with externalId of 'user_123', not necessarily the scoped customer.The archive operation is idempotent. Calling it multiple times on the same customer has no additional effect.
Viewing Archived Customers
Archived customers are intentionally not accessible via the API. This provides clean data isolation and matches the behavior of other billing platforms like Stripe. To view archived customers:- Navigate to the Customers page
- Click the “Archived” tab
- Browse or search archived customer records
The dashboard’s “Archived” tab is the only way to access archived customer data. This is by design to keep your active customer data clean.
Restore
Restore functionality is not currently supported. Once a customer is archived, they cannot be unarchived. If you need to work with a previously archived customer, create a new customer record.Best Practices
Use externalId Consistently
Always provide anexternalId that maps to your user or organization ID. This makes it easy to look up customers and keeps your data synchronized.
Archive Instead of Ignoring
When customers churn, archive them rather than leaving them in an ambiguous state. This:- Cancels subscriptions cleanly
- Frees up the
externalIdfor reuse - Keeps your active customer list accurate
Review Before Archiving
Always check the subscription count before archiving a customer, especially for customers with multiple subscriptions. The dashboard modal shows this count, but if archiving via API, query the customer’s subscriptions first.Related
- Subscriptions - Customers are linked to subscriptions
- Checkout Sessions - Create customers during checkout
- Invoices - Customer billing history