#ruin_subscription-update

1 messages ¡ Page 1 of 1 (latest)

fluid gyroBOT
#

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

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

craggy temple
#
params := &stripe2.InvoiceParams{
        Customer: stripe2.String(customerID),
        AutomaticTax: &stripe2.InvoiceAutomaticTaxParams{
            Enabled: stripe2.Bool(true),
        },
        SubscriptionItems: items,
    }
    if invoiceImmediately {
        params.SubscriptionProrationBehavior = stripe2.String(
            string(stripe2.SubscriptionProrationBehaviorAlwaysInvoice),
        )
    }
    if subscriptionID != nil {
        params.Subscription = stripe2.String(*subscriptionID)
    }
    params.AddExpand("total_tax_amounts.tax_rate")
    params.AddExpand("subscription")
    in, err := invoice.GetNext(params)
#

if relevant

indigo cypress
#

That looks like the retrieve invoice endpoint

#

With the upcoming invoice endpoint you can preview a change to a subscription

#

Actually that might just be an old version of the sdk that calls that same endpoint

#

Can you share a request id

craggy temple
#

yes, I'm using that endpoint

#

give me a sec

#

will get the request_id, but it seems like it is /upcoming endpoint

indigo cypress
#

Yeah must just be an old version of our Go SDK

#

In newer versions the call is invoice.Upcoming

craggy temple
#

will that change the behaviour?

#

or the issue is the same?

indigo cypress
#

Shouldn't

#

I just need to see a request id to see exactly what you passed

craggy temple
#

req_e4mCF33y8VRPSG

indigo cypress
#

Yeah you need to add the new yearly price for this to work

#

So you need to remove 1 subscription item and add a new one

craggy temple
#

but subscription related to the invoice has monthly anchor

#

and I'm chaing to yearly billing cycle

#

would that still work?

#

after preview invoice

canceling monthly subscription -> activating yearly, with deducted prorated credits from monthly sub

indigo cypress
#

You can update a subscription from monthly to yearly

#

No need to cancel

craggy temple
#

let me try

fluid gyroBOT
forest whale
#

ruin_subscription-update