#vlajke-duplicate-customers
1 messages ยท Page 1 of 1 (latest)
Yup, you can just share the IDs here
Sure thing and thanks for helping me out!
cus_Kx8FTey2tcMfOg
cus_KwT1DoYAiahjFF
So those two customers were created more than 24 hours apart from each other - do you have any logic on your end to check if you have an existing customer with that specific email before creating a new one? Idempotency is more useful when you want to retry requests that you aren't sure were successful the first time around.
Yes, we are in fact checking if the email exists or no on our system. In fact, they have to be logged in upon profile creation to create the subscription
However, that's rarely happening (even though we are not sure why), what is happening more often is canceled transactions
This is the same customer
everything happened within 3 minutes
Something about your logic is not correctly picking up on the fact that you already have an existing customer with that email address so that would be something you'd have to look into more closely on your end.
For the canceled transactions, can you send me one of those Payment Intent IDs so I can take a look?
So looking at that specific Payment Intent it looks like you were attempting to create a Subscription but it failed (since the customer had no payment method at the time) so we immediately cancelled the payment intent.
Which is really weird, do you happen to see what request we sent through API? It's exactly the same for everyone
That particular PI was created as part of https://dashboard.stripe.com/logs/req_EU0PucjqiWIkLu
If we send multiple API requests in a single query, will that confuse the system? For example, if we are creating an account and its subscription in a single query, will that be a problem?
What do you mean by a single query?
Like if we send 3 different posts to the api at the same time
Gotcha! so if those 3 requests were all touching the same objects then yes, you could run into issues and see 429 errors (which you could read about at https://stripe.com/docs/rate-limits#object-lock-timeouts)
I don't think that's necessarily the issue here though - from what I can see, the issue here is just that this customer has not default source or payment method on it at all
I just think we are not sending the right customer information to stripe and therefore the method is missing
There's no way we wouldn't send (it's required) the method
Slightly off topic: Would you mind helping me where/how to add this \Stripe\Stripe::setMaxNetworkRetries(2);
We are using codeigniter 4 with Stripe library
Looking at the creation request for that customer (https://dashboard.stripe.com/logs/req_KAUEptTpbCtX3L) you can see that nothing related to payment information was passed in
Are you directly using the Stripe php library?
Yes, stripe php library
I actually see that customer has a valid/paid subscription
Ahhh sorry, I sent you the wrong request - you want to be looking at https://dashboard.stripe.com/logs/req_1IecLTPyAqHkKr instead
For setting max network retries, you can just set that after you set your API key
What is confusing though, can we compare these two:
https://dashboard.stripe.com/logs/req_T8VoWy74SfH62b
https://dashboard.stripe.com/logs/req_HDKOtzemo1vOcK
They have the exact same request post body
Yes, those two requests are the same but the Customers that you're using in the request are different. The customer cus_KxTYW6XWyE1sIp for request req_T8VoWy74SfH62b does not have any default source or payment method while the customer cus_KxTk3pDHTZA0IS for request req_HDKOtzemo1vOcK does. You can compare the creation requests for the two customers and see the difference:
- https://dashboard.stripe.com/logs/req_LgKqZluEQxGQbS (creating a subscription fails for this customer)
- https://dashboard.stripe.com/logs/req_corjHZV14bDmRP (creating a subscription succeeds because a default source is set when you pass in
sourceduring customer creation)
Gotcha, so we didn't send any payment information through API?
Correct - you never sent any payment information
Would you mind sending me which api we should use to send the payment info? Just want to confirm if we are using the right one
There are multiple ways to do that - your integration is currently using tokens so you can set source when you create a customer to have it automatically set as the default on the customer. We do generally recommend that users now use Payment Method instead of Tokens/Sources, but that would require some changes on your end to support
Would you mind sending me the link for the method you've recommended?
It's just on the Customer API - https://stripe.com/docs/api/customers/create#create_customer-source
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thank you, I will go through this
I have few more questions for you if you don't mind, shall I create a new topic?
If you have more question feel free to continue them here! I'm heading out, but @candid helm is around to help
Hello ๐
Hey Pompey, thanks for reaching out!
So, we are using an account that is integrated on few different locations (websites/applications), and we would like to run a report through API that's only related to the products for a specific website. Is there anyway we could do that with specific product ID or category?
Good question. Do each of the websites sell different sets of products?
Also to be on the same page, are you talking about making your own report or running one of our reports? https://stripe.com/docs/api/reporting/report_run
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes, these websites are using different products (there are no shared products within websites)
Whatever we can, we just need the total balance (for 2 products) which we can easily sum if we knew how to pull the data for those products only, and invoices for these products, specifically
Thank you for the clarification. Looking in to how you may do this.
Thank you very much
If you are trying to do this yourself, you can list subscriptions by what products they include. So that can help you see which subscriptions go to each product and which invoices each of them made. https://stripe.com/docs/api/subscriptions/list#list_subscriptions-price
And you might be interested in our reports which can list this info https://stripe.com/docs/reports/payout-reconciliation#schema-payout-reconciliation-itemized-5
Honestly I would reach out to our support about this https://support.stripe.com/?contact=true , I am less sure on what the best way to get this data outside of the API is