#tibbian-ACH
1 messages ยท Page 1 of 1 (latest)
of course, I hope this is a fun one to crack, if the dashboard can do it then surely the API can too!
Huh yeah I actually don't think we return this via the API, which I admit I'm a bit surprised by.
It may be one of the gaps in our legacy ACH flow
where is the dashboard looking? I'm willing to hit up another endpoint, it doesn't have to be available through the charges API or anything like that
The Dashboard doesn't use the same codebase as the API
So it isn't necessarily compatible
There are certain Dashboard-only features
Like I said, I wouldn't expect this to be one. I would think we would update the balance transaction
To reflect the proper fee amount
I'll file feedback internally about this
But I don't see a way to surface it currently. The fee will always be associated with the balance transaction.
that is surprising, thank you for filing the feedback, I guess in the meantime I know that failed ACH charges will be rounded up to a $4 fee
P.S. I thought I had just found it with https://api.stripe.com/v1/balance_transactions?source=py_1Krd7sA74xMpD4hDpZdjYPrf, but even this only returns the $0.12 fee balance transaction, I was hoping to find a second one
@acoustic owl can you do me a favor and retrieve txn_1KshnpA74xMpD4hDsNP4h9Ui
I think that is the balance transaction of the failure
And I am curious what the fees show in that
๐
how'd you find it? This indeed looks like what I was after
{
"id": "txn_1KshnpA74xMpD4hDsNP4h9Ui",
"object": "balance_transaction",
"amount": -1450,
"available_on": 1651536000,
"created": 1650954193,
"currency": "usd",
"description": "REFUND FOR FAILED PAYMENT (Account Funding)",
"exchange_rate": null,
"fee": 388,
"fee_details": [
{
"amount": 388,
"application": null,
"currency": "usd",
"description": "Stripe processing fees",
"type": "stripe_fee"
}
],
"net": -1838,
"reporting_category": "charge_failure",
"source": "pyr_1KshnpA74xMpD4hD2GZViqwP",
"status": "pending",
"type": "payment_failure_refund"
}
So you can grab every balance transaction ID if you export the "All transactions" tab of your Dashboard
So it looks like on the payment failure we actually pull the fee out of the payment refund when we reverse the transfer
Didn't realize that
This still isn't easy to grab via the API
But I think it is a weird edge case of fees with ACH + Destination charges
Interesting, is there a way to get pyr_1KshnpA74xMpD4hD2GZViqwP from py_1Krd7sA74xMpD4hDpZdjYPrf?
Yeah so you want the destination payment from the transfer: https://stripe.com/docs/api/transfers/object#transfer_object-destination_payment. Then the refunds.data[0].id: https://stripe.com/docs/api/charges/object#charge_object-refunds-data-id
Err sorry you already have the payment
So you just want the refund
But basically you would go OG charge --> transfer --> destination_payment --> refund
๐
Wait the balance_transaction you found is on the refund and there's the OG charge, right? But OG charge --> refunds is blank...
OG charge: py_1Krd7sA74xMpD4hDpZdjYPrf
refund: pyr_1KshnpA74xMpD4hD2GZViqwP
balance transaction with fee: txn_1KshnpA74xMpD4hDsNP4h9Ui
https://api.stripe.com/v1/refunds/pyr_1KshnpA74xMpD4hD2GZViqwP
{
"id": "pyr_1KshnpA74xMpD4hD2GZViqwP",
"object": "refund",
"amount": 1450,
"balance_transaction": "txn_1KshnpA74xMpD4hDsNP4h9Ui",
"charge": "py_1Krd7sA74xMpD4hDpZdjYPrf",
"created": 1650954193,
"currency": "usd",
"description": "Payment failure refund",
"metadata": {},
"payment_intent": null,
"reason": null,
"receipt_number": null,
"source_transfer_reversal": null,
"status": "pending",
"transfer_reversal": null
}
Hi ๐ I'm stepping in and it's really busy. Give me a minute to catch up
you guys should have stayed on IRC, much quieter there lol
Yeah but no threading, really hard to keep up
Oh wait
I misunderstood
I thought it was on the refund for the transfer
But that is actually just the refund on the platform
At this point we've boiled down the question to
"Interesting, is there a way to get pyr_1KshnpA74xMpD4hD2GZViqwP from py_1Krd7sA74xMpD4hDpZdjYPrf"
and that should be possible because I can see py_1Krd7sA74xMpD4hDpZdjYPrf as the charge on the pyr_1KshnpA74xMpD4hD2GZViqwP refund
yet the OG charge has no refunds in the response, what gives?
I think I found it!
What outputs when you retrieve py_1Krd7sA74xMpD4hDpZdjYPrf?
but check this out!
https://api.stripe.com/v1/refunds?charge=py_1Krd7sA74xMpD4hDpZdjYPrf
{
"object": "list",
"count": 1,
"data": [
{
"id": "pyr_1KshnpA74xMpD4hD2GZViqwP",
"object": "refund",
"amount": 1450,
"balance_transaction": "txn_1KshnpA74xMpD4hDsNP4h9Ui",
"charge": "py_1Krd7sA74xMpD4hDpZdjYPrf",
"created": 1650954193,
"currency": "usd",
"description": "Payment failure refund",
"metadata": {},
"payment_intent": null,
"reason": null,
"receipt_number": null,
"source_transfer_reversal": null,
"status": "pending",
"transfer_reversal": null
}
],
"has_more": false,
"url": "/v1/refunds"
}
Ohh you listed refunds for the charge
Smart!
Weird it doesn't just show up when retrieving the charge
...
I think that is likely the best workaround for now
I'll still file feedback
But that should get you there
thank you, yep all I have to do to see my fee is expand the balance transaction
https://api.stripe.com/v1/refunds?charge=py_1Krd7sA74xMpD4hDpZdjYPrf&expand[0]=data.balance_transaction
{
"object": "list",
"count": 1,
"data": [
{
"id": "pyr_1KshnpA74xMpD4hD2GZViqwP",
"object": "refund",
"amount": 1450,
"balance_transaction": {
"id": "txn_1KshnpA74xMpD4hDsNP4h9Ui",
"object": "balance_transaction",
"amount": -1450,
"available_on": 1651536000,
"created": 1650954193,
"currency": "usd",
"description": "REFUND FOR FAILED PAYMENT (Account Funding)",
"exchange_rate": null,
"fee": 388,
"fee_details": [
{
"amount": 388,
"application": null,
"currency": "usd",
"description": "Stripe processing fees",
"type": "stripe_fee"
}
],
"net": -1838,
"reporting_category": "charge_failure",
"source": "pyr_1KshnpA74xMpD4hD2GZViqwP",
"status": "pending",
"type": "payment_failure_refund"
},
"charge": "py_1Krd7sA74xMpD4hDpZdjYPrf",
"created": 1650954193,
"currency": "usd",
"description": "Payment failure refund",
"metadata": {},
"payment_intent": null,
"reason": null,
"receipt_number": null,
"source_transfer_reversal": null,
"status": "pending",
"transfer_reversal": null
}
],
"has_more": false,
"url": "/v1/refunds"
}
๐
thanks for your help! I really like it when computers make sense
๐