#jose cerrejon-balance-transactions
1 messages · Page 1 of 1 (latest)
Hi 👋 as long as you're using automatic payouts, you can pass the ID of a Payout object into our endpoint to list Balance Transactions, and the response will only include transactions included in that Payout:
https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout
You can then check the source field on the Balance Transaction to see what caused it:
https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-source
I don't understand... For example, I have po_1LDI63RbOMwHsfy7Vn8vWdnz with 7 payments (in the Dashboard, I can see in a section called Transactions. I need all those payments included in a Payout
Sorry, maybe I misunderstand, are you trying to retrieve a list of all payments that are included in a Payout? Or are you trying to trigger a Payout and control what payments are included in it?
the first one
Okay, and you're using automatic payouts?
yes, set to daily
Alright, so then you pass the ID of the Payout that you want to retrieve the related transactions for and pass that into the payout field of the first function that I linked.
so for example, using the cli: stripe payouts retrieve po_1LDI63RbOMwHsfy7Vn8vWdnz --stripe-account acct_1L5Po0RbOMwHsfy7
send me:
{
"id": "po_1LDI63RbOMwHsfy7Vn8vWdnz",
"object": "payout",
"amount": 1100,
"arrival_date": 1655856000,
"automatic": true,
"balance_transaction": "txn_1LDI64RbOMwHsfy7qx3CJ3o0",
"created": 1655860267,
"currency": "eur",
"description": "STRIPE PAYOUT",
"destination": "ba_1L5WnmRbOMwHsfy7Hqm25gQ2",
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"livemode": false,
"metadata": {},
"method": "standard",
"original_payout": null,
"reversed_by": null,
"source_type": "card",
"statement_descriptor": "HAMAEL PAY",
"status": "paid",
"type": "bank_account"
}
I can't see the 7 payments, only the txn_xxx
That's the function to retrieve a single payout, not the one to list balance transactions that I linked to previously.
so that txn_ is the ID you mention, right?
The ID of a Balance Transaction has the txn_ prefix, but I think what you're looking for is in the source field on those objects.
So What's the ID you mention: po_ or txn_?
`stripe balance_transactions retrieve txn_1LDI64RbOMwHsfy7qx3CJ3o0 --stripe-account acct_1L5Po0RbOMwHsfy7``
{
"id": "txn_1LDI64RbOMwHsfy7qx3CJ3o0",
"object": "balance_transaction",
"amount": -1100,
"available_on": 1656288000,
"created": 1655860267,
"currency": "eur",
"description": "STRIPE PAYOUT",
"exchange_rate": null,
"fee": 0,
"fee_details": [],
"net": -1100,
"reporting_category": "payout",
"source": "po_1LDI63RbOMwHsfy7Vn8vWdnz",
"status": "pending",
"type": "payout"
}
the source po here is the same that the command stripe payouts retrieve send me
Did you try listing balance transactions using the payout ID as a filter? Command would look something like:
stripe balance_transactions list --payout=po_1LDI63RbOMwHsfy7Vn8vWdnz