Skip to main content
A Customer object represents a business or individual that purchases your products or services. It allows you to track subscriptions, payments, invoices, and usage for a specific entity.

Creating a Customer

You should create a Customer in Credibill when a user signs up for your application.
curl https://api.credibill.tech/v1/customers \
  -u sk_test_...: \
  -d email="[email protected]" \
  -d name="Acme Corp"

Payment Methods

Customers can have multiple payment methods attached (Credit Cards, Bank Accounts, etc.). One payment method is designated as the default for automatic subscription renewals.

Attaching a Payment Method

Using the client-side SDK (e.g., Credibill.js), you can collect card details securely and attach them to a customer.
// Client-side code
const { paymentMethod } = await credibill.createPaymentMethod(cardElement);

// Send paymentMethod.id to your backend to attach to customer

Customer Portal

Credibill provides a hosted Customer Portal where your customers can:
  • Update payment methods
  • View invoice history
  • Upgrade or downgrade plans
  • Cancel subscriptions
You can generate a link to the portal via the API:
const session = await credibill.portal.sessions.create({
  customer: 'cus_123...',
  return_url: 'https://myapp.com/account'
});

redirect(session.url);