#paul.han
1 messages · Page 1 of 1 (latest)
Hello! Not sure I understand this part: "However, when I update a subscription price manually through the Stripe dashboard, a new price gets created that does not appear under the Product listing." Can you provide more details about that piece?
Thank you for responding! For example, if I update the price manually from this dashboard page: https://dashboard.stripe.com/test/connect/accounts/acct_1OL8mQR0OWdMn6Tk/subscriptions/sub_1OLDCaR0OWdMn6Tk6SIS1aGz
I do not see the price show up for the associated product on this page:
https://dashboard.stripe.com/test/connect/accounts/acct_1OL8mQR0OWdMn6Tk/products/prod_P9VfkgvxmYE9C9
For example, I just updated the subscription's price to 15.20. A price for 15.20 is not appearing on that product page
This is making me second-guess my API implementation where I create a new Price associated with the existing Product and then attach the Price to the subscription
When I do this via the API, the new Price shows up on the Product page
I can provide the ruby code I'm using to create the Price & update Subscription if that would be helpful
Can you show me a screenshot of exactly how you updated the Price? It sounds like you may have selected an existing Price to switch to instead of creating a new Price in the Dashboard.
sure!
the 22.20 I'm inputting manually in the text field, there is no dropdown to select existing price
Backing up a bit, can you tell me more about your use case? You said your clients want to update Subscription prices... are they updating to arbitrary amounts each time for each Subscription, or is the goal to get them to update to one of a limited number of preset amounts?
Occassionally they want to change the subscription's price for certain clients. I'm assuming to either provide a discount for some kind of referral or to prevent them from cancelling the subscription
That is, my connected accounts' client's subscriptions
Sorry, to answer your question more explicitly, they are updating to arbitrary prices
Okay, so instead of creating a new Price every time and then updating the Subscription with it you should probably use price_data instead to specify Price info inline during the Subscription update: https://stripe.com/docs/api/subscriptions/update#update_subscription-items-price_data
That still creates a Price behind the scenes, but if I recall correctly the Prices created by price_data won't clutter the Dashboard like the ones you explicitly create.
ah I see! thank you!
Does that mean I should null out the existing price field? example:
stripe_subscription.id,
{
proration_behavior: 'none',
items: [
{
id: stripe_subscription.items.data[0].id,
price: nil,
quantity: stripe_subscription.items.data[0].quantity,
price_data: price_data
}
]
},
{ stripe_account: stripe_merchant.stripe_account_id }
)```
No, you should omit price entirely.
price_data should replace it.
They're mutually exclusive.
got it! thank you so much