Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer already exists for the merchant while creating customer - how can i get the customer id #354

Open
happy-44 opened this issue Jul 12, 2023 · 2 comments
Labels

Comments

@happy-44
Copy link

Steps to reproduce the behavior

I am trying to create a customer by passing name and email i get error customer already exist. ( how can i get this customer ID ) i need to create virtual account for this customer.

Note: I know the customer exist , i dont have the customer id which was generated when 1st time customer was created.

Now i am not able to get customer id and not even able to create new customer with same name and email.

Expected behavior

the error should either return the customer ID which exist or allow to find customer based on email id.

Actual behavior

just returns error - customer exist

aaa

Code snippets

No response

Php version

php 7.4

Library version

RAZORPAY SDK

Additional Information

no addional info

@dipesh008
Copy link

$createcustomerresponse = $api->customer->create(array('name' => $user->fname, 'email' => $user->email ));

Above line gives Customer already exists for the merchant. How can we get Customer Id of this customer

@ankitdas13
Copy link
Contributor

ankitdas13 commented Jul 27, 2023

@dipesh008 Pass fail_existing with value "0" as string while creating customer. It will return the existing customer details.

Please check this doc for your reference https://razorpay.com/docs/api/customers/#create-a-customer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants