#ironbeard - update subscriptions
1 messages · Page 1 of 1 (latest)
I will have to test that myself. I would have thought we would error on that but if you have seen it in your testing then it sounds like I am wrong. Do you have the ID of a subscription that you updated like this?
Sorry, got called away with the baby one second I can provide that
sub_1LW3URCoTIfwbn285grgenqz
Yep seeing the same behavior on my end. So it looks like we don't explicitly check for that, I am guessing to allow putting the coupon on and then the price but not sure. Are you just checking that that is expected or are you looking in to how to prevent it as well?
Well, I'm refactoring some code and just wanted to make sure I checked things properly.
But if I needed to check, I would have to go PromotionCode to Coupon to Product to Price, and then make sure that Price is associated with a SubscriptionItem on the Subscription I'm updating/creating?
Correct, that would be the way to check this on your end
You should be able to get to at least the product with one retrieve call to the promotion code if you use expansion but after that point I think you would need to do another API call to list the prices
Gotcha
but I guess, it's possible to have a PromotionCode associated with a Coupon that has no Product, right?
Yes, in which case it should apply to every product as far as I know.
Gotcha, thanks!