#elBR
1 messages · Page 1 of 1 (latest)
Hey, can you share some example request IDs req_xxx
And the payload responses
(truncate them to highlight differences)
yes
I am sharing you the code
as you can see the two requests are the same appart the coupon code
that coupon code is a $10 coupon
if I call both of them, the difference is not $10
And the responses to those API calls?
i.e. what are the differences?
Ok, this is the issue I suspect:
When you make changes to a subscription, any existing discounts are applied when proration is calculated. You can’t discount proration line items further on the invoice that’s generated.
https://stripe.com/docs/billing/subscriptions/coupons#:~:text=When you make changes to a subscription%2C any existing discounts are applied when proration is calculated. You can’t discount proration line items further on the invoice that’s generated.
is not that case
you see that I am making the same call
and a discount is applied
just that the difference is not $10
You need to share the full JSON responses, You've deleted them
There was a marginal difference in the amount (likely due to the time the requests were made - we prorate to the second)
That's not the full JSON response. I need to see the line items
If you just paste the line items JSON from both responses, the issue will be clear
That's unreadable I'm afraid. Can you just paste the JSON (not an image) and format it?
Yeah, the difference is 956 ($9.65). Which likely accounts for the difference in time between the requests, which is crucial when prorating changes (we calculate proration to the second)
You should pass subscription_proration_date to a fixed unix timestamp: https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_proration_date
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
no is not
the requests are made in the same time
please make a test
with the data that I already sent you
1665140176 -> Fri Oct 07 2022 10:56:16 GMT+0000
1665140287 -> Fri Oct 07 2022 10:58:07 GMT+0000
I see almost 2 minutes difference
Please can you pass the subscription_proration_date parameter as I explained
A unix timestamp for a value for a time in the future that you want the response to reflect
Can you share the ID (req_xxx) of the failing API request? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_AgoXwWb1W5y4fE
req_OipOWiQhCIlqmj
as you can see the parameters are the same and changes just the coupon code
and the total difference is not $10
Ok, thanks for your patience here whilst I worked through this with a colleague. As expected, the discount applied (982, or $9.82) is a prorated amount of the $10.00 coupon to reflect the remaining time in the billing period (98%):
- The subscription's current period start is
2022-10-06 10:23:01 - You fixed the proration date in your request to
2022-10-07 00:00:00 - That is leaves roughy ~98% of the current billing period in which we are prorated values
so the coupon also gets prorated
but checking the invoice saved on Stripe it says -10$ coupon code
and this is not clear to the customer
That's true, and valid feedback
👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
but is there any way to not prorate the coupon?
I want it to be fully applied
because otherwise I have no way that Stripe tells me the prorated amount of the coupon
so that I can inform my customer
AFAIK there isn't a way around this
I was trying to think about a solution but the only one that came to mind was making 2 request as you did already (one with and one without the coupon) and calculate the difference
thanks
sorry I wasn't that more helpful