#Vdrizzle

1 messages ยท Page 1 of 1 (latest)

merry lichenBOT
languid storm
#

Hello

slim stone
#

Hi

#

Funny, I'm in Bismarck, ND ๐Ÿ˜ƒ

languid storm
#

Can you give me the example where you are seeing the above?

#

Ha that is a funny coincidence

slim stone
#

Yes so "I have" a subscription with 1 user seat for $39. I want to allow customers to change their sub and see how much they are going to get charge "right now"

languid storm
#

Okay and are you using the upcoming invoice preview to help determine that?

slim stone
#

Yes but, well you see the numbers I'm getting

#
{
    "subscription": "sub_1Mf8yT2YF2woP7IMJcnt3VrF",
    "subscription_items": [
        {
            "price": "price_1Mb7wv2YF2woP7IMPun4fuKy",
            "quantity": 2,
            "id": "si_NPywI0UA82BTmF"
        }
    ],
    "subscription_proration_date": 1677513561
}
#

this is the payload I'm passing

#

I would expect that if I have one seat @ $39 and I add another one "right now" I would get charged $39 or a prorated amount for the $39 from "now" up to the next monthly charge. Unless I'm not understanding well.

languid storm
#

Let me take a look at that example

slim stone
#

๐Ÿ‘๐Ÿพ

languid storm
#

Yeah okay

#

Looks like that Sub has multiple subscription items

#

So you are previewing for all of them

#

If you don't want to preview for all of them in your upgrade then you need to mark them as deleted in the preview

slim stone
#

Those Items are at 0 qty

#

essentially $0 no?

languid storm
#

Ah they are

#

Missed that, thanks

#

Hmm

#

Can you show me the full JSON returned for the above request?

slim stone
#

Yes, do you want it pasted here or a link to a pastebin or something like that?

languid storm
#

Pasted here between three backticks is good

#

like this

slim stone
#

kk

#

mmm is trying to paste as a .txt

#

maybe is too big

#

I'll keep trying to paste it here

languid storm
#

Yeah that's fine

slim stone
#

I think I see what is happening. It's adding the next invoice amount + what it would be due "today"

languid storm
#

Ah shoot you aren't passing always_invoice

#

For proration_behavior

#

So yeah

#

Since same interval for Price it will be the next invoice

slim stone
#

I see let me try that real quick

#

Nice

#

OmG โค๏ธ . Thank you so much. I thought for a second we'd have to do MATH ๐Ÿ˜‚

languid storm
#

lol glad it works

slim stone
#

How can I pay for a beer or coffee?

#

Is the least I can do ๐Ÿ˜„

languid storm
#

Just keep using Stripe ๐Ÿ™‚

#

We are happy to help!

slim stone
#

๐Ÿ‘๐Ÿพ Thank you!

#

mmm

#

Don't close this yet ๐Ÿ˜ I may have another question

languid storm
#

No worries

slim stone
#

So this happens when I pass in the same qty. Any way I can make the system give me a $0 dollar amount or do I have to manage that

#

the pay load

{
    "subscription": "sub_1Mf8yT2YF2woP7IMJcnt3VrF",
    "subscription_items": [
        {
            "price": "price_1Mb7wv2YF2woP7IMPun4fuKy",
            "quantity": 1,
            "id": "si_NPywI0UA82BTmF"
        }
    ],
    "billingEntityId": "cos_11277",
    "subscription_proration_date": 1677516360,
    "subscription_proration_behavior": "always_invoice"
}
languid storm
#

You want the preview to show $0 if you preview a no-op update?

#

Like previewing an update with the same line items that are currently associated?

slim stone
#

Sorry had to jump in a meeting quick.

#

If possible I would like the invoice to say you owe $0 right now

#

essentially yes to both of your questions

sleek creek
#

Hi ๐Ÿ‘‹

From what I can see the quantity of 1 is causing the $39 amount to be shown here, which makes sense based on the price. What is the reasoning behind showing a $0 amount?

slim stone
#

Hi ๐Ÿ‘‹๐Ÿพ

So the scenario here is a customer that already has qty of 1.

#

Basically I (customer) want to update my subscription and lets say I check how much I owe "now" for two but then I revert back to one etc.

sleek creek
#

Okay so the customer has already paid for the 1 quantity and you want to be able to check what the cost would be for a quantity of 2?

slim stone
#

that is the use case

#

Don't mind the qty of 10 for social. That is a plan default that is not represented in stripe.

#

I'm expecting that if I pass a subscription_id and a subscription_item_id that match the qty that nothing would be due "now"

#

I'm trying to avoid having to preserve the original state locally in the UI to check if the customer is really previewing changes or not to short circuit the call to preview invoice. I hope that makes sense

sleek creek
#

Okay I see what you mean.

slim stone
#

Looks like the line item being returned is for the next billing cycle even though I'm passing "always_invoice" with a proration date of "now"

sleek creek
#

What happens if you pass a timestamp value that corresponds to now?

slim stone
#

To what field? proration date?

#
{
    "subscription": "sub_1Mf8yT2YF2woP7IMJcnt3VrF",
    "subscription_items": [
        {
            "price": "price_1Mb7wv2YF2woP7IMPun4fuKy",
            "quantity": 1,
            "id": "si_NPywI0UA82BTmF"
        }
    ],
    "subscription_proration_date": 1677520580,
    "subscription_proration_behavior": "always_invoice"
}

This is essentially the payload

sleek creek
#

Ah, okay.

warped burrow
#

๐Ÿ‘‹ Just hopping in here since snufkin has to head out soon

#

@slim stone You're using trying to use the upcoming invoices api to preview what would be owed immediately if there was no change made to the subscription, correct?

slim stone
#

Basically yes

#

and Hi ๐Ÿ‘‹๐Ÿพ

warped burrow
#

So the issue here is that if you were to make a request to update the subscription but make absolutely not changes, we wouldn't generate a new $0 Invoice for the Subscription

#

We'd consider it to be a no-op, keep the current Invoice, and then the Subscription will renew normally

#

That's why the upcoming Invoices API is giving you back an Invoice for the full amount - it's giving you the NEXT invoice that will be generated when the subscription renews (because no invoice is being generated for the no-op change)

slim stone
#

I see.

#

Well I'll have to handle this somehow. Thanks for all of your help!

warped burrow
#

๐Ÿ‘ My suggestion would be to display the date and amount in your UI (so that if the changes are a no-op it'll be clear that the amount won't be charged today)