#CaptainYarb-proarations

1 messages ยท Page 1 of 1 (latest)

blissful shuttle
errant magnet
#

I have a request id: req_rMXF1gFhuUsiHL if you'd like to see what we sent to it.

blissful shuttle
#

It looks like the request is formatted wrong because it's coming in like this:
{ phases: { 0: { items: { 0: { price: "price_0J5cZ4F23R9jbzPTJntOn0DD" } }, proration_behavior: "always_invoice" } }, proration_behavior: "always_invoice" }

But it shouldn't have those index values as keys

errant magnet
#

OH! It looks like this is a postman client issue. DOH! ๐Ÿ˜‚

I did manage to fix the client request, but get the same error: req_VksNF6N2HssWYM

blissful shuttle
#

proration_behavior is still being set on both the phase array and outside of the phase array. Can you remove the one outside of it?

errant magnet
#

I've already tested that as well via the previous requests req_jmBqvxftIRc9DE and req_pSuOJVCf2xJSfq

#

Also, I'm unsure what you mean by the wrong formatting. After digging into this issue we ended up swapping to the Stripe Node.Js SDK and got the same formatting:

Request id: req_pSuOJVCf2xJSfq

blissful shuttle
#

Does the subscription you're using have proration behavior set already?

errant magnet
#

As far as I'm aware a Subscription cannot hold a any proration behavior set on it.

#

The Subscription Schedule has a default proration behavior on it's phase [0] object, which is set to create_prorations (default).

blissful shuttle
#

Can you copy/paste your code so I can try to repro on my end?

errant magnet
#
const results = await stripe.subscriptionSchedules.update('sub_sched_0L897nF23R9jbzPTSub6IZxw', {
    "proration_behavior": "always_invoice",
    "phases": [
        {
            "items": [
                {
                    "price": "price_0J5cZ4F23R9jbzPTJntOn0DD",
                },
            ],
            // "proration_behavior": "always_invoice",
        },
    ],

});
#

The request to create the subscription did not include any proration behavior: req_FgJoT9XO6T35Mj

blissful shuttle
#

If you set proration_behavior on the Subscription, does the error go away?

errant magnet
#

That's an unusual request from what I understand. But for science, updating the subscription: req_lQwskKSIjNhhdL (worked)!

Retrying the subscription schedule Update: req_EYxuoNVgJKdidM (did not work).

blissful shuttle
#

Okay, let me run on my end (p.s. thanks for bearing with me)

errant magnet
#

No worries. I appreciate all your help so far! ๐Ÿ˜„

blissful shuttle
#

Okay, I figured out what's wrong

#

So, the error is really misleading, because it implies that you can set always_invoice on phases.proration_behavior, but it's not supported right now. This is a feature that's being built out and I'm working with one of the internal product engineers to see if we can make this feel more intuitive while they finish building it

#

Apologies for the back and forth. The error is definitely on our end

errant magnet
#

Man, we find all the fun bugs. ๐Ÿ˜‚

#

To be fair your docs do say it's unsupported. We missed that, too.

blissful shuttle
#

I know, I feel like this isn't even the first bug you and I have found. Thanks for being consistently consistent ๐Ÿ˜…

errant magnet
#

Is there a way for us to be emailed when this feature lands?

blissful shuttle
#

Unfortunately you won't have access to the Github notifications that go out when it's updated.