#voidmonk_api
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/1415539784734212136
๐ 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.
- voidmonk_webhooks, 19 hours ago, 13 messages
- voidmonk_api, 23 hours ago, 17 messages
Hello! You can request additional information from the Invoice object by using the expand parameter
I mainly need the ChargeId, Proration status and Plan interval for a given invoice, but it doesn't look like these are available as standalone or expandable.
Charge is inside PaymentIntent
You will need to find the PaymentIntent first from the Invoice. Do you have it? Or your API version already exlcuded it?
payments.data.payment.charge
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thanks, yes that's what I'm trying. In the webook event, I have to again call InvoiceService.Get() or new InvoicePaymentService().List(...); to get the payment.charge, and then further calls to InvoiceItemService (for Proration status) and PriceService (for Plan interval), so I was wonderig is there's a better way than making 3-4 additional calls in a webhook, where-as earlier it was all inside the invoice object
I am trying to find a way to help you get all of them within one Retrieve Invoice API.
So if you call Retrieve Invoice API and expand payments.data.payment.charge do you see the Charge?
also expand lines.data.pricing.price_details.price would you see the interval?
I am referencing to "expanding resource". See https://docs.stripe.com/expand
let me check
that might work to get charge, is there something to expand for getting invoice proration (boolean) and plan interval (string)?
lines.data.pricing.price_details has the Price information with the interval, right?
Not sure about Invoice Proration. we are looking closer into it
Yes, you're right about plan iterval in pricing. That just leaves proration, which seems to be in InvoiceItem now
It should already be there actually, under lines.data.parent.subscription_items_details.proration
yes it is there in lines parent. thank you!
seems like lines.data.pricing.price_details has the Price id only, no information with the interval
how about trying parent.subscription_details.subscription, under the Subscription object, it will have the full Price object details
that will work. cheers ๐
Just another question around webhook testing. I'm try to mock a invoice.paid webhook using a modified fixture (with existing customer and payment method), like stripe fixtures mock.invoice.paid.json --api-version 2025-08-27.basil. It works but invoice subscription is empty/null. Anyway to mock for an existing customer subscription?
Could you share the JSON file content that you are using
JSON file wasn't working, but I made progress with overriding defaults:
stripe trigger invoice.paid --override invoice:customer=cus_... --override invoice_pay:payment_method=pm_... --remove invoice:pending_invoice_items_behavior --override invoice:subscription=sub_... --override invoice:"subscription:items[0][price]"=price_... --api-version 2025-08-27.basil
everything is attached except subscription price (without it the invoice is $0)
so mainly this is not working --override invoice:"subscription:items[0][price]"=price_... and gives an error "Received unknown parameter: subscription:items. Did you mean subscription?"
Do give me a while, testing this out on my end