#brayden

1 messages · Page 1 of 1 (latest)

valid salmonBOT
gusty stag
#

Hi there what are you seeing exactly?

vivid vessel
#

The subscription is managed by the subscription schedule sub_sched_1MMKRHALivADE4JrcIjxf5d4, and updating any cancelation behavior is not allowed.

#

This is the error message that we receive.

#

We're seeing this when we call:

invoice = Stripe::Invoice.upcoming(
      customer: @policy.stripe_customer_id,
      subscription: @policy.stripe_subscription_id,
      subscription_cancel_now: true
    )
#

We're essentially using this invoice preview to show exactly how much is going to be refunded to the customer if the subscription is actually cancelled.

#

Seems to have to do with the fact that a sub schedule is attached.. but we've never had this issue before with trying to preview a cancellation invoice. Has something changed?

gusty stag
#

Can you share the request id so I can take a look?

vivid vessel
#

Hmm I'm not seeing one on the Stripe side..

#

Should I be able to find that via the subscription page?

gusty stag
vivid vessel
#

I see logs for previous API Requests.. but nothing for this request

#

This is one of the subscriptions in question

gusty stag
#

Can you share the error message you're getting then?

vivid vessel
#

The subscription is managed by the subscription schedule sub_sched_1MMKRHALivADE4JrcIjxf5d4, and updating any cancelation behavior is not allowed.

#

I'm a little confused by this message as we're not actually trying to cancel the subscription.. just generate a preview invoice so that we can determine what the prorated refund would be if we did cancel

gusty stag
#

Got it thanks. Let me look into why we throw this error

vivid vessel
#

Thank you!

gusty stag
#

Ah so apparently this is currently expected behavior. We treat that upcoming invoice endpoint as if the update was like a real subscription update, so we just mimic a similar error

#

I can file feedback with the owning team that you'd like the ability to just preview what would happen if you did cancel

#

But looks like we currently explicitly throw an error in this case

vivid vessel
#

Is this a new thing? We've never seen this before and we do this several times a day

#

What is the suggested way to do what we're trying to do here if something has changed?

#

As stated before, we're basically trying to just preview the amount left on the subscription that would be refunded back to the customer.

gusty stag
#

Doesn't appear to be a recent change, but I don't have the exact timeline on it

#

Let me think about workarounds

valid salmonBOT
vivid vessel
#

It seems as if releasing the attached schedule allows us to then preview the invoice. This isn't exactly ideal for us since we're only trying to preview the invoice.. releasing the schedule causes our scheduled renewals to be dropped off of the subscription with no way to reliably re-attach them if we don't actually follow through with the cancellation

#

One of our agents performed this action as early as yesterday morning. I'm waiting on a link to that subscription to hopefully show these request IDs, if possible.

gusty stag
#

Yeah if you can provide evidence that this was working as early as yesterday that would be great

#

But from what I'm seeing in our code, this specific error handling has been in place for a while

vivid vessel
#

Will post that subscription ASAP

gleaming apex
#

@vivid vessel hello, did you find that Subscription ID?

#

of where this worked before?

#

also for the error you're getting, would be helpful to:
1/ see the request ID for the upcoming Invoice request
2/ see the raw response body pasted here too (since I cannot see the response of that GET on my end)

#

you may be right that something changed here but seeing more info could help

vivid vessel
#

Still looking for some examples

#

This seems to only be affecting policies that have a subscription schedule so we're digging for one that might fit.

#

We're using the Ruby SDK to make this invoice preview request, so we don't ever really get a raw response, and it doesn't appear that Stripe is tracking that request when it throws an exception. If there's some specific way to get that, please help me understand how to do that!

gleaming apex
vivid vessel
#

Ah, great. Found one: req_p0H85XGNLiHWwp

#

Thanks!

#

Response body
{ "error": { "message": "The subscription is managed by the subscription schedule sub_sched_1MiRUQALivADE4JrhNepXJ1H, and updating any cancelation behavior is not allowed.", "request_log_url": "https://dashboard.stripe.com/logs/req_p0H85XGNLiHWwp?t=1682092064", "type": "invalid_request_error" } }

gleaming apex
#

thanks, looking

valid salmonBOT
gleaming apex
#

@vivid vessel have some ppl digging, we're assessing if we may have broken something here

#

if so, we'll try to revert the behavior, there was a recent refactor on the code path you're using re: previewing cancelling a SubSchedule help Subscription

vivid vessel
#

Awesome, thanks for taking a look!

wanton pelican
#

Hello! We've identified this as an issue on our end and are working on reverting the change now.

vivid vessel
#

Excellent, thanks for the help today. Any estimate on when the change might land?

wanton pelican
#

We don't have a specific ETA yet, but my guess is that it will happen sometime today.

#

Ah, looks like it should be under 3 hours (possibly a lot under).

vivid vessel
#

Great, thanks for the update!