#logonoff
1 messages ยท Page 1 of 1 (latest)
Could you share a bit more context here? Are you using manual or automatic payouts?
Sure! Connected account has automatic payouts enabled.
Let's say I created a transfer to that account
โ stripe transfers retrieve tr_1MDuBWENxjodxCKlFPpBeNbf {
"id": "tr_1MDuBWENxjodxCKlFPpBeNbf",
"object": "transfer",
"amount": 4278,
"amount_reversed": 0,
"balance_transaction": "txn_1MDuBWENxjodxCKl5LFR9diX",
"created": 1670783014,
"currency": "usd",
"description": "Payout for statement 3a5ae9d7-007c-4ea2-9fbe-f3cff11c28af",
"destination": "acct_1MC64FEPfvmnS5SL",
"destination_payment": "py_1MDuBWEPfvmnS5SLOj472Pj8",
"livemode": false,
"metadata": {},
"reversals": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "/v1/transfers/tr_1MDuBWENxjodxCKlFPpBeNbf/reversals"
},
"reversed": false,
"source_transaction": null,
"source_type": "card",
"transfer_group": null
}
I can look up charge created for that transfer
stripe charges retrieve py_1MDuBWEPfvmnS5SLOj472Pj8 --stripe-account acct_1MC64FEPfvmnS5SL ```
It points to balance transaction on the connected account
"id": "txn_1MDuBWEPfvmnS5SLOJwAzg6z",
"object": "balance_transaction",
"amount": 4278,
"available_on": 1670783014,
"created": 1670783014,
"currency": "usd",
"description": null,
"exchange_rate": null,
"fee": 0,
"fee_details": [],
"net": 4278,
"reporting_category": "charge",
"source": "py_1MDuBWEPfvmnS5SLOj472Pj8",
"status": "available",
"type": "payment"
}
And I know there's a payout created for it
stripe payouts retrieve po_1ME0pWEPfvmnS5SLBAK5j44F --stripe-account acct_1MC64FEPfvmnS5SL {
"id": "po_1ME0pWEPfvmnS5SLBAK5j44F",
"object": "payout",
"amount": 4278,
"arrival_date": 1670803200,
"automatic": true,
"balance_transaction": "txn_1ME0pWEPfvmnS5SLfEYzNBzX",
"created": 1670808558,
"currency": "usd",
"description": "STRIPE PAYOUT",
"destination": "ba_1MC67IEPfvmnS5SLO4IxlIkx",
"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": null,
"status": "paid",
"type": "bank_account"
}
So I'm trying to get to that payout through all that objects, sorry for all that JSON
So you want to go from Payout on Connected Account to original transfer on platform, correct?
The other way - I know transfer id for the connected account and I want to see if there's a successful payout with it
Ah
No unfortunately no good way to do this without listing balance transactions by Payout: https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout
Basically you would go transfer --> destination_payment (https://stripe.com/docs/api/transfers/object#transfer_object-destination_payment) --> balance_transaction (https://stripe.com/docs/api/charges/object#charge_object-balance_transaction)
Then you would have to list balance transactions by payout on that Connected Account
So really not a good way to do this unfortunately
So if I want to find payout I would need to enumerate all of them and match with transactions I have? ok
Yes that's correct if you want to go transfer --> payout
Got it, thanks you!!!
Yeah that said to help you you can also list Payouts based on the timestamp
So you don't just loop through all the payouts
Yup, that's what I'm planning
And you can look at the balance_transaction's available_on