#whoami_code
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/1298428873066942476
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- whoami_code, 23 minutes ago, 22 messages
- whoami_api, 4 days ago, 9 messages
- whoami_code, 4 days ago, 31 messages
Hi there
Hi
Can you share more context about what you're trying to do?
I'm implementing a withdraw endpoint, which will do a transfer first, then payout after the transfer succeeded.
is there any recommendation for handling the time before I initiate the payout?
how long does it usually take to transfer from one account to the other
https://docs.stripe.com/connect/add-and-pay-out-guide?dashboard-or-api=api#with-code-pay-out-to-user
Taking over this thread, catching up now
When the platform has sufficient balance, the successful transfer will be available immediately in the connected account for payout. I'd recommend checking the connected account's available balance before paying out
Transfer can't be done between two connected accounts. The transfer has to go through the platform
oh yes sorry, from platform to connected accounts
I see, so if I want to do it in the same function, do I need to implement some retry and wait logic after creating the transfer, before payout?
or should I create the payout after receiving transfer succeeded webhook event?
oh wait, but I only see transfer.reversed, transfer.updated, transfer.created
You can listen to balance.available event for the changes on the available balance of a connected account after a successful transfer
Reference: https://docs.stripe.com/connect/webhooks
so there's no event to confirm transfer succeeded?
Once the transfer object is created (tr_xxx), the transfer is already successful
listening to the balance.available event require me to keep track of the previous balance and do calculation, which shouldn't be needed
what will happen if it fails
for example, I only have 10 usd in my platform, and two 10 usd transfers happening at the same time, only one will succeed, but two transfers are created
If the transfer fails, the error will be returned in the API response and transfer object won't be created. When a transfer object is created, this means that the transfer is successful, but it is just a matter when the fund will reach the connected account.
One way is to expand balance_transaction when making the transfer. It will show the balance_transaction.available_on timestamp on when the fund will reach the connected account. You can then make a payout after the available_on timestamp.
Alternatively, balance.available is the quick way to check the amount of balance available to payout for a connected account.
oh I see, this balance_transaction.available_on might be a time in the future?
available_on can be a future timestamp especially if you set source_transaction in the transfer request: https://docs.stripe.com/connect/separate-charges-and-transfers?platform=web&ui=stripe-hosted#transfer-availability
I see
I also see a payment event happens with the transfer event, can I listen for the
payment.created event with the same source_transfer?
Sorry, I would like to make a correction on the expanding the balance transaction. The balance transaction should be expanded should be destination_payment.balance_transaction which will then reflect the timestamp on destination_payment.balance_transaction.available_on when the fund will reach the connected account.
payment.created event doesn't mean that the fund is available for paying out. If you wish to use payment.created event, you'd also need to expand its balance transaction to check the available_on
hmmm I know expand the api response, but how should I expand the webhook event?