Customers
Create and manage customer profiles, payment methods, and communication preferences
Customers are the foundation of billing operations in RevKeen. Every subscription, invoice, and payment is associated with a customer. Each customer can have multiple payment methods, addresses, subscriptions, and orders associated with them.
What is a Customer?
A Customer record stores:
- Contact information -- Name, email, phone
- Payment methods -- Cards, bank accounts for future charges
- Addresses -- Billing and shipping addresses
- Billing history -- All invoices, orders, and subscriptions
- Custom fields -- Additional data you define
Customer Fields
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Primary email address |
name | string | No | Full name or business name |
companyName | string | No | Business or company name |
phone | string | No | Phone number (E.164 format recommended) |
currency | string | No | Preferred currency for invoices |
tax_id | string | No | Tax identification number (VAT, EIN, etc.) |
address | object | No | Billing address |
metadata | object | No | Custom key-value pairs |
Creating Customers
Automatic Creation
Customers are automatically created when:
- A new email completes checkout
- You create an invoice for a new email
- Imported from integrations (PracticeHub, Wodify, etc.)
Via Dashboard
- Navigate to Customer
- Click + New Customer
- Enter email and other details
- Save the customer
Via API
const customer = await client.customers.create({
email: 'john@example.com',
name: 'John Smith',
phone: '+1-555-123-4567',
currency: 'USD',
// Optional: Billing address
address: {
line1: '123 Main St',
line2: 'Suite 100',
city: 'San Francisco',
state: 'CA',
postalCode: '94102',
country: 'US',
},
// Optional: Tax ID for business customers
taxId: 'US123456789',
// Optional: Custom metadata
metadata: {
salesRep: 'jane@company.com',
tier: 'enterprise',
},
});
console.log(customer.data.id); // cus_xxxxxxxxcustomer = client.customers.create(
email="john@example.com",
name="John Smith",
phone="+1-555-123-4567",
currency="USD",
# Optional: Billing address
address={
"line1": "123 Main St",
"line2": "Suite 100",
"city": "San Francisco",
"state": "CA",
"postal_code": "94102",
"country": "US"
},
# Optional: Tax ID for business customers
tax_id="US123456789",
# Optional: Custom metadata
metadata={
"sales_rep": "jane@company.com",
"tier": "enterprise"
}
)
print(customer.data.id) # cus_xxxxxxxxListing Customers
// List all customers with pagination
const customers = await client.customers.list({
limit: 20,
page: 1,
});
// Search by email
const customers = await client.customers.list({
email: 'john@example.com',
});
// Auto-pagination
for await (const customer of client.customers.list()) {
console.log(customer.email);
}Updating Customers
const customer = await client.customers.update('cus_xxxxxxxx', {
name: 'John Smith',
metadata: {
plan: 'pro',
upgraded_at: new Date().toISOString(),
},
});Deleting Customers
// Soft delete - marks customer as deleted but retains data
await client.customers.delete('cus_xxxxxxxx');Deleting a customer cancels all active subscriptions and prevents new charges. Historical data is retained for compliance.
Business Customers (B2B)
For B2B billing, you can associate customers with a business entity:
- Business name -- Legal entity name
- Tax ID -- VAT number, EIN, etc.
- Business address -- Separate from individual address
Enable business checkout in your checkout link settings to collect business information during purchase.
Payment Methods
Customers can have multiple saved payment methods:
| Type | Description | Supported |
|---|---|---|
| Card | Credit/debit cards (Visa, Mastercard, Amex, etc.) | Yes |
| ACH | US bank accounts (ACH Direct Debit) | Yes |
| SEPA | European bank accounts | Coming soon |
Payment methods are securely tokenized by your payment gateway. RevKeen never stores raw card numbers.
Default Payment Method
One payment method can be marked as default. This is automatically used for:
- Subscription renewals
- Auto-pay invoices
- Retry attempts during dunning
Saved Card Security at Checkout
When a customer returns to checkout and has saved cards, they must verify their identity before accessing them. This is done via a 6-digit email verification code (or automatically if they have a trusted device cookie from a previous verification). Additionally, customers must re-enter their card's CVV for every saved card payment. See the Checkout page for details.
Addresses
Customers can have multiple addresses with different types:
| Address Type | Used For |
|---|---|
| Billing | Invoice "Bill To" address, tax calculations |
| Shipping | Physical product delivery |
Custom Fields
Extend customer data with custom fields defined in Settings > Custom Fields:
- Text fields (IDs, notes)
- Numbers (account numbers, scores)
- Dates (birthdays, contract dates)
- Dropdowns (status, category)
- Checkboxes (preferences, consent)
Customer Portal
Customers can self-manage their account through the Customer Portal:
- View and pay invoices
- Download invoice PDFs
- Update payment methods
- Manage subscriptions (pause, cancel)
- View billing history
The Customer Portal is available at checkout.revkeen.com/portal/[your-slug].
You can also create a portal session programmatically to let customers manage their own billing:
const portal = await client.billingPortal.sessions.create({
customerId: 'cus_xxxxxxxx',
returnUrl: 'https://yourapp.com/account',
});
// Redirect customer to portal
return redirect(portal.data.url);Customer Events
| Event | When Triggered |
|---|---|
customer.created | Customer record is created |
customer.updated | Customer details are modified |
customer.payment_method.attached | Payment method is added |
customer.payment_method.detached | Payment method is removed |
Related
- Subscriptions -- Create subscriptions for customers
- Invoices and Orders -- Send invoices to customers
- Customer Portal -- Self-service portal for customers