#ibgoldbergs
1 messages · Page 1 of 1 (latest)
yeah let me look
{"errors":[{"title":"Internal Error","detail":"Currency and interval fields must match across all plans on this subscription. Found mismatch in interval field."}],"stack":["Error: Currency and interval fields must match across all plans on this subscription. Found mismatch in interval field."," at Function.generate (/var/task/node_modules/stripe/lib/Error.js:40:16)"," at res.toJSON.then.StripeAPIError.message (/var/task/node_modules/stripe/lib/StripeResource.js:220:35)"," at processTicksAndRejections (node:internal/process/task_queues:96:5)"]}
Do you see a failed request in your Dashboard at: https://dashboard.stripe.com/logs ?
i dont
oh nvm
req_44gBKdcj80pVPH
{
"error": {
"message": "Currency and interval fields must match across all plans on this subscription. Found mismatch in interval field.",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_44gBKdcj80pVPH?t=1676656983",
"type": "invalid_request_error"
}
}
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Thanks looking
Ah okay
So what you are actually doing here is adding on a Price
You need to pass the Subscription item ID as well to replace it
So that's why you see interval mismatch right now
You are trying to preview having a monthly and yearly price
but i am passing the subscription id
see:
the original price lives in [0] so we are just replacing that with the new price point
Yeah this is a common confusion of how updating Prices works with Subscriptions
You have to provide the Subscription item ID
Not just the Subscription ID
So for that Sub you are trying to preview, the Subscription Item is si_NNIlboolPAiKun
okay so... it should look more like this:
{
"subscription": "sub_1MUVJtFNVbYFceRMG4m8GS4l",
"subscription_proration_behavior": "always_invoice",
"coupon": "100OFFLTD",
"subscription_items": {
"0": {
"price": "price_1IEJiNFNVbYFceRMExVoQTiJ",
"id": "sub_1MUVJtFNVbYFceRMG4m8GS4l"
}
}
}
is that right?
Close
You don't pass the Subscription ID to subscription_items
You pass the Subscription Item ID
When you retrieve your Subscription it will have a list of Subscription Items
So it would be like ```subscription_items": {
"0": {
"price": "price_1IEJiNFNVbYFceRMExVoQTiJ",
"id": "sub.items.data[0].id"
}
}
If you initialized your Subscription as a sub variable that is
got it i think that makes sense
i wonder what the linking was around that
seems a bit complex
Yeah it is a bit nuanced for sure
i appreciate the guidance