#leman_api
1 messages ยท Page 1 of 1 (latest)
๐ 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.
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can it be done by listening to a webhook event?
Yes! transfer ID will be present in charge.succeeded event
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
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
Ok, will charge.succeeded also return payment intent id?
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
how can we connect charge to a payment intent
In the Charge object, you will be able to find payment_intent as well: https://docs.stripe.com/api/charges/object#charge_object-payment_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok, great, last question, when I call stripe.balanceTransactions.list and pass payout id, it'll return this transfer as well, correct?
Can you share what you're trying to achieve here, i.e. what kind of information you're looking for?
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
I'd recommend checking the guide here about the getting the payments in a payout: https://docs.stripe.com/expand/use-cases#charges-in-payout
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?
Yes
Ok, thank you
No problem! Happy to help ๐