#cristian_unexpected

1 messages · Page 1 of 1 (latest)

jaunty stumpBOT
#

👋 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.

burnt remnant
#

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

grim summit
#

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?

burnt remnant
#

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

grim summit
#

Taking look

burnt remnant
#

thanks

grim summit
#

Why are you passing backdate_start_date:"1746033964", when the creation date is the same?

burnt remnant
#

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

grim summit
#

These are two different requests.

burnt remnant
#

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

grim summit
burnt remnant
#

Just a sec, Im redoing the tests without the difference between coupon and discount

grim summit
#

Once I have that information, I can attempt to reproduce this on my end as well

burnt remnant
#

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

grim summit
#

We document it above

burnt remnant
#

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

grim summit
#

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

burnt remnant
#

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:

grim summit
#

If you're passing the billing cycle anchor/backdated start, you would not be able to override it. It is just how it works.

burnt remnant
#

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

grim summit
#

The amount being charges is correct right? Is the UI that is bothering you?

burnt remnant
#

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

jaunty stumpBOT
grim summit
burnt remnant
#

Please do!

#

I omited the cycle date and created a subscription without a discount, this was the outcome:

#

only using the backdate

grim summit
#

I shared your feedback with the team here

burnt remnant
#

thank you