#njp9773
1 messages · Page 1 of 1 (latest)
Let me double check something - I believe we have pretty strict logic for when you're allowed to create a subscription in a specific currency that would cause the behavior you're seeing
Yeah so there's a pretty long list of things that "lock in" the currency of a customer and would prevent it from creating a subscription in a new currency - this is something specific to subscriptions, and wouldn't prevent invoice creation
I believe that list is:
- active subscriptoins
- subscription schedules
- discounts
- quotes
- and pending invoice items
Yeah, I know about active subscriptions, and we're checking for that. We don't use subscription schedules without an active subscription, and we don't really create quotes, so those shouldn't be a problem.
My question is really about the discounts and pending invoice items.
- Why did a discount whose coupon has
currency=nulland only applies to a product with prices in both currencies block the subscription? How did Stripe decide that the currency for that discount was USD? - Under what circumstances to pending invoice items block subscription creation due to currency? I wasn't able to repro in the dashboard.
Test mode customer demonstrating the discount behavior: cus_OODPcEB0Hf8HlD
I believe having a pending invoice item (one not attached to an invoice at all) for a USD price would mean that you can't create a subscription for non-USD. You'd have to add that pending invoice item to an invoice, and then you'd be able to create a non-USD subscriptoin
Give me a minute to check out that customer for you as well
I've been able to repro the issue with pending invoice items, so I'm good on that one. Not sure why it didn't repro before, but I'm guessing user error.
For your question on the discounts - I think this is a case where we chose to be more restrictive with currency changes than we really needed to be so we just choose to not allow the currency switch if there's any discount on the customer
If we wanted to be more accurate, we should only consider the customer to be currency locked by a discount if that discount is applied to a subscription - but because we had to roll this out quickly (we needed to do this to support croration moving to the euro) I believe we wanted to be more restrictive (with the idea being that we can always loosen validations as a non-breaking change later)
Thanks for the clarification. I totally understand that rationale. So I'll modify my code to check for discount and pending invoice items as well as subscription.
Final question: how does Stripe decide the currency to lock to if the discount doesn't specify one? If a customer is locked to a currency, we only want to show prices in that currency.
We'd lock it to whatever currency the customer already has set (which you can check through the API https://stripe.com/docs/api/customers/object#customer_object-currency). For that test customer you gave, their most recent subscriptoin (which had since been cancelled) was in USD so that's waht it was locked to when you added the discount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
IIRC, customer.currency cannot be changed once set, so that should be the currency of the first subscription, right?
that used to be the case, but now with these changes that allow you to create subscription in a different currency we'll actually update it if you switch
Oh, that's good to know, and very useful! Is it documented anywhere?
Also, one more thing: I'm able to create multiple pending invoice items in different currencies. If that's the case, does Stripe also lock to the customer's currency?
I don't believe we have great documentation on this - the most I can find is https://support.stripe.com/questions/why-are-customers-locked-to-a-specific-currency-and-can-not-be-moved-to-a-price-in-another-currency
Yeah I believe as soon as you create a pending invoice item in any currency that would lock you in to the default
Great, thanks for all your help!