#nacho_446

1 messages · Page 1 of 1 (latest)

zealous questBOT
upper skiff
#

Hello! That product (prod_OkFwOttW2bTFpZ) was originally created by setting price_data.product_data when creating a Checkout Session. When you create a price/product that way it's only meant for one-time use (so we archive the product immediately after the Checkout session is successful

#

If you want to use the product repeatedly you need to create it separately, not as part of the Checkout Session creation

warm mulch
#

So what do I do now if I want to update a subscription the user is on

#

Updating the price or the interval

upper skiff
#

You'd need to create a new Product (either through the API or the dashboard) and then use that in your update request w/ price_data

warm mulch
#

Hmm this I implemented was he help I got today from your support showing me the upgrade-downgrade docs

#

If I do something like this ?

items: [
{
id: '{{SUB_ITEM_ID}}',
deleted: true,
},
{
price: '{{NEW_PRICE_ID}}',
},
],

upper skiff
#

Sorry let me be a bit more clear - the smallest change you'd need to make is just change the Product ID you pass in to your update request. Right now you're passing in a Product ID that's already been archived. If you create a new Product (through the API or dashboard) and pass that in instead your request should succeed

#

You don't need to switch how you're doing the upgrade/downgrade, it's just about the specific product you're using

warm mulch
#

Is there a docs on that

#

I don’t really know about creating a product and all

upper skiff
warm mulch
#

Doing it like this what about the prorate

upper skiff
#

Is there something specific you're worried about? Prorations should work fine when using a different product - if you try it out you can see how it works

warm mulch
#

Do I have to take the user to a page to pay ?

#

Or it still retains the old details

#

What webhook do I listen too for this

upper skiff
#

If the Subscription has default_payment_method or the Customer has invoice_settings.default_payment_method then payments will be attempted automatically using that payment method (you wouldn't need to take the user to a page to pay)

#

Can you be more specific about your question - you asked what webhook, but you didn't give specifics about what situation you're trying to listen for

warm mulch
#

What event because it changes the productID and I want to inform the user by creating a transaction saying the upgrade is successful

upper skiff
warm mulch
#

Can I set metadata on the update ?

#

Like update the old value that use there

upper skiff
#

The metadata of the Subscription? Yup! You should be able to update that - you can test all of this out in the API

warm mulch
#

Yea the api works I can see the returned data are different for the price and interval

#

Can I used that same event to check for when I receive recurring payments? Customer.subscription.updated

upper skiff
#

It'd be better to listen for invoice.paid instead - the customer.subscription.updated event wouldn't tell you specifically when payment was successful or not