#krishna-awate_subscription-fees
1 messages ยท Page 1 of 1 (latest)
๐ 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.
- krishna-awate_fees, 42 minutes ago, 59 messages
- krishna-awate_api, 6 hours ago, 4 messages
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:
- Finding the Invoice you want to look at the fee for and find it's related Payment Intent
https://docs.stripe.com/api/invoices/object#invoice_object-payment_intent - Find the Charge associated with that Payment Intent
https://docs.stripe.com/api/payment_intents/object#payment_intent_object-latest_charge - Then get the Balance Transaction for that Charge
https://docs.stripe.com/api/charges/object#charge_object-balance_transaction
You can leverage expand to get all of those in objects returned inline in a single request:
https://docs.stripe.com/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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?
Yup
Hwo can I expand that one?
You can find expandable fields via our API ref, they'll be flagged as expandable. For instance that tag is beside latest_invoice
https://docs.stripe.com/api/subscriptions/object#subscription_object-latest_invoice
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
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.
krishna-awate_subscription-fees
Is it $ 3.20
Yup