#nt_api

1 messages · Page 1 of 1 (latest)

sage finchBOT
#

👋 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/1366704338747134034

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

round ivy
#

Yeah you can't pass discount with pending updates

When payment_behavior is set to pending_if_incomplete, you can only pass supported params. discounts is not supported.
req_ZTiW5PwZeQlxm5

queen patio
round ivy
#

Why not just add a discount without setting payment_behavior to pending_if_incomplete?

queen patio
#

if the subscription update fails we need to set custom logic for the subscription to be rolled back to its previous state.

round ivy
#

You can listen to invoice.payment_failed in all cases and do your update logic no ?

queen patio
#

Also, if I remove the pending updates, I still do not see the discount amount to stripe's invoice

#

e.g. in_1RJAbdD8MRRUQEjfLktD2RoL

round ivy
#

Can you shre the requestId of the update ?

#

This req_K4rf8lz41oSaKN?

round ivy
#

It's applied to this price price_1RJAbdD8MRRUQEjfgnKlPqRx

queen patio
#

Yes that is the request, but the invoice does not show any signs of this discount amount.

#

it just shows the final discounted price.

round ivy
#

First, the discount is applied then ?

#

it just shows the final discounted price.
Can you share a screenshot of what you are reffering to ?

queen patio
#

The obvious question is why stripe chooses to 'hide' the discount amount during only prorations but shows the discount amount on an invoice on any other occasion.

Here's the screenshot. The original item price is 3588. You show the discounted amount 2504 (applied 30% discount)

round ivy
#

There is the mention of the discount there (with 30.0% off)

#

And yeah that's how the pdf display is. Unfortunately, there is no way to customize it.

queen patio
#

on the name not in the invoice details... if i retrieve the invoice through the api there is no mention of the discount amount

round ivy
#

Can you share the requestId of the API call you are making ?

sage finchBOT
fringe dagger
#

hi! I'm taking over this thread. let me know if you have other questions!

queen patio
#

retrieve calls do not have a request_id

fringe dagger
#

I'm not sure I understand your question, sorry.

queen patio
#

Can you read the thread above?

fringe dagger
#

yes. so what's your question?

queen patio
#

Why do you choose to hide the discount amount to an invoice during prorations? Is there any way to know for an invoice how much was the discount amount applied?

#

The only info I have is that a 30% discount was applied. I need to do the prorations manually and calculate the discount amount manually .

fringe dagger
queen patio
#
 "discount_amounts": [
    {"amount":0,"discount":"di_1RJAbdD8MRRUQEjfQR6lXh2n"}
  ],
  "discountable": false,
  "discounts": [],
  "invoice": "in_1RJAbdD8MRRUQEjfLktD2RoL",
  "invoice_item": "ii_1RJAbdD8MRRUQEjfePd3V9HP",
  "livemode": false,
  "metadata": {},
 "pretax_credit_amounts": [
{"amount":0,"discount":"di_1RJAbdD8MRRUQEjfQR6lXh2n","type":"discount"}
  ],

Yes I checked it, it still shows as empty or zero.

fringe dagger
#

I don't understand. I just checked that invoice, and the total discount is $0. so what exactly do you want to see in the API response?

queen patio
#

the discount that was applied to the invoice line item with id: "il_1RJAbeD8MRRUQEjfnVg7GT3b"
It's list price is 3588. You add a 30% discount and show to both the invoice and the api the amount after the applied discount. How can I as a user know how much was the discount amount of that invoice. this info is missing.

#

If that is not enough, when I retrieve the invoice, the discounts field is empty although the discount is obviously applied to one of the invoice's line items..

fringe dagger
#

The discount for that invoice was 0. and you can see that in the API response you shared above:

 "discount_amounts": [
    {"amount":0,"discount":"di_1RJAbdD8MRRUQEjfQR6lXh2n"}
  ],
queen patio
#

Yes that is what I am trying to explain, there is an applied discount to that invoice of 30%. The invoice line item above with amount 2504.72 is calculated by applying a 30% discount to the list price 3588.0 which gives us 2511.6 and to that we add the proration -> 2511.6 * (364/365) = 2504.72
I want to have the info that this 2504.72 is not the invoice line item's amount but the discounted one. The invoice miss the information that the discount amount is 3588-2511.6 = 1076.4
I don't know how more clearly can I say this. You apply a discount to an invoice but that discount amount is not shown anywhere. the only info shown is on the invoice line item's name "with 30.0% off". That is not how invoices should work....
In every other case other than a proration you clearly show the discount amount both in the pdf and in the api..

fringe dagger
#

I think there is a misunderstanding. on the invoice you shared, you added a 30% discount. but the two invoice items are for prorations, which are not discountable. so the discount was ultimately ignored by the invoice, so the total discount is simply 0.

queen patio
#

They are the prorated invoice items but the one of them is also with an applied discount. The 2504.72 is the prorated discounted amount. I do not send that amount to stripe as you can see from that request log: req_K4rf8lz41oSaKN
The amount sent for that line item is 358800 (cents). Stripe on its own chooses to pre-apply the discount to that amount and then prorate and not show the discount amount to the invoice. If there is another way I can make a subscription update with a discount and the discount can be shown to the invoice please lmk.

fringe dagger
#

I see one of the invoice items does say:

Remaining time on Standard Recruiting (with 30.0% off) after 30 Apr 2025
so yes looks like the discount was applied? looking...

sage finchBOT
queen patio
#

any updates?

jaunty fossil
#

If my understand is correct, this is just expected. We don't provide discount amounts for proration items, as noted here:

Any adjustments from discounts are reflected in the proration invoice item’s amount. Additional discounts at the invoice item level or invoice line item level don’t apply to prorations because they have discountable=false.

This behaviour is different from non-prorations, which show discount adjustments in discount_amounts.

Use Stripe Billing to manage how your customers are charged for partial use of their subscriptions.

#

Unfortunately we just don't provide discount amounts/breakdowns for proration items. It's baked into the line item amount as part of the calculation