#idhruv-sub-schedule
1 messages ยท Page 1 of 1 (latest)
thanks
Please follow the 5 steps solution proposed by the mod before in that thread, that is what i am trying to follow
actually latest_invoice property lives on the subscription object and not on the schedule object
https://stripe.com/docs/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.
you can expand the subscription property on the schedule and look at subscription_schedule.subscription.latest_invoice
or you can just get the subscription ID from subscription_schedule.subscription and look up latest_invoice
i just get this in return:
{ subscriptionSchedule: { id: 'sub_sched_1LfNrzGdNldKu1zmu0Smakem', object: 'subscription_schedule', application: null, canceled_at: null, completed_at: null, created: 1662555643, current_phase: { end_date: 1670351400, start_date: 1662489000 }, customer: 'cus_MLtD4v7ngE4tw6', default_settings: { application_fee_percent: 11.9, automatic_tax: [Object], billing_cycle_anchor: 'automatic', billing_thresholds: null, collection_method: 'charge_automatically', default_payment_method: null, default_source: null, description: null, invoice_settings: null, transfer_data: [Object] }, end_behavior: 'release', livemode: false, metadata: { bookingId: '63189361f1be6e76008b8be4' }, phases: [ [Object] ], released_at: null, released_subscription: null, renewal_interval: null, status: 'active', subscription: 'sub_1LfNrzGdNldKu1zmxwcKZpaC', test_clock: null }
so another stripe api call then using subSchedule.subscription?
also the invoice on stripe dashboard still shows in 'draft' mode, so not sure again if I can finalize this even using subscriptionId as proposed above
so another stripe api call then using subSchedule.subscription?
yeah that's correct.
also the invoice on stripe dashboard still shows in 'draft' mode, so not sure again if I can finalize this even using subscriptionId as proposed above
you can
okay, can you please link me exactly which api call i can make here to get invoice using subscription id?
all I see on the documents page are the ones that use only invoice id to get invoices
when you retrieve a subscription, it should have a latest_invoice property
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
got it! thanks