payloadcms / payloadcms/payload
[plugin-stripe] Customer is created in Stripe even if User record creation fails in Payload
Open
@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
- create a .env file at the root of the monorepo using the
.env.examplefile as an example, providing a database URI and Stripe secret key. I used postgres because that's what I have access to for testing. - Run the test app with
pnpm dev _community - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.