#some1ataplace_api

1 messages ¡ Page 1 of 1 (latest)

unique caveBOT
#

👋 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/1403429339525156894

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

wise slate
#

I am also curious what would happen on partial refunds as well. Let's say I do something like after certain X number of days customer gets a 50% refund, after y number of days customer gets a 25% refund, etc.

mystic crown
wise slate
#

SC&T is what I use

#

I use a Transfer API call in a webhook when the customer buys the product from the connect account

mystic crown
#

The fund will be deducted from the platform to refund to the customer. The platform can reverse the transfer from the connected account after that

wise slate
#

And that will only occur if the connect account has not yet collected the funds? What happens if they collect the funds?

#

what i mean by collecting funds - move the money from stripe to their bank account

mystic crown
#

Reverse the transfer will be a different API call.

#

And that will only occur if the connect account has not yet collected the funds? What happens if they collect the funds?
what i mean by collecting funds - move the money from stripe to their bank account
I see that you're referring to the payout here. Am I right to understand the scenario which there isn't sufficient fund on connected account during the transfer reversal process?

wise slate
#

correct

mystic crown
#

In this case, I'd recommend checking the available balance on the connected account, and reverse the transfer when there is sufficient fund on the connected account.

Alternatively, you can debit connected account to recover the fund: https://docs.stripe.com/connect/account-debits

Collect funds from a connected account by debiting its Stripe balance.

wise slate
#

Very interesting! What if debits never occur and the connect account refuses?

mystic crown
#

What if debits never occur
Do you mean the debit process is failed?

wise slate
#

yes

#

Otherwise I am thinking of setting up some type of holding period before transfers are made to the connect account. So for example, a customer buys a connect account product. Within 5 days customers can get a 100% refund, within 10 days, 75% refund, etc. After 10 days 25% -> 100% - 75% = 25% can get transferred to the connect account and they can do whatever they want with it. That way there will always be a balance on the connect account I think. How would I do something like this?

mystic crown
#

By setting debit_negative_balances: true, Stripe will reclaim negative balances from an attached bank account: https://docs.stripe.com/api/accounts/object#account_object-settings-payouts-debit_negative_balances in the case of transfer reversal for example.

However, there is still a chance that the debit will still fail.

Stripe doesn't support custom balance holding like this. The only way is to set the connected account to manual payout, and manage the payout amount by yourself

wise slate
#

Okay this is all very enlightening. So if there is a failure on the debit the platform will have to come up with the extra money (even if the platform doesn't have it?). Is there a way to automate the payouts if set to manual payout? Maybe a cron job?

mystic crown
#

That should be implemented with your system, be it a cron or batch job

wise slate
#

Okay I will look into the cron job maybe. So with failed debits the platform has to tough it out I guess?

mystic crown
#

You can reverse the transfer whenever the connected account has sufficient balance. For example, right after the next transfer

wise slate
#

i see, so when a different customer buys their product, I take from that balance to help out the refunded customer?

mystic crown
#

Since the balance will all be on the connected account, it doesn't differentiate where those funds are coming from

#

So yes. Once the customer B makes a payment and platform transfers the funds to the connected account, platform can immediately perform transfer reversal to recover the previous refund on the platform

wise slate
#

Wow, this is going to be quite complicated, it is never so easy it seems lol. So in summary you would suggest:

Customer buys product:
Transfer funds right away in the success webhook

If customer refunds:
Check connect account balance
Reversing the transfer on the connect account's balance if there are funds available
If not then try debiting the connect account balance (debit_negative_balances: true)

Other option:
Cron job with manual payouts to handle the transfers automatically after certain number of days

Which option are you leaning towards more?

Also wondering how I would test the debiting thing. To purposely cause a negative balance.

unique caveBOT
mystic crown
#

Either one works. This will depend on your business requirements, and what is the best way to recover the funds

wise slate
#

ok, any ideas how to purposely cause negative balance to test the debiting?

uncut hare
#

Hi taking over here

#

Why do you need to force a negative balance exactly?

wise slate
#

hi there duchess, thanks river for the help so far

#

To test for that edge case scenario

#

A customer buys a product from a connect account, connect account paid out all the funds, their bank account is empty. Curious what would happen. There will forever be a negative balance on my platform?

uncut hare
#

It won't be negative forever

#

Oh you mean the bank account doesn't have funds so we can't automatically top up the stripe account balance?

wise slate
#

Yes.

uncut hare
#

This is your platform, no?

wise slate
#

it is

uncut hare
#

Presumably the bank account wouldn't be empty forever

#

So eventually your balance would be topped up

wise slate
#

that is in terms of my platform balance being negative, what about the connect account balance being negative? And a customer tries refunding that connect account product but the connect account already got paid out? And the connect account refuses to pay the funds? And their bank account is empty with debit_negative_balances: true? Just wondering how it will all work and I am understanding correctly.

uncut hare
#

Ah that's a fair concern

#

Yes I suppose that's possible if you get a bad client/connect account that refuses to resolve the balance issue

wise slate
#

yes, because the person could just disappear and never be heard from again

uncut hare
#

Yes

#

Unfortunately there's not really a way to handle this

#

You can't set minimum balances for the connect account

#

In a marketplace there's always a risk for fraud/bad users

wise slate
#

hmm so my platform will have to handle that extra money that got refunded? So if a customer buys a $5 product from the connect account, my platform gets $4, connect account gets $1, the customer wants a refund, but the $1 already got paid out and spent somewhere by the connect account, my platform which get paid $4 now has to cough up an extra $1 out of nowhere?

uncut hare
#

Yes

#

That's actually what's expected with destination charges

#

The platform is liable for refunds

wise slate
#

hmm I am just concerned like if I have a huge balance like that how I would ever pay it back. Since my platform doees not have that total anymore in the first place.

uncut hare
#

If you implement a destination charge flow, then you have to be prepared for such scenarios

wise slate
#

this is separate charges and transfers though

uncut hare
#

That's the same thing

#

The only difference is the transfer is made manually

#

The transaction is made on your platform

#

So the platform holds liability for the refund

wise slate
#

So in that case, I would combat it by timing when the transfer occurs?

uncut hare
#

That's an option

#

Depends on your business

#

And when the connect account needs to receive the funds

wise slate
#

I think that is what I gotta do. I will only give the funds to the connect account after a certain period of time. That way therre is a refund window for the customer to get the whole amount back

uncut hare
#

You also have to watch for automatic payouts

#

They could payout the funds before they're transferred

#

Manual payouts may make more sense for you idk

wise slate
#

gosh there is no way to stop that?

#

so i have to do manual payouts with a cron job? That is my best bet?

uncut hare
#

If you do manual payouts it gives you way more control

#

You can hold funds as long as you want

#

Then payout when you deem it's time

wise slate
#

i see. where do i set that again in thee dashboard?

uncut hare
#

If you have express and custom accounts you can also put them on manual payouts

#

To control when they receive their funds

wise slate
#

yes i have express accounts

uncut hare
#

But yes should be on your dashboard for your platform's payout schedule

#

To set it for connect accounts you can use the api

wise slate
uncut hare
#

I don't know the exact link

#

I'm not the most familiar with the dashboard

#

But if you search payout schedule it should come up

wise slate
#

no worries

#

Thanks. So if i were doing a cron job where would i even begin? List all connect account balances or something?

uncut hare
#

Kinda up to you, but if you were controlling this manually I would expect you to keep track of transactions on your end and when they should be paid out (according to your risk tolerance threshold). So that when you do initiate a manual payout, it only includes transactions you deem ready for payout.

wise slate
#

ah not a bad idea

#

sorry in a meeting with someone at the same time lol

#

there is no way via the API to look it up without me doing something in the database?

uncut hare
#

What do you mean

#

You're trying to implement a highly custom use-case here

#

Where you need to hold on to certain transactions for certain lengths of time

#

You need to control this

#

You can use our api to retrieve data about things

#

But this is the kind of thing you'll need to track heavily in your own database

unique caveBOT