#Juni-subs
1 messages · Page 1 of 1 (latest)
For example, if they purchased 3 tier 1 tokens and they want to upgrade one of those tokens to a tier 2 token, the new subscription would need to be 2 tier 1 tokens + 1 tier 2 token.
But the retrieveUpcoming endpoint doesn't allow me to add that extra tier 1 token. Why is this?
Would I need to programmatically create a new subscription for them? If so how can I accurately get the total cost of the prorated changes?
Hello! give me a minute to catch up with everything and I'll help you as soon as i can!
Do you have the request ID of the failed request?
I just made one - req_XuZCEaGUgvywnh
The error message I get is StripeInvalidRequestError: No subscription item with this ID (prod_JiGY9JFimI6HfA) on the subscription.
These are the two items I try to preview the invoice with
[
{
id: 'si_KgFDqOtpSRM0dk',
price: 'price_1J4pxbEzwzb413li8PgCJl9N',
quantity: 0
},
{
id: 'prod_JiGY9JFimI6HfA',
price: 'price_1JfIwkEzwzb413liAhlPwfQT',
quantity: 1
}
]
Wait a minute
I think I see the issue, is si_ stripe invoice?
Could it be that I'm using a stripe invoice id instead of a product ID?
Ah I se the issue - so instead of
{
id: 'prod_JiGY9JFimI6HfA',
price: 'price_1JfIwkEzwzb413liAhlPwfQT',
quantity: 1
}
you should just do
{
price: 'price_1JfIwkEzwzb413liAhlPwfQT',
quantity: 1
}
Oh ok, let me try that
Ok so that fixed the original error, but now I'm getting this error:
Cannot add multiple subscription items with the same plan: price_1J4pxbEzwzb413li8PgCJl9N
With this set of items:
[
{ price: 'price_1J4pxbEzwzb413li8PgCJl9N', quantity: 0 },
{ price: 'price_1JfIwkEzwzb413liAhlPwfQT', quantity: 1 }
]
I found this solution, but I'm not using Stripe.subscriptions.modify yet. I'm only using the Stripe.invoices.retrieveUpcoming. Does this still apply? https://stackoverflow.com/questions/61967415/issues-with-changin-updating-stripe-subscription-django
Ah Sorry I should've been clearer - you should only remove id for the second subscription item, not the first one
So the full thing should look like this:
[
{
id: 'si_KgFDqOtpSRM0dk',
price: 'price_1J4pxbEzwzb413li8PgCJl9N',
quantity: 0
},
{
price: 'price_1JfIwkEzwzb413liAhlPwfQT',
quantity: 1
}
]