#divya.shalini.ics

1 messages · Page 1 of 1 (latest)

olive steppeBOT
#

Hello divya.shalini.ics, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
• divya.shalini.ics, 1 days ago, 16 messages

wise root
#

Hi there 👋 I believe that will get you to the underlying Charge objects, which are then related to Payment Intents. I think if you adjust the expand portion of the sample code shown there so that it expands data.source.payment_intent, that you'll see the Payment Intents returned inline as well.

If you just want to get the Payment Intent IDs, those should be in the Charge objects in the results you're getting.

coral panther
#

Ohh Let me check that as well

#

See I am using below payout ids :-

po_1O2O7oQZNQg7IhpbBUC8JJKj

#

po_1O1IimQZNQg7IhpbsvtaXHE2

#

But still not able to get the pi_ related to these

#

It's coming null in charge object

#

May I know what would be the reason?

wise root
#

Can you share the ID of a Charge object that you're looking at?

#

Actually, is this for a Connect integration, using Destination Charges by chance?

olive steppeBOT
coral panther
young lily
#

Ok it's a bit more complicated then with Destination Charges. Let me explain

coral panther
#

Ok

young lily
#

When you create a charge via destination you get:

  • a Charge object (ch_XXXX) on the platform
  • a Transfer object (tr_XXXX) on the platform to send funds to the connected account
  • a Charge object for a payment (py_XXXX) on the connected account for the funds sent to the connected account
    The Charge object on the connected account has the source_transfer property which gives the id of the transfer in the platform that created this payment. The Transfer object has the source_transaction property which gives the id of the charge that created this transfer.

So, to get the payment intents involved in a payout, you need to call list balance transactions, passing the payout id: https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout, expanding source: https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-source. Source will be the charge object on the connect account. You can keep working backwards from there (going from source_transfer -> transfer -> source_transaction)

coral panther
#

I have tried using above instructions, but it seems we can only expand till 4 levels of a property

young lily
#

This isn't 1 object

#

Expansion is for expanding properties in 1 object

#

These are:

  • balance transaction
  • connect account charge
  • transfer
  • platform payment intent
#

4 separate objects

coral panther
#

Ok, Can you please give me an example?

young lily
#

This was the example:
So, to get the payment intents involved in a payout, you need to call list balance transactions, passing the payout id: https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout, expanding source: https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-source. Source will be the charge object on the connect account. You can keep working backwards from there (going from source_transfer -> transfer -> source_transaction)

#

Let me try to be more specific though. One moment

coral panther
#

Sure, Thank you in advance

young lily
#

So once youve listed balance transactions by payout and also expanded the source param, you will need to make another api call to retrieve the charge objects on the connect account (via the id at the source param). https://stripe.com/docs/api/charges/retrieve. Since this charge is also on the connect account, you'll need to also pass the stripe account header for these calls too: https://stripe.com/docs/connect/authentication. Now, on that charge object, you will see the source_transfer: https://stripe.com/docs/api/charges/object#charge_object-source_transfer. That will be the transfer object on your platform. You can retrieve that transfer on your platform account (no stripe account header): https://stripe.com/docs/api/transfers/retrieve. That transfer will have a source_transaction: https://stripe.com/docs/api/transfers/object#transfer_object-source_transaction. That will be your payment intent

coral panther
#

Ok, let me check this way

#

Please don't close the thread