#mattwiner
1 messages ยท Page 1 of 1 (latest)
Yeah I think starting with all of the things relevant to the specific Payout would probably be easiest. You can use list BalanceTransactions and filter by the payout's ID to see all everything related to your balance that got added to that payout https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Great, that works. So now the follow up. I have metadata set in the payment intent. What is the best way to get the metadata coming at it from this direction?
Basically we are passing into the PI metadata EventIDs. So I need to figure out the breakdown of a payout is going to each eventID.
Can you give a specific example of what you want that to look like? You are adding an event ID to the metadata of the PI and want to get a list of those event IDs when looking at a specific payout?
Yeah so my goal is to say we have a payout coming of $1074. I want to see all the transactions (charges, refunds, & feed) for that payout. Then I need to total up which EventID each of those transactions belong to. So something like this:
So if you are only setting this metadata on the payment intent, you will probably need to look up your payment intents to get their metadata while processing your other related transactions
Charges will automatically have a copy of thier intent's metadata but the other related objects will not
So you need to look it up, or specifically update those objects to add the right metadata once they are created.
Assuming I don't make any changes:
--From the balance_transaction-payout I get all the charges associated to the payout
--Then I use the charges to get the payment intents
--Then use the payment intents to get the metadata
Right?
The other option would be to add the eventID to the charge.create metadata. Thus saving me one step?