#MrTomAsh
1 messages ยท Page 1 of 1 (latest)
Hi there!
Hi @frosty umbra!
If you set the metdata on teh account object, then it stays on the account object.
So, how do I set it, that it will show on every Payout that you guys create?
Our clients have their schedules and Payouts are created automatically.
How do you retrieve the payouts? With a webhook event?
Then the webhook event should contain the account ID. And use the account ID to retrieve the account, which will have the metadata you set.
I don't see anything like that in here:
{
"id": "evt_1MwOicR7KFF0ovExQaIl3H9t",
"object": "event",
"account": "acct_1IuG9nR7KFF0ovEx",
"api_version": "2020-03-02",
"created": 1681386818,
"data": {
"object": {
"id": "po_1MwOibR7KFF0ovExDbvsePs7",
"object": "payout",
"amount": 500,
"arrival_date": 1681344000,
"automatic": false,
"balance_transaction": "txn_1MwOicR7KFF0ovExgURxUnMN",
"created": 1681386817,
"currency": "gbp",
"description": null,
"destination": "ba_1IuGBGR7KFF0ovExkfKEwIuy",
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"livemode": false,
"metadata": [],
"method": "standard",
"original_payout": null,
"reconciliation_status": "not_applicable",
"reversed_by": null,
"source_type": "card",
"statement_descriptor": "FranScape",
"status": "paid",
"type": "bank_account"
}
},
"livemode": false,
"pending_webhooks": 2,
"request": {
"id": "req_KG6od5P0ILCefM",
"idempotency_key": "f3c55027-3155-4987-af0a-c8cd35f2b350"
},
"type": "payout.paid"
}
Right at the very top, I see "account": "acct_1IuG9nR7KFF0ovEx",
Yes, but that doesn't help me much at that point. As mentioned - we're working with multiple clients, every each of them has its own database, and those databases store account ids. To know which database our system has to check I'd like to use metadata and stored tenant name in there.
I'm not sure I follow. You mentioned eralier that the metadata is stored on the account itself. If you have the account ID (as shown above), just make an API call to retrieve the account with https://stripe.com/docs/api/accounts/retrieve and you'll see the metadata.
Yes, but that makes it a bit more complicated
For example, when we receive a payment it has the metadata from the customer account and we can use it to recognize the MT client in here, I'll have to make another call after receiving the Payout just to receive the account data and connect the two.
What I would like to have the same behavior in Payouts as you have with payments and carry the creator (Customer/Connected account) metadata.
Yes I understand, but like I said at the beginning:
If you set the metdata on the account object, then it stays on the account object.
So what I suggested (making an extra API call) is the only option I see.
So what's the point of metadata on the Payout anyway as it will ALWAYS be empty?
You should delete it
No, you can set metadata on the payout if you want https://stripe.com/docs/api/payouts/update
But it won't be set automatically based on the metadata of the account itself.
It works as expected on the Payments. Here's an example. All metadata are there, but it's not working for the Payouts. I'm not sure what's the logic behind it.
What's the point of having metadata when you cannot use it right away? I don't want to DDOS your API with tons of unnecessary requests. Especially since all those information are already there.
You set that metadata yourself when creating the PaymentIntent here: https://dashboard.stripe.com/test/logs/req_5rQzeQqu8olVKP
Ok, fair point.
So I'll have to add an extra request to the account to have the tenant information.
Ok, thanks for your help.
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
Ok