#nvpatel7_api
1 messages · Page 1 of 1 (latest)
đź‘‹ Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đź”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1275161334417457257
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
When you say "a list of bank accounts", what do you mean? There's usually only one payout account per Connect Account
there can only be one bank account per user?
Hello, this is the API call that you are looking for
https://docs.stripe.com/api/external_account_bank_accounts/list
And more precisely the restriction is one bank account per supported currency on the account. So for example US accounts can only settle in USD so they can only have one USD bank account connected to their account. Canadian accounts can settle in USD and CAD so they can have one account for each
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 it is! Ok i Understand now, I was under the influence that we can have multiple accounts per user. Thank you so much for the help!!!
wait that wasnt it]
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
it was this one
Of course, it can definitely be confusing at first. This doc talks more about payouts and supported currencies https://docs.stripe.com/payouts
This link is for our older Sources API. It will list bank accounts connected to a specific Customer object that can be used to pay you if they were saved a specific way
The external accounts endpoint that I linked to is the one that will list what accounts you can pay money out to
ok so just to make sure, I can use the api link you sent to list bank accounts that are connected to a specific customer based on the id of the customer
For that, it depends whether you are using the Sources or Payment Methods API. If you are using sources, then the endpoint that you found should work. For Payment Methods, you can use this endpoint and filter on the payment method type parameter
https://docs.stripe.com/api/payment_methods/customer_list#list_customer_payment_methods-type
https://docs.stripe.com/api/payment_methods/object#payment_method_object-type
To align on terminology, you mentioned a "payout" in your initial question. In Stripe terms, a payout is when you have funds on a Stripe account and you have those funds sent to a bank account that is on file. It is how people actually get their money from Stripe.
ok so i use the first one since I'm using source. Also for clarification because my lead is asking, can we save multiple bank accounts to a user but the user can pick one on the frontend of a website to use for a payout? If so, can they change the account for a payout or no?
@sharp mantle apologies for missing the followup question. I am a bit confused at exactly what you are saying. Can you tell me more about the page that you are building and what your users are trying to do on it?
so I have two pages that I'm building:
A page for the user to add a bank account, which will be linked to their customer_id using source. On that page there is a dropdown for the users to see what bank accounts they have added
The second page is for the user to execute a payout. On that page, there is also a dropdown to show what accounts are saved. We want the user to select any account they have saved to be used as a payout. My idea is that when the user selects it on submit for the payout, the destination will be the id of that account.
So i'm wondering that for this setup, can we store more than one US account to be available for a payout?
So to be clear, these are people that are both paying you money and getting money payed out to them?
Correct. If it makes it easier. I can do a call and explain it all
Typically we have the restriction of one bank account per settlement currency for each Stripe account though that can be relaxed for certain account types I think. What connect account type are you working with?
I believe I have custom as for whenever a customer creates an account on the website, a stripe customer_id is created for them, which helps us with updating their balance after a successful checkout session
Gotcha, custom accounts should be able to have multiple external accounts for a currency by default. You can specify that an account should be used for payouts by setting default_for_currency=true on it I believe https://docs.stripe.com/api/external_account_bank_accounts/update#account_update_bank_account-default_for_currency
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok perfect so which api call would be best for me to retrieve a list of the bank accounts?
Payout accounts are external accounts https://docs.stripe.com/api/external_account_bank_accounts/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok does this work for also listing all accounts based on their customer_id?
Hi there
Stepping in for my teammate since they had to log off
the "List all bank accounts" endpoint is specifically for listing bank accounts that are used by a connected account for payouts
If you need to list a customer's PaymentMethods (payment details used for charges), you can use this: https://docs.stripe.com/api/payment_methods/customer_list
can a payment method also be used for a payout?
No
Is there a way we can do a call bc i don’t think I’m explaining this right for yall
No, I'm not able to schedule a call here. If you'd like to resume this over email, I recommend reaching out here: https://support.stripe.com/contact/
Alternatively, it would be helpful if you have a specific example. You've mentioned customers and payouts so far but it's not clear to me whether you're using Connect or not
I'm going to try a screen recording about what I'm trying to do
It should be possible to explain this in a few sentences, might be faster than a screen recording
So there’s two times where I need to use stripe:
First is to create a checkout session so on success it updates a balance based on the amount of money they put in.
Second is to have users insert bank accounts that on a separate page, when they want to initiate a payout, they can select a bank account to initiate the payout. I want the user to be able to see all the bank accounts they’ve created into their stripe customer account via a dropdown. So that’s why I’m trying to ask how I can retrieve saved bank accounts
Let's start with the Checkout flow. The funds that are captured as part of a Checkout flow will either be added to your Stripe account's balance or to the balance of one of your Connected accounts.
stripe customer account
There's no such thing as a "customer account". I think there might be a misunderstanding about how Connect works
Must be. Because I have it where when a user signs up a stripe customer is created
Let's take a step back. Can you tell me about your ideal funds flows here? Who's paying for what and who's receiving funds for those goods/services?
So we are an e sports tournament company where tournaments are pay to enter. User uses their credit card to gain a balance so that they can register for tournaments, which is done through a checkout session. After a successful checkout, their balance is updated. For testing I have a dev account so that I can make sure I he flow is happening correctly. When the customer wants to withdraw money, they first need to add a bank account so that when it’s time to initiate a payout, the customer doesn’t need to insert their information again
By "withdraw", I assume the customer wants to refund some of the funds they used to "gain a balance"?
Yeah, I think there's just a terminology misunderstanding. The term "Payout" refers to sending funds from a Stripe merchant account balance to that merchant's external account. In this case, the e sports player does not have a Stripe merchant account so there's no balance from which they can pay out funds
I think this is what you're looking for: https://docs.stripe.com/api/refunds/create
You can pass a value for amount if you want to refund a portion of a charge; the funds will be returned to the customer's original form of payment
I think I said it wrong. We have a merchant account so that’s why I’m wondering if we can initiate the payouts to the customer bank accounts
Right, you have a merchant account and the funds collected from Checkout payments are used to increase your merchant account's balance. The only payout you can complete using those funds is to an external bank account you configure as your own
What documentation should i look at then?
The Refunds endpoint I linked above: https://docs.stripe.com/api/refunds/create
When the customer wants to withdraw money
Can you tell me more about this use case? What do you mean exactly by "withdraw money"?
Almost like when you’re sports betting you insert money to bet and when you’re done betting or you receive winnings you send that money back to your bank account
I see.
If the goal is to return some funds to the customer because they didn't use all of their funds as part of a tournament, Refunds is the way to go. This also keeps you from over-refunding since you can only return an amount up to the total amount of the original Charge
What about if they made two different payments that are different amounts. Say I deposited $15 and then I made a $10 deposit. Can I take out max 25?
No, not exactly. You could refund up to $15 as a single refund, or up to $10 as a separate refund
Ok and does this mean that when the customer checks out, do they need to have a result default payment method so that I can create a payment intent?
If you intend to create a payment for a Payment Intent, then yes you will need to attach a Payment Method to a Customer
Well what about the parameter charge? Can that be fetched from retrieving a checkout session?
You can get the Charge too, but the Payment Intent is better since that will give you state on the actual payment process. The Charge only represents a single payment attempt
Ok perfect. Can the payment intent be fetched from the checkout session
But what if the customer wins a tournament, which means the money he has in his balance is more than what he paid, how can we let them refund all the money without an error
I would recommend building a test integration. A lot of these questions can be easily answered via our docs and by simply inspecting the behavior of your own prototype. Quickstart guides for checkout take only a few minutes to build and poke around in