Stripe.Customer reference
CreateCustomer
Section titled “CreateCustomer”Source:
src/Stripe/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:
src/Stripe/CreateCustomerHttp.tsKind: Layer · Provides:Stripe.CreateCustomer
HTTP implementation of CreateCustomer. Provide it on the
Function or Worker Effect.
Customer
Section titled “Customer”Source:
src/Stripe/Customer.ts
A Stripe Customer — the billing identity invoices, subscriptions, and Checkout sessions attach to. Email, name, description, phone, and metadata are updated in place. 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: 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" },});CustomerTaxId
Section titled “CustomerTaxId”Source:
src/Stripe/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:
src/Stripe/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:
src/Stripe/RetrieveCustomerHttp.tsKind: Layer · Provides:Stripe.RetrieveCustomer
HTTP implementation of RetrieveCustomer. Provide it on the
Function or Worker Effect.
RetrieveCustomerTaxId
Section titled “RetrieveCustomerTaxId”Source:
src/Stripe/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:
src/Stripe/RetrieveCustomerTaxIdHttp.tsKind: Layer · Provides:Stripe.RetrieveCustomerTaxId
HTTP implementation of RetrieveCustomerTaxId. The nested
retrieve takes both customer and id.
UpdateCustomer
Section titled “UpdateCustomer”Source:
src/Stripe/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:
src/Stripe/UpdateCustomerHttp.tsKind: Layer · Provides:Stripe.UpdateCustomer
HTTP implementation of UpdateCustomer. Provide it on the
Function or Worker Effect.