1. Customers
Documentation
  • Back to home
  • StripeKit
  • Installation
  • Getting Started
  • Choosing a Mode
  • Type Reference
  • Setup
    • Configuration
    • Timezones
    • Storage Adapter
    • Money and Currency
    • Error Handling
  • Stripe
    • Elements
  • Modules
    • Overview
    • Customers
      • Overview
      • List
      • Retrieve
      • Find or Create by Email
      • Create
      • Update
      • Sync
      • Delete
    • Payment Methods
      • Overview
      • Create Setup Intent
      • List
      • Attach
      • Detach
      • Set Default
      • Sync
    • Payments
      • Overview
      • Pay With Saved Method
      • Create
      • Retrieve
      • Confirm
      • Cancel
      • Sync
    • Checkout
      • Overview
      • Get
      • Create
      • Submit Fields
      • Apply Coupon
      • Mark Complete
    • Subscriptions
      • Overview
      • Create
      • Retrieve
      • Cancel
      • Resume
      • Toggle Collection Method
      • Update Fields
      • Apply Promotion Code
      • List By Customer
      • Find By Metadata
      • Sync
    • Invoices
      • Overview
      • Retrieve
      • List By Customer
      • List By Subscription
      • Pay With Saved Method
      • Void
      • Finalize
      • Sync
    • Coupons
      • Overview
      • Create
      • Validate
      • Apply To Subscription
      • List
      • Deactivate
    • Webhooks
      • Overview
      • Process
      • Events Reference
    • Sync
      • Overview
  1. Customers

Overview

$kit->customers creates, retrieves, updates, deletes and lists Stripe customers, and normalizes every result into a flat, predictable record.

Methods#

MethodDescription
create()Create a new Stripe customer.
findOrCreateByEmail()Look up a customer by email, falling back to creating one.
retrieve()Fetch a single customer by ID.
update()Update an existing customer's details.
delete()Permanently delete a customer in Stripe.
list()List customers, optionally filtered by email.
sync()Re-pull a customer from Stripe and persist it via your storage adapter.

The KitCustomerRecord shape#

Every method above except delete() and list()'s raw items (which use the same shape per item) returns this record:
array{
    id: string,
    userId: string|int|null,
    email: string|null,
    name: string|null,
    phone: string|null,
    description: string|null,
    address: array{line1: string|null, line2: string|null, city: string|null, state: string|null, postalCode: string|null, country: string|null}|null,
    defaultPaymentMethodId: string|null,
    metadata: array<string, string>,
    createdAtUtc: string|null,
    deleted: bool,
}
userId is whatever you pass in as userId on create, or null if you didn't provide one and no storage adapter resolved it. It is your own internal identifier, StripeKit never invents one.
Previous
Overview
Next
List
Built with