Stripe.Customer reference
CreateCustomer
Section titled “CreateCustomer”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",});CreateCustomerHttp
Section titled “CreateCustomerHttp”Source:
packages/stripe/src/CreateCustomerHttp.tsKind: Layer · Provides:Stripe.CreateCustomer
HTTP implementation of CreateCustomer. Provide it on the
Function or Worker Effect.
Customer
Section titled “Customer”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.
Customer: Creating a Customer
Section titled “Customer: Creating a Customer”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" },});Customer: Billing details and invoices
Section titled “Customer: Billing details and invoices”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",});Customer: Updating a Customer
Section titled “Customer: Updating a Customer”const customer = yield* Stripe.Customer("alice", { email: "alice+updated@example.com", name: "Alice Example", metadata: { plan: "enterprise" },});Customer: Looking up an existing customer
Section titled “Customer: Looking up an existing customer”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" });CustomerTaxId
Section titled “CustomerTaxId”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.
CustomerTaxId: Creating a Customer Tax ID
Section titled “CustomerTaxId: Creating a Customer Tax ID”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",});CustomerTaxId: Replacing a Tax ID
Section titled “CustomerTaxId: Replacing a Tax ID”const vat = yield* Stripe.CustomerTaxId("alice-vat", { customer: customer.id, type: "eu_vat", value: "DE000000000",});RetrieveCustomer
Section titled “RetrieveCustomer”Source:
packages/stripe/src/RetrieveCustomer.ts
Retrieve a bound Stripe Customer over HTTP.
RetrieveCustomer: Reading a Customer
Section titled “RetrieveCustomer: Reading a Customer”const retrieve = yield* Stripe.RetrieveCustomer(alice);const live = yield* retrieve();RetrieveCustomerHttp
Section titled “RetrieveCustomerHttp”Source:
packages/stripe/src/RetrieveCustomerHttp.tsKind: Layer · Provides:Stripe.RetrieveCustomer
HTTP implementation of RetrieveCustomer. Provide it on the
Function or Worker Effect.
RetrieveCustomerTaxId
Section titled “RetrieveCustomerTaxId”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();RetrieveCustomerTaxIdHttp
Section titled “RetrieveCustomerTaxIdHttp”Source:
packages/stripe/src/RetrieveCustomerTaxIdHttp.tsKind: Layer · Provides:Stripe.RetrieveCustomerTaxId
HTTP implementation of RetrieveCustomerTaxId. The nested
retrieve takes both customer and id.
UpdateCustomer
Section titled “UpdateCustomer”Source:
packages/stripe/src/UpdateCustomer.ts
Update a bound Stripe Customer over HTTP.
UpdateCustomer: Updating a Customer
Section titled “UpdateCustomer: Updating a Customer”const update = yield* Stripe.UpdateCustomer(alice);const live = yield* update({ name: "Alice Example" });UpdateCustomerHttp
Section titled “UpdateCustomerHttp”Source:
packages/stripe/src/UpdateCustomerHttp.tsKind: Layer · Provides:Stripe.UpdateCustomer
HTTP implementation of UpdateCustomer. Provide it on the
Function or Worker Effect.