#voidmonk_api

1 messages ยท Page 1 of 1 (latest)

old templeBOT
#

๐Ÿ‘‹ 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.

harsh widget
#

Hello! You can request additional information from the Invoice object by using the expand parameter

somber island
#

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.

azure holly
#

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

somber island
#

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

azure holly
#

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?

somber island
#

let me check

#

that might work to get charge, is there something to expand for getting invoice proration (boolean) and plan interval (string)?

azure holly
#

lines.data.pricing.price_details has the Price information with the interval, right?

#

Not sure about Invoice Proration. we are looking closer into it

somber island
#

Yes, you're right about plan iterval in pricing. That just leaves proration, which seems to be in InvoiceItem now

harsh widget
#

It should already be there actually, under lines.data.parent.subscription_items_details.proration

somber island
#

yes it is there in lines parent. thank you!

somber island
harsh widget
#

how about trying parent.subscription_details.subscription, under the Subscription object, it will have the full Price object details

somber island
#

that will work. cheers ๐Ÿ™‚

somber island
#

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?

harsh widget
#

Could you share the JSON file content that you are using

somber island
#

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?"

harsh widget
#

Do give me a while, testing this out on my end

harsh widget
#

Hello, actually this fixture might be what you are looking for

#

It would lead to a invoice.paid event with relevant fields

#

I would recommend fixtures over overriding on the CLI, it gives more flexibility and easy customisation