Skip to content
GitHubXDiscordRSS

Customer

Learn how to create and manage Stripe Customers for billing relationships using Alchemy.

The Customer resource lets you create and manage Stripe Customers for tracking billing relationships and payment information.

Create a basic customer:

import { Customer } from "alchemy/stripe";
const basicCustomer = await Customer("basic-customer", {
email: "john@example.com",
name: "John Doe",
description: "Premium customer"
});

Create a customer with full address and shipping information:

import { Customer } from "alchemy/stripe";
const customerWithAddress = await Customer("customer-with-address", {
email: "jane@example.com",
name: "Jane Smith",
phone: "+1-555-123-4567",
address: {
line1: "123 Main St",
line2: "Apt 4B",
city: "San Francisco",
state: "CA",
postalCode: "94105",
country: "US"
},
shipping: {
name: "Jane Smith",
address: {
line1: "456 Oak Ave",
city: "Oakland",
state: "CA",
postalCode: "94612",
country: "US"
}
}
});

Create a business customer with tax exemption:

import { Customer } from "alchemy/stripe";
const businessCustomer = await Customer("business-customer", {
email: "billing@acmecorp.com",
name: "Acme Corporation",
description: "Enterprise customer",
taxExempt: "exempt",
invoicePrefix: "ACME",
preferredLocales: ["en"],
metadata: {
type: "business",
industry: "technology",
employees: "500+"
}
});