#Mustafa
1 messages · Page 1 of 1 (latest)
hello! give me a second to get back to you, looking at it now!
Thanks Alex
do you have the exact request where you've created the customer portal? Can you share the request id for that?
Sure
Is this what you are asking for?
In [14]: stripe_client.create_customer_portal_session(stripe_customer_id, configuration)
message='Request to Stripe api' method=post path=https://api.stripe.com/v1/billing_portal/sessions
message='Stripe API response' path=https://api.stripe.com/v1/billing_portal/sessions response_code=200
Out[14]: 'https://billing.stripe.com/p/session/test_YWNjdF8xSW00d0hKSVgzOUJjSEJXLF9QV1VwaUJEOUpBTmdlcXhUWHhzYWp3VVBYNzM2YlRC0100HtVzOYao'
the request id will look like req_xxx : https://stripe.com/docs/api/request_ids
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
How can I find it?
In [23]: response = client.billing_portal.Session.create(
...: customer=stripe_customer_id,
...: return_url=f"{Config.APPLICATION_FRONT_END_URL}",
...: configuration=configuration,
...: )
message='Request to Stripe api' method=post path=https://api.stripe.com/v1/billing_portal/sessions
message='Stripe API response' path=https://api.stripe.com/v1/billing_portal/sessions response_code=200
In [24]: response
Out[24]:
<Session billing_portal.session id=bps_1OhRsxJIX39BcHBWLdhTGXQI at 0x2950e34c0> JSON: {
"configuration": "bpc_1OhRNkJIX39BcHBWY3bGLSI8",
"created": 1707376743,
"customer": "cus_PWCQ5HqM9x00Mx",
"flow": null,
"id": "bps_1OhRsxJIX39BcHBWLdhTGXQI",
"livemode": false,
"locale": null,
"object": "billing_portal.session",
"on_behalf_of": null,
"return_url": "https://internal.systematicventures.com/",
"url": "https://billing.stripe.com/p/session/test_YWNjdF8xSW00d0hKSVgzOUJjSEJXLF9QV1VzRUNOR3JoNmpSRWFCWnFkazFPQVdzelpEZURn0100W6OZfk2y"
}
have you gone through the document link which i shared?
Sorry I missed it, let me check
Hi,
This is the request ID in which I am creating session = req_g85a4h8CJuABle
if you're testing it now, that customer has no active subscriptions at the moment though
the only subscription that i see on that customer is currently cancelled
Yes, I cancelled the subscription for this customer during trial phase.
Now, I want to allow the customer to renew the plan
unfortunately, that's not possible via the Customer Portal. In essence, a new Subscription needs to be created and that's not supported via the Customer Portal
Got it.
One quick question
Like this customer with cancelled subscription had a free trial, can we limit customer to one free trial only?
that logic will have to be implemented in your own application. Stripe doesn't have a feature to limit a customer to one free trial only
Got it