#bwurtz999-account-support
1 messages · Page 1 of 1 (latest)
bwurtz999-account-support
@lunar turret :question: Have a non-technical question, account issue, or need one-on-one support? We wish we could help, but this community is focused on developers and technical discussions. Our support team will be able to assist you better than we can: https://support.stripe.com/contact
Ok... well then is there a way I can find the fee_xxx from the finalized invoice?
Through the API?
I need to record the collected fee ID, the amount, and the address info so I can create a tax report
I see the application_fee_amount but I don't see anything for the fee
Yep, you can look at the Balance Transaction to retrieve the fees: https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-fee applies to the charge.
So I would use the payment_intent to find the charge? And then can I look up a balance transaction by using the source? The docs make it look like I can only find a balance transaction with an ID
For every transaction, you get a Balance Transaction object: https://stripe.com/docs/reports/balance-transaction-types. You can use the List all balance transactions API, https://stripe.com/docs/api/balance_transactions/list and filter it by type: https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-type to attain this data without having an object id.
If you have the Payment Intent id, you can use the expand function, https://stripe.com/docs/expand to expand the 'latest_charge.balance_transaction': https://stripe.com/docs/expand/use-cases#stripe-fee-for-payment and attain the fees that way.
Got it ok thank you
I will give this a shot
@sharp venture When I try what is described in the docs I get an error. I don't have a charges object
*I don't have a charges object even when I use expand
Yea that payment intent hasn't been confirmed yet, there's been no payment yet
try using a succeeded payment intent for inspecting this
(or complete the one you shared)
It's still requires_payment_method
Yes yes
And therefore it doesn't have a charge
got it
thank you
I will try it on a completed payment
@sharp venture I'm not sure if there is a typo in the docs or if maybe I'm using a different API version
But I can find the fee details
But it's in an object called latest_charge
Not charges
I'm using this link as a reference
Oh it's not markdown haha
Yep that's normal, the doc notes both
Users on API version 2022-08-01 or older: ...
No I see that
I think the issue is here
$feeDetails = $paymentIntent->charges->data[0]->balance_transaction->fee_details;
That stays the same for both
And there is no charges object
if you're using 2022-11-15+ yes, there is no longer charges https://stripe.com/docs/upgrades#2022-11-15
Which language snippet are you looking at?
PHP
The top snippet for me shows latest_charge for all languages
yes
ok, sorry, i'm misunderstanding then
But I'm saying I think there is a typo in the $feeDetails line
charges does not exist
it's latest_charge
yes line 10
that should be updated, thanks for telling us 🙂
quite welcome!