#nsad_api
1 messages · Page 1 of 1 (latest)
👋 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/1289312490185953382
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
hey there, what exactly are you having trouble with?
so i try to configurated price in subscription_update
"subscription_update": {
"enabled": False,
"default_allowed_updates": ["price"],
},
how i get to configurated determinated prices?
Can you explain what you're trying to do?
i am try to create configuration of portal in code:
portal_configuration = stripe.billing_portal.Configuration.create(
business_profile={
"privacy_policy_url": "https://example.com/privacy",
"terms_of_service_url": "https://example.com/terms",
},
default_return_url=DOMAIN + reverse("user_subscription"),
features={
"customer_update": {"enabled": False},
"invoice_history": {"enabled": True},
"payment_method_update": {"enabled": True},
"subscription_update": {
"enabled": False,
"default_allowed_updates": ["price"], # Permite atualizar o preço
},
"subscription_cancel": {
"enabled": True,
"mode": "immediately"
},
},
)
but i need configurated to update prices
how i can do that?
First you need to set enabled=true but you also must specify products using this shape:
https://docs.stripe.com/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-products
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
"subscription_update": {
"enabled": True,
"default_allowed_updates": ["price"],
"products": [
{ product: 'prod_123', prices: ['price_123a','price_123b']},
{ product: 'prod_456', prices: ['price_456a','price_456b']},
],
},