#Alex from Fuxam
1 messages ยท Page 1 of 1 (latest)
Can you print out the entire contents of invoice.lines.data to see if there are more items?
[ { id: 'il_tmp_180a2aEwHpTUe8W760307f72', object: 'line_item', amount: 3300000, amount_excluding_tax: 3300000, currency: 'eur', description: '500 ร Fuxam Premium Plan M (at โฌ66.00 / year)', discount_amounts: [], discountable: true, discounts: [], livemode: false, metadata: { institutionId: 'clhg9j23a00003b6y1anyenjj', userId: 'user_2OJpzlT54O47yF6tPUeuoiMhmOJ' }, period: { end: 1720446444, start: 1688824044 }, plan: { id: 'price_1NFxtaEwHpTUe8W7EIOsYHth', object: 'plan', active: true, aggregate_usage: null, amount: 6600, amount_decimal: '6600', billing_scheme: 'per_unit', created: 1686050270, currency: 'eur', interval: 'year', interval_count: 1, livemode: false, metadata: {}, nickname: null, product: 'prod_O21xmoWtq3RnlT', tiers_mode: null, transform_usage: null, trial_period_days: null, usage_type: 'licensed' }, price: { id: 'price_1NFxtaEwHpTUe8W7EIOsYHth', object: 'price', active: true, billing_scheme: 'per_unit', created: 1686050270, currency: 'eur', custom_unit_amount: null, livemode: false, lookup_key: null, metadata: {}, nickname: null, product: 'prod_O21xmoWtq3RnlT', recurring: [Object], tax_behavior: 'unspecified', tiers_mode: null, transform_quantity: null, type: 'recurring', unit_amount: 6600, unit_amount_decimal: '6600' }, proration: false, proration_details: { credited_items: null }, quantity: 500, subscription: 'sub_1NGjBQEwHpTUe8W7Sh0HtSD5', subscription_item: 'si_O2qAljEu6ou032', tax_amounts: [ [Object] ], tax_rates: [], type: 'subscription', unit_amount_excluding_tax: '6600' } ]
Loooks like this
Ok in your code right before calling await stripe.invoices.retrieveUpcoming (and right after defining const items = [{) can you print out items[0].quantity and items[0].price to ensure they match what you are intending to pass in
Yes I did that and they are correct
Hm ok. Can you send the request id then? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
๐ I'm also hopping in to take a look
Hi, appreciate your help ๐
I think part of the issue here is that this subscription has a subscription schedule associated with it - out of curiousity, what happens when you make the request with proration_behavior: create_prorations set?
That makes sense with the schedule. Unfortunately, I need the preview to let the users decide if they want to make an upgrade. Once they've made the upgrade I add the schedule to their subscription, so thats why this subscription already has a schedule. Is there no other way I could previeew this?
In hte image I tried upgrading from 500 to 600 btw. It creates the proration for the month but then goes back to the original quantity in the next month.
Unfortunately, I think the only way to get this to work would be to either:
- Remove the schedule from the subscriptio before calling retrieve upcoming invoice
- Or update the schedule itself to reflect the update
- Calculate the upcoming invoice yourself
I know those aren't great options - it's unfortunately just the current state of things that the upcoming invoices API doesn't work that nicely with schedules