#nick-bt-fees
1 messages ยท Page 1 of 1 (latest)
Hello! 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.
Another question. When you iterate on https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-fee_details, is chargeback fee included in type stripe_fee ?
๐ Hello! Hopping in since codename_duchess has to head out soon
I don't know the answer off the top of my head, but let me see if I can find an example and figure it out from there
Thanks
And also; does the stripe fee change on the charge's original balance transaction when there is a chargeback?
The original balance transaction shouldn't change as far as I know
Its net does in case of refunds though
No wait I think I'm wrong
uhm
So which balance transaction do I have to read in order to determine the actual net?
I'm guessing a dispute is not on the charge.refunds array
I have to read charge.disputed and then use the list endpoint for disputes with charge ID as filter, then get that dispute's balance transaction?
ah no charge has charge.dispute
At least according to the PHP phpdocs, but it's not on here: https://stripe.com/docs/api/charges/object ?
only boolean here
I just tested with an actual object and it definitely has dispute
So the docs are wrong
or incomplete
3 flags in one day
bug bounty pls
๐ฅฒ
Anyway back to the question: I have to fetch/expand this dispute object and read its balance transaction, yes?
Yup!
This also answers my first question:
"fee_details": [
{
"amount": 20000,
"application": null,
"currency": "dkk",
"description": "Dispute fee",
"type": "stripe_fee"
}
],
it is stripe_fee
So now my question is only what happens if the dispute is won, and I can't test that because it never happened
You'd get another balance transaction representing that - and I think whether or not the dispute fee is returned depends on region
Yeah but I'm just going to code it independent from region and look at all the balance transaction objects then
๐
Am I correct to assume that all I will see on dispute.balance_transactions is an array of balance_transactions with only stripe_fee that's either negative or positive?
positive being fee, negative being fee refunded
Yes, for the initial dispute you'd see a BT with a negative amount a positive fee (from a stripe_fee) and a negative net amount.
For the dispute reversal you'd get the additional BT for a postive amount, a negative fee (another stree fee returning the original dispute fee), and a postive net
alright
It if helps, here's what the fee details look like on the chargeback reversal BT from my own test account
"fee_details": [
{
"amount": -1500,
"application": null,
"currency": "usd",
"description": "Dispute fee refund",
"type": "stripe_fee"
}
],
Alright, so this looks correct to me
(and yes the dispute is expanded on the charge)
You could likely simplify things a bit by just looking at the top-level fee on the BT instead of digging deeper into the fee_details hash, but what you have should work!
Yeah I suppose if I only ever see stripe fees in the details anyway
The same logic could not be applied to a regular charge because of application fees
right
so this should be good then
(it needs a bit of a cleanup though)
and I guess a break in the first loop if stripe fee found
Uh no this won't work, the amount on the balance transaction is -62400, not 20000, because it actually refunds the charge itself also
so I have to use balance_transaction.fee , not .amount
I guess that's also what you said
It's all good. I got it. Thanks for your help.
๐
sorry i'm not a great second pair of eyes on this - but if you have any more specific questions about the disputes just let me know!
It's fine, sometimes rubberducking is also great
Can you help me locate a charge that has a refunded application fee? I can't figure out how to find this
I know I have a few, but they're very rare
I need it because apparently there is application_fee_refund as a fee type, so I don't know if I need to find that or the regular application_fee when calculating refunded application fees
refunded stripe fees are just negative stripe_fee
I took a look real quick at the account from the dispute ID you shared earlier in a screenshot, but I couldn't find one quickly. You may have more luck asking https://support.stripe.com/contact if you need to find a specific example from your own account that has an application fee refund
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
If I do that they will tell me they will get back to me via email in 24-48 hours, and I can't wait for that. Cna you check account acct_17xDxxL7ilRdQXxE perhaps?
The other account is a connected one, not the platform, so it wouldn't have any application fees at all
Aha! That helps a lot
Or if you know the answer to the application_fee type question that's also fine
This way I can just verify myself
fee_1Fyy7EFWAZD7P9ECuTMW6Xdg (associated with ch_1Fyy7DFWAZD7P9ECrllPQvJx) is one that should have a refund
Thank
s
Which account is ch_1Fyy7DFWAZD7P9ECrllPQvJx ?
just the ID
If you can share that here
nvm I got it
uh no I dont, it's not in my database
rip
is it for a subscription?
I need the account ID to be able to fetch it from the API of course
It's for acct_18yL2tFWAZD7P9EC, and yes, it's for a subscriptoin
that explains it
thanks I'll have a look at it
All I see in refunds there is the refunded stripe fee
the application fee is not in there as refunded
When you retrieve the application fee what do you get in the response?
I'm just retrieving the charge -> refunds and I would expect those to contain a refunded application fee type
but you're saying the fee itself has the balance transaction for that?
yeah so the application fee itself has a refund array with the balance transaction
alright, so I know what to do now, however that type is fee_refund, not application_fee_refund which is slightly confusing
It's very counter-intuitive that the charge -> refunds -> balance transaction has a negative stripe fee but no negative application fee
I would expect a negative application_fee here, or a positive application_fee_refund
Yeah, I know it's all a bit convoluted - it's been a while since I've look at all these fees in details and even I'm surprised by some of it
I can't even find application_fee_refund anywhere
I have positive application_fee in charge.balance_transaction.fee_detailsand positive fee_refund inside application_fee.refunds
So my plan is now to only find stripe fees inside charge.balance_transaction and use charge.application_fee.amount - charge.application_fee.amount_refunded to determine the net application fee