payloadcms / payloadcms/payload

[plugin-stripe] Customer is created in Stripe even if User record creation fails in Payload

Open
#12,857 2 comments 0 reactions 1 assignee View on GitHub

@paulpopus is already working on this.

Since Feb 6, 2026.

Bug
Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Describe the Bug

When data sync between Stripe and Payload is enabled and a user record is created with an email address that's already in use, Payload throws an error, but the customer record in Stripe is created anyways. This causes orphan records in Stripe to build up.

Link to the code that reproduces this issue

https://github.com/cameronrdecker/payload-stripe-bug

Reproduction Steps
  1. create a .env file at the root of the monorepo using the .env.example file as an example, providing a database URI and Stripe secret key. I used postgres because that's what I have access to for testing.
  2. Run the test app with pnpm dev _community
  3. onInit will attempt to create two users. The first API call should create a user in Payload successfully, and the second call should fail to create a user in Payload and throw an error. Then check in Stripe to see that both customer records were created.
Which area(s) are affected? (Select all that apply)

plugin: stripe

Environment Info
payload: "3.43.0"
next: "15.3.2"
node: 22.9.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.