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

Sync

kit.customers.sync()#

Re-fetches a customer from Stripe and persists the fresh record via your storage adapter's saveCustomer(). Functionally identical to retrieve(), except the result is always written to storage, even if you don't do anything else with the return value.

Signature#

Example request#

Example response#

Same shape as retrieve().

When to use this#

After a support agent manually edits a customer in the Stripe Dashboard, to pull that change back into your own database.
As part of a scheduled reconciliation job.
Inside a webhook handler, to make sure your database reflects the very latest state rather than only the fields present on the webhook event payload. See kit.sync.everythingForCustomer() for pulling a customer plus all of their related objects in one call.

Notes#

Without a storage adapter configured, sync() still works and still returns the fresh record, it just has nothing to persist to.
Previous
Update
Next
Delete
Built with