Skip to content

Stripe.Customer reference

Source: packages/stripe/src/CreateCustomer.ts

Create a Stripe Customer over HTTP. Account-scoped — binds the API key onto the host, not a specific customer resource.

CreateCustomer: Creating a Customer at runtime

Section titled “CreateCustomer: Creating a Customer at runtime”
const create = yield* Stripe.CreateCustomer();
const customer = yield* create({
email: "alice@example.com",
name: "Alice",
});

Source: packages/stripe/src/CreateCustomerHttp.ts Kind: Layer · Provides: Stripe.CreateCustomer

HTTP implementation of CreateCustomer. Provide it on the Function or Worker Effect.

Source: packages/stripe/src/Customer.ts

A Stripe Customer — the billing identity invoices, subscriptions, and Checkout sessions attach to. Every field except testClock updates in place; a field left out is cleared, except invoicePrefix, nextInvoiceSequence, and the default payment method, which Stripe manages. Deleting a customer is permanent and immediately cancels any active subscriptions.

Email and name

const customer = yield* Stripe.Customer("alice", {
email: "alice@example.com",
name: "Alice Example",
});

Description, phone, and metadata

const customer = yield* Stripe.Customer("alice", {
email: "alice@example.com",
name: "Alice Example",
description: "Beta tester",
phone: "+15555550100",
metadata: { plan: "pro" },
});

Business customer with invoice defaults

const customer = yield* Stripe.Customer("acme", {
email: "billing@acme.example",
businessName: "Acme Inc",
address: {
line1: "123 Main Street",
city: "San Francisco",
state: "CA",
postalCode: "94111",
country: "US",
},
preferredLocales: ["en"],
taxExempt: "reverse",
invoicePrefix: "ACME",
invoiceSettings: {
footer: "Net 30",
customFields: [{ name: "PO", value: "1234" }],
},
});

Customer on a test clock

const customer = yield* Stripe.Customer("trial-user", {
email: "trial@example.com",
testClock: "clock_1A2b3C4d5E6f7G8h",
});
const customer = yield* Stripe.Customer("alice", {
email: "alice+updated@example.com",
name: "Alice Example",
metadata: { plan: "enterprise" },
});

Customer.lookup references a customer Alchemy doesn’t manage (created in the Stripe Dashboard or by another stack). It is read during plan/deploy, never created, updated or deleted.

const ref = Stripe.Customer.lookup({ id: "cus_A2b3C4d5E6f7G8" });

Source: packages/stripe/src/CustomerTaxId.ts

A Stripe Customer Tax ID — a tax identifier (VAT, EIN, GST, …) attached to a Customer and printed on invoices. Existence-only: type and value cannot be updated in place; changing customer, type, or value replaces the tax ID. Destroy deletes it.

Customer tax IDs have no metadata of their own. Ownership for account-wide list() (nuke) is inferred from the parent Customer’s Alchemy metadata.

const customer = yield* Stripe.Customer("alice", {
email: "alice@example.com",
});
const vat = yield* Stripe.CustomerTaxId("alice-vat", {
customer: customer.id,
type: "eu_vat",
value: "DE123456789",
});
const vat = yield* Stripe.CustomerTaxId("alice-vat", {
customer: customer.id,
type: "eu_vat",
value: "DE000000000",
});

Source: packages/stripe/src/RetrieveCustomer.ts

Retrieve a bound Stripe Customer over HTTP.

const retrieve = yield* Stripe.RetrieveCustomer(alice);
const live = yield* retrieve();

Source: packages/stripe/src/RetrieveCustomerHttp.ts Kind: Layer · Provides: Stripe.RetrieveCustomer

HTTP implementation of RetrieveCustomer. Provide it on the Function or Worker Effect.

Source: packages/stripe/src/RetrieveCustomerTaxId.ts

Retrieve a bound Stripe Customer Tax ID over HTTP.

RetrieveCustomerTaxId: Reading a Customer Tax ID

Section titled “RetrieveCustomerTaxId: Reading a Customer Tax ID”
const retrieve = yield* Stripe.RetrieveCustomerTaxId(vat);
const live = yield* retrieve();

Source: packages/stripe/src/RetrieveCustomerTaxIdHttp.ts Kind: Layer · Provides: Stripe.RetrieveCustomerTaxId

HTTP implementation of RetrieveCustomerTaxId. The nested retrieve takes both customer and id.

Source: packages/stripe/src/UpdateCustomer.ts

Update a bound Stripe Customer over HTTP.

const update = yield* Stripe.UpdateCustomer(alice);
const live = yield* update({ name: "Alice Example" });

Source: packages/stripe/src/UpdateCustomerHttp.ts Kind: Layer · Provides: Stripe.UpdateCustomer

HTTP implementation of UpdateCustomer. Provide it on the Function or Worker Effect.