#XinJin-payouts
1 messages · Page 1 of 1 (latest)
@golden crater it's probably on a connected account so you need to pass the Stripe-Account option when retrieving it, or look at the dashboard of that account.
connectStripeAccountId,
amount,
metadata = {},
currency = 'usd'
) {
return await stripe.payouts.create(
{
amount,
currency,
metadata,
},
{
stripeAccount: connectStripeAccountId,
}
)
}```
I actually passed.
yep you did
so when you say " I can not find that in log.", where exactly are you looking?
Oh,
Sorry.
I did something wrong, I think.
So,
I want to payout as soon as a transfered money from main stripe account to a connect account is available.
So I listened the method in payment.created event which is triggered after a transfer is created.
that's your platform dashboard
I want to see in dashboard
the payout object exists on the connected account
I think I am on connect account dashboard.
yes
What is the best scenario for this?
I created a transfer with meta data.
"id": "tr_1Jlr6RIqjQenjcYZPJqEbhh5",
"object": "transfer",
"amount": 19680,
"amount_reversed": 0,
"balance_transaction": "txn_1Jlr6RIqjQenjcYZvBVe13O2",
"created": 1634545311,
"currency": "usd",
"description": null,
"destination": "acct_1JldIiREpmTGjgEm",
"destination_payment": "py_1Jlr6RREpmTGjgEm9wb7Xzjh",
"livemode": false,
"metadata": {
"petitionId": "29",
"action": "TUTOR_PAID"
},
"reversals": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "/v1/transfers/tr_1Jlr6RIqjQenjcYZPJqEbhh5/reversals"
},
"reversed": false,
"source_transaction": null,
"source_type": "card",
"transfer_group": null
}```
So I got transfer.created event at first.
After that, I got payment.created event.
"metadata": {},
"on_behalf_of": null,
"order": null,
"outcome": null,
"paid": true,
"payment_intent": null,
"payment_method": null,
"payment_method_details": {
"stripe_account": {},
"type": "stripe_account"
},
"receipt_email": null,
"receipt_number": null,
"receipt_url": "https://pay.stripe.com/receipts/acct_1JldIiREpmTGjgEm/py_1Jlr6RREpmTGjgEm9wb7Xzjh/rcpt_KQiXoEVJHLJRqdsNKFfKqBoYEFfHvLO",
"refunded": false,
"refunds": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "/v1/charges/py_1Jlr6RREpmTGjgEm9wb7Xzjh/refunds"
},
"review": null,
"shipping": null,
"source": {
"id": "acct_1IQYX4IqjQenjcYZ",
"object": "account",
"application_icon": "https://files.stripe.com/links/MDB8YWNjdF8xSVFZWDRJcWpRZW5qY1lafGZsX3Rlc3RfNzg2R3Foam1PekhGcEJXQXA3aDlweTVp00aiuT3nOh",
"application_name": "Nyvur LLC"
},
"source_transfer": "tr_1Jlr6RIqjQenjcYZPJqEbhh5",
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}```
Without meta data.
yep that's how it works
the destination payment object doesn't take metadata from the transfer or the payment on the platform. If you want it to have some you have to manually copy it across (by calling stripe.charges.update(transfer.destination_payment, {metadata : {...}} , {stripeAccount:"acct_xxxx"}) for example)
Makes sense.
But payment.created means
transfered money is ready to pay out to bank?
no
it just means the transfer arrived
it still takes a few days after that (https://stripe.com/docs/payouts#standard-payout-timing)
to be clear you really don't have to do any of this and manually create payouts
the default is the money just gets paid out automatically as fast as it can
fair enough!
How can I know the transferred money is ready to payout?
And it is another question.
How can I see the payouts fee for the instant payouts?
for the first question, I believe the idea is to listen for the balance.available webhook event on the connected account via your Connect webhook endpoint
Yeah.
for the second, I think those fees are bundled up and charged as an adjustment to your platform's Stripe balance (https://stripe.com/docs/reports/balance-transaction-types) once a month
Actually I got a balance.available.
"object": "balance",
"available": [
{
"amount": 57440,
"currency": "usd",
"source_types": {
"card": 57440
}
}
],
"instant_available": [
{
"amount": 57440,
"currency": "usd",
"source_types": {
"card": 57440
}
}
],
"livemode": false,
"pending": [
{
"amount": 0,
"currency": "usd",
"source_types": {
"card": 0
}
}
]
}
But I can do nothing with that.
how do you mean?
It doesn't show an account Id or another info, right?
sure but why would it?
you know what account it is, based on the webhook
https://stripe.com/docs/connect/webhooks#connect-webhooks
In addition to the documented response properties in the event object reference, each event for a connected account will also contain a top-level
accountproperty. It identifies the user for whom the webhook is being sent.
The connected account is generated dynamically
when a user register to the platform.
Then there is no way to add connect webhook to the connect account dynamically?
I don't know what that means
I'd suggest reading the doc I linked above
you only need one webhook endpoint(you create it on your platform and it receives events that happen on all your connected accounts, and yes, including any new ones added)
I mean connected accounts are added dynamically.
In my case thousands of connected accounts are added.
Then I need to get the connected account Id, right?
to payouts from a specific connected account.
@golden crater as @limber sonnet pointed you to here, you'd create a single Connect endpoint and for each connected account you manage the events would be received there, and include the account attribute to tell you which account they are associated with
Yeah.
Actually,
I did.
I created a webhook.
The problem is that I need to payouts when a transfer is available.
Instant payout.
So I wanted to know what event I have to use.
balance.avaiable didn't triggered.
Actually.
although the transfer is ready to pay out.
balance.available should pay out, depends if you're listening to that event on the Connect endpoint
Sorry?
you said the event never triggered, are you listening to that event on the Connect webhook endpoint?
it could be multiple things, I cannot say what exactly, given the info provided
So, to listen all events
I need to add 2 webhooks at least?
An account webhook,
a connect webhook.
Am I right?
I have only one hook.
But it was connect hook.
that seems right, now was there a balance.available event on the Connect account you were expecting it for? do you have the Event ID? I understand it wasn't received as an Event to your webhook endpoint but do you know if the Event even existed (if you have its ID)
{"object":{"object":"balance","available":[{"amount":82040,"currency":"usd","source_types":{"card":82040}}],"instant_available":[{"amount":82040,"currency":"usd","source_types":{"card":82040}}],"livemode":false,"pending":[{"amount":0,"currency":"usd","source_types":{"card":0}}]}}
This is what I got.
So, the balance.available does not have any id.
So it says the exact amount of the account.
But I expected the event object has the connected account id,
and another item fields of necessary fields.
So I can do instant payout action.
Let's back up for a quick second - just to confirm, your main issue is that you're getting balance.available events that DO NOT have the connected account ID on them, correct?
correct.
Gotcha - and do you have a balance.available event ID I can take a look at?
It'd be really helpful if you could give me the actual event ID that's in the screenshot
I have really no idea of how to get it.
I am checking the Events but
balance available events is not there although it seems all of another events are there.
I was referring to the event ID evt_1Jlza1REpmTGjgEmeJ4tskv2 that is in the screenshot you sent over earlier. Looking at it on my end, that DOES contain the accuont ID of the connected account in it
Which screenshot you mean?
Where are you looking for the account ID? The account ID won't be in the Balance object returned with the webhook (what you're getting from event.data) - it'll be a top-level attribute on the event (see https://stripe.com/docs/api/events/object#event_object-account)
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, event.account will have the connected account ID if the event was sent to a connect webhook endpoint
From event object?
Yes
👍
You mean the fee from instant payouts?
Yeah.
And I want to know where the balance.available came from.
In my case,
I want to get transfer Id which triggered the balance available event.
"I want to get transfer Id which triggered the balance available event" -> The only way to get that is list your most recent balance transactions. There isn't a way to get it directly from the balance.available event
and are you asking how to get the fee from instant payouts from the dashboard or the API?
API.
Do you have an example payout I can take a look at?
Screenshot, you mean?
No - in general, we don't find screenshots very helpful unless you're having specific issues with the dashboard. I was hoping for the payout ID (like po_xxx)
po_1Jm0TTREpmTGjgEmJsZRbb6N
That's a standard payout though - I believe that's something you'd see as a balance transaction on the platform account at the end of the month. It's not something you can retrieve through the API on a per-payout basis
Strange.
Definitely I payed out manually.
If I don't,
it was in balance
although it was ready to pay out.
Just because you paid out manually doesn't mean it'll be instant. You need to specify method: instant as well (https://stripe.com/docs/api/payouts/create#create_payout-method)
I see.
The standard is quite quick for test case.
But in live mode,
it will take time, right?
According to our doc Instant payouts typically appear in the associated bank account within 30 minutes https://stripe.com/docs/connect/instant-payouts
I mean standard payout.
That can depend on a number of factors. Have you seen this doc? https://stripe.com/docs/payouts#payout-speed
po_1Jm1mnREpmTGjgEmH5zgsFnO
Now I used instant payout.
Can you check the payout fee?