#cristian_unexpected
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/1367192969547092060
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Unexpected invoice, subscription created with backdate and cycle anchor
Subscription creation request ID: req_ll3Jd9fLOrVEDw
Invoice ID: in_1RJeOZABXG7iwsUN02HrU6SF
"backdate_start_date": "1746033964", // 2025-04-30 17:26:04
"billing_cycle_anchor": "1777569964", // 2026-04-30 17:26:04
expected invoice, this was generated without giving a billing cycle anchor and backdate
Subscription creation request ID: req_1HzcUZWGifv9ji
Invoice ID: in_1RJb9YABXG7iwsUN8YCBf7bq
Hi, can you share the request id from when it's not working as expected? Can you add a narrative to what you expect to happen?
Hey Pgskc, I just edited the posts and added the request IDs
I expected the invoices to be the same (aiming for the bottom one)
But by providing the backdate and cycle anchor parameters at the same request that is providing the discount coupon ID its causing the invoice line item to display:
Time on 5 × Entity Management Service (with $1,250.00 off) from 30 Apr 2025 until 30 Apr 2026
while at the same time zeroing the discount applied in the subtotal
I tried playing with the backdate and cycle dates, using coupon and discount parameters in the create subscription parameters, but nothing seem to solve it
Taking look
thanks
Why are you passing backdate_start_date:"1746033964", when the creation date is the same?
because if you have a subscription and three months down you create a new subscription we need to use the same backdate start date in order to have them in sync
BTW, removing that parameter did not solve the issue
Also, if we have a batch that is creating 10 new subscriptions, we process them in sequence, so the first one must have the same backdate start date as the last one
The reason being, you passed the coupon, https://dashboard.stripe.com/test/logs/req_ll3Jd9fLOrVEDw differently. Meanwhile, this us what you passed on the other subscription: https://dashboard.stripe.com/test/logs/req_1HzcUZWGifv9ji
These are two different requests.
I only pass the price and the quantity on the subscription line items
but yes, I tried passing the coupon in the Coupon parameter and also in the Discount Coupon parameter, both produce the same outcome
both coupons were attached to the main subscription
Can you share the request id where you passed it in the Coupon: like https://dashboard.stripe.com/test/logs/req_1HzcUZWGifv9ji ?
Just a sec, Im redoing the tests without the difference between coupon and discount
Once I have that information, I can attempt to reproduce this on my end as well
Ideal scenario:
CustomerID: cus_SE7OboRLDL1pfT
SubscriptionID: sub_1RJfAhABXG7iwsUNXDuBRkYm
Subscription creation request ID: req_HQrlR3qRblyqzp
InvoiceID: in_1RJfAhABXG7iwsUNTEGqETKs
Invoice creation: evt_1RJfAiABXG7iwsUNV1ZIVxP2
Doing the other one now, one sec
Odd scenario:
CustomerID: cus_SE7SYvKqoF3ykY
SubscriptionID: sub_1RJfESABXG7iwsUNbBHlgjr0
Subscription creation request ID: req_7dcQQNjUqmPGZE
InvoiceID: in_1RJfESABXG7iwsUNaMfrFsOO
Invoice creation: evt_1RJfETABXG7iwsUN0uzi9vBC
The coupons are different because im creating them on demand
but it is the same coupon value and type
Ahhh, that is beacuse of prorations with discount work differently: https://docs.stripe.com/billing/subscriptions/prorations#prorations-and-discounts
The discount is applied in proration invoice item’s amount.
We document it above
Hmm
But im not prorating it
Im creating a fresh subscription
and the invoice behavior is different just by providing a backdate and cycle date
and the duration is exactly a year
You're and you can look at the desciprion of the item: Time on 5 ×Entity Management Service(with $1,250.00 off) from 30 Apr 2025 until 30 Apr 2026 on that invoice
That is how it works with billing cycle anchor, https://docs.stripe.com/billing/subscriptions/billing-cycle
Interesting
How can I get rid of that Time on... and use the regular invoice line?
I just tested without the discount and indeed it shows the same (missed that before)
the next invoice seems to look ok, so the issue is only on the first invoice:
If you're passing the billing cycle anchor/backdated start, you would not be able to override it. It is just how it works.
billing_cycle_anchor_config does not support anchoring on a backdated start date.
what I need at the end of the day is to respect the backdated start date, so the customer has all their subscriptions charging at the same time
e.g.:
Today is April 30th
my backdate is Jan 10th
If I create a subscription today, it must be from 01/10/25 to 01/10/26, regardless if it is being created on 04/30/25
we are achieving that by using a common start date for each customer and calculating the backdate and cycle date based on the year we currently are
The amount being charges is correct right? Is the UI that is bothering you?
yeah, the amount is correct
the issue is that the discount is $0, and the invoice line description is not friendly to the user
this would be ideal, it shows the original unit price, the amount the customer would pay and the discount we applied, with the total cost
I'm afraid that is not adjustable and that is just how it works at mentioned here: https://docs.stripe.com/billing/subscriptions/prorations#prorations-and-discounts
I'm happy to share your feedback with the product owning team to consider for future product reiterations
Please do!
I omited the cycle date and created a subscription without a discount, this was the outcome:
only using the backdate
I shared your feedback with the team here
thank you