Skip to main content
A customer is whoever pays in your app: a user, or an organization for team billing. Its customerId is your own ID for them, so you never store a Ledger ID. Create the customer when they sign up, and attach their first plan:
  • It’s safe to repeat. createOrGetCustomer returns the existing customer if there is one, so you can also call it lazily, before a customer’s first check.
  • Creating grants nothing. Credits come from attaching a plan or buying a pack.
  • IDs are 1 to 255 characters, and belong to one environment: the same customerId in Sandbox and Live is two separate customers. A Sandbox key asking for a Live customer gets 404 customer_not_found.
  • Ledger creates the Stripe customer when it first needs one. To reuse one you already have, for example when migrating from Stripe, link it first.

Read a customer

getCustomer returns the balance and current plan. Balances explains the fields.

Delete a customer

DELETE /v1/customers removes a customer; the SDKs don’t have it yet. In Sandbox it removes their usage events too, so you can start over cleanly. In Live the usage events stay as the record of what the customer used.