#leman_api

1 messages ยท Page 1 of 1 (latest)

pseudo jayBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1232161858060816434

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

serene shoreBOT
small locust
#

This will be possible to Retrieve Payment Intent and expand latest_charge to get the details of Charge object: https://stripe.com/docs/api/expanding_objects

You will then find the transfer ID under latest_charge.transfer: https://docs.stripe.com/api/charges/object#charge_object-transfer

ashen drum
#

Can it be done by listening to a webhook event?

small locust
#

Yes! transfer ID will be present in charge.succeeded event

ashen drum
#

payment intent or charge?

#

I'm using const paymentIntent = await stripe.paymentIntents.create({
amount: 2000, // amount in cents, $20.00
currency: 'usd',
payment_method_types: ['card'],
application_fee_amount: 300, // $3.00 application fee
transfer_data: {
destination: 'acct_1Example1234Destination', // Connected account ID
},
}); and I need to get the transfer data, that sent money to the.connected account's balance

small locust
#

transfer ID is only present in Charge object. It's either your system expand the latest_charge from Payment Intent object to get the transfer ID, or check transfer directly from Charge object

ashen drum
#

Ok, will charge.succeeded also return payment intent id?

small locust
#

For charge.succeeded event, it'll be a Charge object which you can check the transfer directly.

Or after receiving payment_intent.succeeded event, an additional retrieval request to Charge Retrieval to get the transfer information

ashen drum
#

how can we connect charge to a payment intent

small locust
ashen drum
#

Ok, great, last question, when I call stripe.balanceTransactions.list and pass payout id, it'll return this transfer as well, correct?

small locust
#

Can you share what you're trying to achieve here, i.e. what kind of information you're looking for?

ashen drum
#

I'm trying to get all payments included in a specific payout

{
  type: "payment",
payoutId
}, {
  stripeAccount: "acct_XXXXX"
}
)
#

I wanted to know if transfers created by destination charge are also included in the balance transaction list response

small locust
ashen drum
#

Yes, for const balanceTransactions = await stripe.balanceTransactions.list( { payout: po_test', type: 'payment', expand: ['data.source.source_transfer.source_transaction'], }, { stripeAccount: 'acct_test', } );

#

Does it also include 'payment' that were created as a result of destination charge?

small locust
#

Yes

ashen drum
#

Ok, thank you

small locust
#

No problem! Happy to help ๐Ÿ˜„