#jcu1012-stripe-fee

1 messages · Page 1 of 1 (latest)

peak oyster
#

Can you share the code you're calling now?

shadow scroll
#

/ Setup raw transactions value
const transactionsRaw = await stripe.balanceTransactions
.list({
expand: [
'data.source.balance_transaction',
'data.source.charge',
'data.source.customer',
'data.source.charge.customer'
],
limit: 100
})
.autoPagingToArray({ limit: 10000 })

// Setup list of fees
const fees = transactionsRaw.filter(
(transaction) => transaction.reporting_category === 'fee'
)

// Print in transaction
console.log(fees)

peak oyster
#

What is not in the response that you're expecting?

shadow scroll
#

Indeed, passing stripe_fee as type in the list endpoint simplifies the code. However, it doesn't solve the problem.

#

Here is an example of an item retrieved
{
id: 'txn_1JN0OoHS4I0tfsw4LpyJsyhd',
object: 'balance_transaction',
amount: -48,
available_on: 1628622846,
created: 1628622846,
currency: 'eur',
description: 'Billing (2021-08-08): Subscriptions',
exchange_rate: null,
fee: 0,
fee_details: [],
net: -48,
reporting_category: 'fee',
source: null,
status: 'available',
type: 'stripe_fee'
}
as you can notice, there is no information about the customer.

#

How should I get that information?

peak oyster
#

Ah, you can't get payments relating to Billing fees specifically as they're all grouped