#MrTomAsh

1 messages ยท Page 1 of 1 (latest)

queen mothBOT
frosty umbra
#

Hi there!

west gate
#

Hi @frosty umbra!

frosty umbra
#

If you set the metdata on teh account object, then it stays on the account object.

west gate
#

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.

frosty umbra
#

How do you retrieve the payouts? With a webhook event?

west gate
#

As said - there's a schedule that creates them

#

Yes

frosty umbra
#

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.

west gate
#

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"
}
frosty umbra
#

Right at the very top, I see "account": "acct_1IuG9nR7KFF0ovEx",

west gate
#

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.

frosty umbra
#

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.

west gate
#

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.

frosty umbra
#

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.

west gate
#

So what's the point of metadata on the Payout anyway as it will ALWAYS be empty?

#

You should delete it

frosty umbra
#

But it won't be set automatically based on the metadata of the account itself.

west gate
#

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.

frosty umbra
west gate
#

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.

tribal pine
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

west gate
#

Ok