#Th3FalleN
1 messages · Page 1 of 1 (latest)
Hello, to be clear, when you make that call now, are both the billing and card info updated?
actually....
as i was typing the answer to that i realized the answer to my question...
but! while i have you i do have one question about your invoice/preview endpoint if that's okay.
with this request, ```## Preview Subscription Change
curl "https://api.stripe.com/v1/invoices/upcoming?customer=cus_NCoLHnI1943fs7&subscription=sub_1MSR71KjI0M1O6BOjhHv9ncZ&subscription_items[0][price]=price_1MM0J2KjI0M1O6BOTBRw79Em&subscription_items[0][quantity]=2&subscription_items[1][price]=price_1MM0GxKjI0M1O6BOXNBegx8V&subscription_items[1][quantity]=2"
-H 'Content-Type: application/json'
-H 'Cookie: machine_identifier=hpQz47yZ9JbB%2FS0DTyrZ3thntW65aSc4vkkRM93l2LGXYhC5i4zG97laOfHc2CMorCY%3D; private_machine_identifier=NiR5604UpBgFgUwDeKI3SVOHDG5zXERbjz17Q4okfqNeZfqGRDPMSkLrS0h6giPXlDg%3D; cid=53f97f2b-c19a-4e0a-867b-951cda46c5e9; __stripe_orig_props=%7B%22referrer%22%3A%22%22%2C%22landing%22%3A%22https%3A%2F%2Fdashboard.stripe.com%2Ftest%2Flogs%2Freq_RqPKoCpTq8sAVC%3Ft%3D1674259622%22%7D; stripe.csrf=ylstyG5Dhnn8Oewfr7Sp06AnKIARkuzM1tQsZlIAtbbYdN_EPRIBVi-ozWzSTXQyUPyTffCZj6V-PSBZzIEKqTw-AYTZVJxzpJHo9G2tD0xlmJFMOBPfokkg7ElUJuNiYYcGbvJuBw%3D%3D'
-u 'sk_test_51Ln2NYKjI0M1O6BO66h4WipupzIV2zpw3MukNLTTh8i0f79K6YBOWKcDYJs7OFfek4iriqW4EIuqS3c9O9OFSgeD00npMj9YUY:null'
im getting cannot add multiple subscription items with the same plan?
Can you send me the request ID (req_123) from a time you got that error? If you just ran that you should be able to see it at https://dashboard.stripe.com/test/logs
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
req_RTzyJtO4ReFp62
Oh I see, so what is happening is that that subscription already has items of both of those prices
right, im trying to adjust the quantity of those items
When you pass in a subscription item to that update call, it tries to add that item to the subscription, rather than modifying existing ones
So you need to include the ID of the subscription items that already exist on that subscription
We show this in our docs but with changing prices https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#changing
You can do the same thing but just change the quantity
so how would i preview removing items from my subscription?
With our preview and upcoming invoice API?
It looks like there is a deleted property that you can pass in when making that call https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_items-deleted
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.