#KarlS
1 messages · Page 1 of 1 (latest)
That would be the source right? Doc says it is expandable https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-source
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hm.. yes, the source item.
Api refers to it as a BalanceTransaction.
Given this Txn: txn_3JNIxqG30Vl6ne6N15BlSloo
Specifically, what do I expand to see that the balance transaction was refunded?
You will want to look up the charge from the balance transaction's source field
That will have the refunded amount and a list of related refund objects if applicable
ok.. but can i expand charges when I request the balance transaction?
IIRC there should only be one charge
It should be in the source field, unless I am mistaken. Do you have a balance transaction with multiple charges?
OK, but can I expand the balance transaction when I fetch it?
Yes, you can perform expansion while retrieving a balance transaction
Not that I know of. I'm looking at what is returned from getting a balance transaction and wondering if can expand the charges.
*the charge
Ahh, ok. So this is where I have an issue with the documentation.
I think it would look something like this var service = new BalanceTransactionService(); var options = BalanceTrasactionGetOptions(); options.AddExpand("source"); service.Get("txn_1JK4FlJmquaq3Lbpx6HxSXMT");
It is unclear to me exactly what string name I pass to expand the charge. I don't see it documented.
hm... i was doing this.
var expands = new List<string>();
expands.Add("charge");
Ah I see. Yes, a balance transaction isn't always related to a charge, it can be related to many kinds of objects so the id will go in to the source field.
testing "sourec" as option for expand.
ok! source works as the expanded name item. Can you show me in the documentation where I would know to pass "source" as the expand option? That is unclear to me.
For me it was the description of the source property and the note that it is expandable: https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-source
Or do you mean the part on expansion in general?
I see (just trying to understand) looking
So here: https://stripe.com/docs/api/refunds
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I can see that the charge is "expandable" so then I should be able to add "charge" to my expandable list when I call to fetch a refund object and it would then expand charge details.
If that it is, then I understand!
*is it
Correct, that is exactly what the doc means there
thank you for clarifying. Have a good rest of your day!