I'm new with STRIPE, and I've been reading the documentation for STRIPE, and was task to create a list of payouts to a connected account (type is standard). Also, I have to show the details, under those PAYOUT, all the payments included in it.
However I can't see any relation to PAYOUTS with PAYMENT INTENTS/CHARGES, is it possible to know all those payments included in the PAYOUTS ? We are creating STANDARD connect accounts for our users.
You'll have to call the list balance transactions endpoint for each specific payout, filtering to transactions of type charge only, and expanding their source. This returns a list of balance transactions with each of their sources being a charge object, and in that charge object you'll find a payment_intent field which, unsurprisingly, links to the payment intent that created said charge.
I had the same challenge, and had to go thru 4 supporters, tell my needs over and over again, before i finally got the right hint and could complete my checks and cron jobs. I provide my solution here to save others the same experience:
$po = 'po_sadfahk.....'; // payout id (i do a loop of payouts)
\Stripe\Stripe::setApiKey($stripeSecretKey);
$balanceTransactions = \Stripe\BalanceTransaction::all([
  'payout' => "$po",
  'type' => 'charge',
  'limit' => 100, // default is 10, but a payout can have more payment intents
  'expand' => ['data.source'],
]);
foreach ($balanceTransactions->data as $txn) {
  // my invoice id is added in description when creating the payment intent
  echo "Invoice: {$txn->description}\n"; 
  echo "Created: {$txn->created}\n";
  echo "Available: {$txn->available_on}\n";
  // in source we find the pi_id, amount and currency for each payment intent
  $charge = $txn->source; 
  echo "pi: {$charge->payment_intent}\n";
  $amount = $charge->amount/100;
  echo "$amount {$charge->currency}\n";
}
Output (cropped to relevant data):
{
  "object": "list",
  "data": [
    {
      "id": "txn_1ISOaSGqFEoKRtad...",
      "object": "balance_transaction",
      "amount": 25000,
      "available_on": 1615680000,
      "created": 1615131127,
      "currency": "dkk",
      "description": "Invoice 44",
      ...
      "fee": 530,
      "fee_details": [
        {
          "amount": 530,
          "application": null,
          "currency": "dkk",
          "description": "Stripe processing fees",
          "type": "stripe_fee"
        }
      ],
      ...
      "source": {
        "id": "ch_1ISOaRGqFEoKR...",
        "object": "charge",
        "amount": 25000,
        ...
        "paid": true,
        "payment_intent": "pi_1ISOa3GqFE...", // here we go!
        "payment_method": "pm_1ISOaRGqFE...",
        "payment_method_details": {
          "card": {
            "brand": "visa",
            ...
          },
          "type": "card"
        },
        ... 
      },
      "status": "available",
      "type": "charge"
    }
  ],
  "has_more": false,
  "url": "/v1/balance_transactions"
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With