#.drama.llama.
1 messages ยท Page 1 of 1 (latest)
You can keep existing customers on plans if you like
And just make it so new customers use your new prices
But we actually updated our prices and to do this we created new prices.
So now I am thinking better to just have them all on new price
Ah I see. In that case, you'll need to make some Update subscription calls. This doc is pretty much what you'll need to do: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade. Since the amounts are changing, this is considered an upgrade
This looks good to me. Only thing I don't fully understand is what is SUB_ITEM_ID
is that my old plan_xxxx ?
Just curious to why you call one subscription item and the other price
Subscription items have a price. They're not the same thing
Can you share the id of an existing subscription you have that uses a plan?
Just so I can see its structure
yes!
sub_G0bkYAwJngTpv4
So I am just looking at that now. I see it has both plan and price
both plan and price is set to plan_xxxx id
As far as I can see I don't really want to use plan at all any more?
From what I understand price has now fully taken over?
Yeah price is the plan replacement
I haven't actually tested switching a sub from a plan to a price, so recommend you try this in test mode first
But you should be able to pass the subscription item id and then just pass the new price id
phew that seemed to work, 30 min before next invoice going out ๐
Now I just need a list of all customers and their subscriptions. So I can update items
Got any tips?
๐ you can list all customers using the List all Customers endpoint
https://stripe.com/docs/api/customers/list
Then you can iterate through the list and list all their subscriptions by passing in individual customer IDs
https://stripe.com/docs/api/subscriptions/list
can the customer list list all or do I need to paginate. I see a has_more=true in the response
You can list upto 100 customers by setting limit parameter but I'd recommend paginating instead.
As listing 100 objects at a time might have performance penalty
Could also cause rate limit issues
so no way to only get list of all cus_xxx
We only have about 500 customers and I only really need the cus_xxx for each to then look up SubscriptionItem
Ah yeah, no. The returned list will have the customer objects (not just the IDs)
alright, thanks!