Skip to main content

Stripe

Manage Stripe customers, products, prices, subscriptions, and more.

Resources

Customer

Create and manage Stripe customers.
import { Customer } from "alchemy/stripe";

const customer = await Customer("basic-customer", {
  email: "[email protected]",
  name: "John Doe",
  description: "Premium customer",
  metadata: {
    tier: "premium",
    source: "website"
  }
});

Props

email
string
Customer’s email address
name
string
The customer’s full name or business name
description
string
An arbitrary string attached to the object
phone
string
The customer’s phone number
address
object
The customer’s address
shipping
object
The customer’s shipping information
metadata
Record<string, string>
Set of key-value pairs that you can attach to an object
balance
number
An integer amount in cents that represents the customer’s current balance
invoicePrefix
string
The prefix for the customer used to generate unique invoice numbers
preferredLocales
string[]
Customer’s preferred languages, ordered by preference
taxExempt
'exempt' | 'none' | 'reverse'
The customer’s tax exemption status
invoiceSettings
object
Default invoice settings for this customer
paymentMethod
string
The ID of the PaymentMethod to attach to the customer
apiKey
Secret
API key to use (overrides environment variable)
adopt
boolean
If true, adopt existing resource if creation fails due to conflict

Returns

id
string
The ID of the customer
object
'customer'
String representing the object’s type
email
string
Customer’s email address
name
string
The customer’s full name or business name
created
number
Time at which the object was created
livemode
boolean
Has the value true if the object exists in live mode or the value false if the object exists in test mode
currency
string
Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes
defaultSource
string
ID of the default payment source for the customer
delinquent
boolean
Whether or not the customer is currently delinquent
address
object
The customer’s address
shipping
object
The customer’s shipping information
metadata
object
Set of key-value pairs attached to the object

Build docs developers (and LLMs) love