#whoami_code

1 messages ¡ Page 1 of 1 (latest)

scenic glenBOT
#

👋 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.

sour sonnet
#

Hi there

ebon lodge
#

Hi

sour sonnet
#

Can you share more context about what you're trying to do?

ebon lodge
#

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

scenic glenBOT
teal carbon
#

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

ebon lodge
#

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

teal carbon
scenic glenBOT
ebon lodge
#

so there's no event to confirm transfer succeeded?

teal carbon
#

Once the transfer object is created (tr_xxx), the transfer is already successful

ebon lodge
#

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

teal carbon
#

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.

ebon lodge
#

oh I see, this balance_transaction.available_on might be a time in the future?

teal carbon
ebon lodge
#

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?

teal carbon
#

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

ebon lodge
#

hmmm I know expand the api response, but how should I expand the webhook event?