RevKeen Docs
Using RevKeen

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

FieldTypeRequiredDescription
emailstringYesPrimary email address
namestringNoFull name or business name
companyNamestringNoBusiness or company name
phonestringNoPhone number (E.164 format recommended)
currencystringNoPreferred currency for invoices
tax_idstringNoTax identification number (VAT, EIN, etc.)
addressobjectNoBilling address
metadataobjectNoCustom 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

  1. Navigate to Customer
  2. Click + New Customer
  3. Enter email and other details
  4. 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_xxxxxxxx
customer = 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_xxxxxxxx

Listing 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:

TypeDescriptionSupported
CardCredit/debit cards (Visa, Mastercard, Amex, etc.)Yes
ACHUS bank accounts (ACH Direct Debit)Yes
SEPAEuropean bank accountsComing 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 TypeUsed For
BillingInvoice "Bill To" address, tax calculations
ShippingPhysical 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

EventWhen Triggered
customer.createdCustomer record is created
customer.updatedCustomer details are modified
customer.payment_method.attachedPayment method is added
customer.payment_method.detachedPayment method is removed

On this page