#dragonlord_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1354847352141254786
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- dragonlord_api, 1 day ago, 29 messages
- dragonlord_api, 1 day ago, 21 messages
Hi 👋
What do you mean by "customer discount"? Stripe models discounts through Coupons and Promo Codes.
Sorry for the delay in my response back
I mean you can add a global discount for a customer, we would not want this global coupon to be applied to one of the subscriptions the user has
We have a subscription in which we want no coupons to be applied to it even global coupons
That is something you would need to manage in your integration
That isn't something you can configure Stripe to handle
You can apply a promotion_code to a Customer object
we have a customer who has 30 percent off, we do not want that coupon to be applied to a subscription
but we can't remove it since it was applied on the customer level
Promotion codes are built from Coupons
And you can specify which products a Coupon applies to using the parameter
so you could exclude the Product/Price in that Subscription
but you would need to specify all other products
What happens if you update the Subscription and specify empty strings for the coupon, discount, and promotion_code properties in the discounts parameter
I will test one second
You passed an empty string for 'discounts[0][discount]'. We assume empty values are an attempt to unset a parameter; however 'discounts[0][discount]' cannot be unset. You should remove 'discounts[0][discount]' from your request or supply a non-empty value.
I get this error
Can you share an API request ID for this error? It will start with req_
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
even if I pass an empty array 'discounts' => [],
it still applies the coupon
req_4K2tCCczd3NNeT
here is the request id
Yeah that matches what our docs say here:
If not specified or empty, inherits the discount from the subscription’s customer.
I just wanted to see if you could unset specific properties
Wait no
But specify it as empty
I meant as an update, after you create the Subscription
which is why I am confused why it paplies
Can you test that IN TEST MODE
which is why I am confused why it paplies
This is what our docs say, which I shared above
Intresting I can test in production it's my account so issue playing around with that
Testing in Live mode violates Stripe's terms of service
It still applies the coupon after updating the subscription with an empty array
$stripe->subscriptions->update(
'my_sub_id',
['discounts' => [],]
);
reauest_id: req_P6aGlWgkhF2Ahm
Hi hi! I’m going to be taking over for my colleague here. Give me a minute to read back and understand things.
https://dashboard.stripe.com/test/logs/req_P6aGlWgkhF2Ahm your post body didn't come through.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
i only passed a blank discounts array
Sweet.
but it is not working as expected it still applies the customer coupon to the subscription
Do you mean it doesn't remove the discount from the subscription?
Hey @short quarry apologies for the delay, are you still looking into this? I think the way to unset this may be to set the discounts array t an empty string. Will try to test to confirm in a minute
I tried that it still did not work
Can you send me the request ID for that? req_1234
Checking with my colleagues on this as well. Having trouble testing myself
req_uBy4H9yI5vsfnn
Ah, sorry I read through the thread too fast. So as far as I can see, this is expected behavior at the moment for the customer's discount to apply to the subscription and I'm not seeing a way to prevent that in the API. I can put in a feature request but can't promise if/when it will be added. In the meantime, I think the workaround would be to unset the Customer's discounts, create the subscription, and re-apply the coupon to the customer. I understand that that is cumbersome, but I don't think there is a better way with our API's current abilities.