#Mustafa

1 messages · Page 1 of 1 (latest)

bitter torrentBOT
magic briar
#

hello! give me a second to get back to you, looking at it now!

random hare
#

Thanks Alex

magic briar
#

do you have the exact request where you've created the customer portal? Can you share the request id for that?

random hare
#

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'
magic briar
random hare
#

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"
}
magic briar
#

have you gone through the document link which i shared?

random hare
#

Sorry I missed it, let me check

#

Hi,
This is the request ID in which I am creating session = req_g85a4h8CJuABle

magic briar
#

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

random hare
#

Yes, I cancelled the subscription for this customer during trial phase.

#

Now, I want to allow the customer to renew the plan

magic briar
#

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

random hare
#

Got it.

#

One quick question

#

Like this customer with cancelled subscription had a free trial, can we limit customer to one free trial only?

magic briar
#

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

random hare
#

Got it