#XinJin-payouts

1 messages · Page 1 of 1 (latest)

limber sonnet
#

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

golden crater
#
    connectStripeAccountId,
    amount,
    metadata = {},
    currency = 'usd'
  ) {
    return await stripe.payouts.create(
      {
        amount,
        currency,
        metadata,
      },
      {
        stripeAccount: connectStripeAccountId,
      }
    )
  }```
#

I actually passed.

limber sonnet
#

yep you did

#

so when you say " I can not find that in log.", where exactly are you looking?

golden crater
#

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.

limber sonnet
#

that's your platform dashboard

golden crater
#

I want to see in dashboard

limber sonnet
#

the payout object exists on the connected account

golden crater
#

That was created manually on dashboard.

limber sonnet
#

yep click the ... menu in the top right

golden crater
#

I think I am on connect account dashboard.

limber sonnet
#

you're not

#

click the ... menu and "view dashboard as" per my screenshot

golden crater
#

I see.

#

I am on connected account dashboard, right?

limber sonnet
#

yes

golden crater
#

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.

limber sonnet
#

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)

golden crater
#

Makes sense.

#

But payment.created means

#

transfered money is ready to pay out to bank?

limber sonnet
#

no

#

it just means the transfer arrived

#

to be clear you really don't have to do any of this and manually create payouts

golden crater
#

I am

#

using manual

#

type

#

for instant payouts.

limber sonnet
#

the default is the money just gets paid out automatically as fast as it can

#

fair enough!

golden crater
#

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?

limber sonnet
#

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

golden crater
#

Yeah.

limber sonnet
golden crater
#

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.

limber sonnet
#

how do you mean?

golden crater
#

It doesn't show an account Id or another info, right?

limber sonnet
#

sure but why would it?

#

you know what account it is, based on the webhook

golden crater
#

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?

limber sonnet
#

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)

golden crater
#

I mean connected accounts are added dynamically.

golden crater
#

In my case thousands of connected accounts are added.

golden crater
#

to payouts from a specific connected account.

tame ruin
golden crater
#

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.

hushed haven
#

balance.available should pay out, depends if you're listening to that event on the Connect endpoint

golden crater
#

Sorry?

hushed haven
#

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

golden crater
#

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.

hushed haven
#

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)

golden crater
#

{"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.

twilit hawk
#

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?

golden crater
#

correct.

twilit hawk
#

Gotcha - and do you have a balance.available event ID I can take a look at?

golden crater
#

So it doesn't include even the id.

twilit hawk
#

It'd be really helpful if you could give me the actual event ID that's in the screenshot

golden crater
#

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.

twilit hawk
#

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

golden crater
#

Which screenshot you mean?

twilit hawk
golden crater
#

Hmm,

#

strange.

#

The object doesn't include the id.

twilit hawk
golden crater
#

Yeah.

#

That makes sense.

#

I mean the connected stripe account id.

twilit hawk
#

Yes, event.account will have the connected account ID if the event was sent to a connect webhook endpoint

golden crater
#

From event object?

twilit hawk
#

Yes

golden crater
#

Ok. I am checking now.

#

Ok.

#

Thank you.

#

Seems worked.

twilit hawk
#

👍

golden crater
#

Final question is

#

how to get the payout fee?

twilit hawk
#

You mean the fee from instant payouts?

golden crater
#

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.

twilit hawk
#

"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?

golden crater
#

API.

twilit hawk
#

Do you have an example payout I can take a look at?

golden crater
#

Screenshot, you mean?

twilit hawk
#

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)

golden crater
#

po_1Jm0TTREpmTGjgEmJsZRbb6N

twilit hawk
#

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

golden crater
#

Strange.

#

Definitely I payed out manually.

#

If I don't,

#

it was in balance

#

although it was ready to pay out.

twilit hawk
golden crater
#

I see.

#

The standard is quite quick for test case.

#

But in live mode,

#

it will take time, right?

karmic widget
golden crater
#

I mean standard payout.

karmic widget
golden crater
#

po_1Jm1mnREpmTGjgEmH5zgsFnO

#

Now I used instant payout.

#

Can you check the payout fee?

rain parcel
#

What are you trying to debug? What do you need help with? What fee?

#

that Payout is an instant payout and it sent the right amount. The fee for instant payouts is taken out of your balance separately, aggregated monthly I think

golden crater
#

In the doc, as I see.

#

it says 1% of payout amount.

#

or 50 cent.