#krishna-awate_subscription-fees

1 messages ยท Page 1 of 1 (latest)

devout onyxBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1292850723888824452

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

sharp ember
#

Hi ๐Ÿ‘‹

After making the payment the fee is shown in the Balance Transaction object that is created:
https://docs.stripe.com/api/balance_transactions/object#balance_transaction_object-fee

For Subscriptions, you get to that object by:

You can leverage expand to get all of those in objects returned inline in a single request:
https://docs.stripe.com/api/expanding_objects

tacit lance
#

When I

subscription = await stripe.subscriptions.retrieve(stripe_sub_id, {
stripeAccount: bank_info.stripe_account_id,
});

I get latest_invoice = 'in_1Q7HWODBfYojrB0Wqqs0lbVc'

can I expand that one?

sharp ember
#

Yup

tacit lance
#

Hwo can I expand that one?

sharp ember
#

Did you take a look at the instructions we provide for using expand? If you're retrieving a Subscription and want to expand down to the Balance Transaction of the latest Invoice, you'd use expand and pass it latest_invoice.payment_intent.latest_charge.balance_transaction

tacit lance
#

const subscription = await stripe.subscriptions.retrieve(
stripe_sub_id,
{
expand: ["latest_invoice.payment_intent.latest_charge.balance_transaction"],
},
{
stripeAccount: bank_info.stripe_account_id,
}
);

#

Let me check response for it.

devout onyxBOT
#

krishna-awate_subscription-fees

tacit lance
#

Is it $ 3.20

sharp ember
#

Yup

devout onyxBOT
tacit lance
#

Okay sir. I got it

#

Thank you so much for your help

#

Have a nice day to you.