#Polina Mahur

1 messages · Page 1 of 1 (latest)

gentle prairieBOT
tall forge
#

Hi

I understand why it does that but what I need is to get prorated price with applied coupons for the additional seats, without taking into account the whole subscription state. How can I do that?
You can't achieve that, upcoming Invoice are related to the actual and whole state of the subscription.

#

Probably you should compute this on your end if you want display this particular use case.

gentle prairieBOT
round forum
#

Regarding my issue again
I think I found a workaround:
In retrieve upcoming route, instead of specifying the end quantity in the subscription_item like that
...subscription_items: [
{
id: subscriptionItem.id,
quantity: 12,
},
]...
I am specifying the additional seats quantity
...subscription_items: [
{
id: subscriptionItem.id,
quantity: 2,
},
]...

The upcoming invoice then returns line items and the second one is “Remaining time on 2 × … (with 25.0% off) after 12 Apr 2023” - it has the desired result. But this solution also has one problem - when I pass quantity that equals current quantity in the subscription, this line item is not returned. That is, when I pass 2, 3, 4…9, 11, 12… - it returns this line item, but when I pass 10 - it does not return that. Is this some sort of a bug or desired behaviour?

#

Can you share some example req_xxx IDs that demonstrate what you're describing?

timber elk
#

The one that working - req_C9PsfvpjzkyYfp
The problematic one - req_4kVSi8LFIaPGvH

round forum
#

Can you share the critical difference in the JSON responses? We don't log those

timber elk
#

The upcoming invoice has lines.data property - the first request returns 2 line items, the second one only 1.
In the first request 2 line items are with such description:
{… description: ‘Unused time on 10 × … after 12 Apr 2023’}
{… description: ‘Remaining time on 2 × … (with 25.0% off) after 12 Apr 2023’}

In the second request only 1 line item with such description:
{…description: ’10 × … (at $200.00 / month)’}

That would be great to have Remaining time on 10 × … line item.

Must to say, initial quantity in subscription is 10.

round forum
#

Well you're passing the same item quantity (10) that already exists on the Subscription. Why would there be any proration there?