#Luiz Azevedo

1 messages · Page 1 of 1 (latest)

tidal copperBOT
glass wren
#

Hello

#

That's a really long doc and we are helping multiple folks here at the same time

molten sentinel
#

hello

glass wren
#

Can you summarize your issue?

#

Otherwise you are going to be better off sharing that doc with our Support team over email

#

And they can take a deep look at it

molten sentinel
#

OK. I'll try to summarize here.

#

Basically I have a configuration that I can use when creating a customer portal without specifying a flow when creating the portal.

But I need to create the flow subscription_update with this configuration, and when I try to create it I get the following error.

{
"error": {
"message": "The PortalConfiguration's subscription update feature does not allow base price or addon updates.",
"request_log_url": "https://dashboard.stripe.com/test/logs/xxxxx",
"type": "invalid_request_error"
}
}

So I would like to understand why I can use this configuration when creating a customer portal when I don't specify that it is a subscription_update flow.

glass wren
#

Can you provide me the actual request ID from that error so I can look at exactly what you are doing?

molten sentinel
#

This is curl with error, I change my key in the call..
curl --location 'https://api.stripe.com/v1/billing_portal/sessions'
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'Authorization: Basic xxxxxxxx'
--data-urlencode 'customer=cus_OFW0TEbJvYSNJ5'
--data-urlencode 'return_url=https://example.com/account'
--data-urlencode 'configuration=bpc_1NTNj7Bb2P8uShrMjbgZc9u6'
--data-urlencode 'flow_data%5Btype%5D=subscription_update'
--data-urlencode 'flow_data%5Bsubscription_update%5D%5Bsubscription%5D=sub_1NT96FBb2P8uShrMdUKhgAtm'
--data-urlencode 'flow_data%5Bafter_completion%5D%5Btype%5D=redirect'
--data-urlencode 'flow_data%5Bafter_completion%5D%5Bredirect%5D%5Breturn_url%5D=https://example.com/account'

glass wren
#

Just looking for the request ID

#

Looks like req_xxx

#

You removed it from the error you provided above

molten sentinel
glass wren
#

Ah! So sorry @molten sentinel ! I missed your follow up

#

Looking at that request now

molten sentinel
#

No problem.

glass wren
#

@molten sentinel okay I think the issue here is that your Billing Portal Config is only allowing for quantity updates

#

But with that deep link flow it wants to allow for Subscription Price updates as well

#

Can you try adding default_allowed_updates[]: 'price' as well to your config

#

And then try again?

molten sentinel
#

@glass wren -If I put the price it will work, but not in the way I want and it doesn't solve my problem.

#

Because when the customer has an annual subscription, I don't want to allow the customer to change the annual plan to monthly.

glass wren
#

Hmm but your config does include two Prices

#

One that is annual and one that is monthly

molten sentinel
#

Yes.

glass wren
#

So then I'd try removing the monthly Price from the config

molten sentinel
#

Yes.

glass wren
#

What happens if you do that?

molten sentinel
#

if i remove price from the list i get another error.

#

{
"error": {
"message": "This PortalSession cannot update subscription sub_1NT96FBb2P8uShrMdUKhgAtm because the configuration bpc_1NTPvkBb2P8uShrMiyMOECwp does not have any valid prices to switch to in its features[subscription_update][products]. This can be because there are no prices with a matching currency or tax behavior.",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_yBQvZIKzAro8TY?t=1689256314",
"type": "invalid_request_error"
}
}

glass wren
#

Interesting

#

Thanks for testing

#

Let me check if it is possible to just update quantity in this flow

#

I thought it was but now I'm not so sure

#

Oh

#

You still have price

#

Now you need to remove price from your default_allowed_updates

#

Since now you only have one Price

molten sentinel
#

Right.
I'll try..

#

removed price from update and product list

#

This subscription_update flow is not allowing you to change only the amount of the current plan. But that in the default flow of the stripe is allowed.

glass wren
#

Well that just feels wrong. I definitely think that should just work 😦

#

Give me a moment to look at one more thing

#

Otherwise I'll have to put in a feature request to get this added

molten sentinel
#

OK. Thank you very much.

glass wren
#

Okay yeah sorry this is really unintuitive and I agree this should just work fine.

#

I'm filing feedback now for a feature request to get this ability added

#

As a workaround I'd suggest using the subscription_update_confirm flow for now

#

You'll need to collect the quantity update ahead of the portal redirect

#

But then you can use the portal to handle the rest

molten sentinel
#

I thought about it, but I don't own the quantity that the customer will update.
So I would have to create a previous flow, before arriving at the customer portal.
And for this flow I need to make more requests to collect more information, such as the subscription item id

glass wren
#

Hmm not sure I understand

#

You already have an authorization flow right?

#

Since you are creating Billing Portal Configs specifically for the customer here?

molten sentinel
#

Yes.
and for now my idea is to solve it like this:

When the customer has an annual plan, I will use the standard flow.
When the customer has a monthly plan, I will use the subscription_update flow.

tidal copperBOT
glass wren
#

That would work too

molten sentinel
#

Yes.
But she would have different flows with different views, and she wouldn't like that. So I would like to always use a single stream.

glass wren
#

Right well until we provide the deep link just-quantity update flow you will need two different flows here

#

No way around it really right now

molten sentinel
#

Yes. I agree with you.
But I'm already happy that in the future this will be possible, then I'll update when it's available.
And I'm also glad someone was able to actually understand my real problem.

glass wren
#

Yep I'm submitting that feature request now

#

Hopefully it will get built soon!

molten sentinel
#

thank you my friend. I'll be waiting.
How can I follow this process?

glass wren