#ibgoldbergs

1 messages · Page 1 of 1 (latest)

vale acornBOT
acoustic pulsar
#

Hi there

#

Can you provide a request ID for this error?

frozen epoch
#

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)"]}

acoustic pulsar
frozen epoch
#

i dont

#

oh nvm

#

req_44gBKdcj80pVPH

acoustic pulsar
#

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

frozen epoch
#

but i am passing the subscription id

#

the original price lives in [0] so we are just replacing that with the new price point

acoustic pulsar
#

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

frozen epoch
#

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?

acoustic pulsar
#

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

frozen epoch
#

got it i think that makes sense

#

i wonder what the linking was around that

#

seems a bit complex

acoustic pulsar
#

Yeah it is a bit nuanced for sure

frozen epoch
#

i appreciate the guidance