#maria795

1 messages · Page 1 of 1 (latest)

cinder sageBOT
sand lantern
#

Hey there

#

You are looking to update a Subscription, correct?

terse ingot
#

YES

#

yes*

sand lantern
terse ingot
#

I want to change a product that the customer purchases to a subscription, leaving all the billing information the same.

sand lantern
terse ingot
#

It doesn't work for me passing another product id neither through that endpoint (https://stripe.com/docs/api/subscriptions/update) nor through https://stripe.com/docs/api/subscription_items/update

#

$subscriptionItems = $this->stripe->subscriptionItems->update(
$id, [
'plan' => ['product' => 'prod_MqHJjCuMXByLxl'],
'price' => ['product' => 'prod_MqHJjCuMXByLxl']
]
);

#

{
"success": false,
"error": {
"code": "You may only specify one of these parameters: plan, price.",
"message": "You may only specify one of these parameters: plan, price."
}
}

sand lantern
#

There are some example code snippets there

#

But basically you need to retrieve the Subscription item ID

#

And set that as the items.id

terse ingot
#

Can I send the product id here?

#

Is it all to update the product?

sand lantern
#

You send the Price ID that is related to the Product that you want to change to

terse ingot
#

I'll try

terse ingot
#

Thank you! It worked!