#tree-of-life_api

1 messages ¡ Page 1 of 1 (latest)

fallen coralBOT
#

👋 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/1277511787561877619

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

twin jungle
#

when i do this

#
        subsession = stripe.SubscriptionItem.modify(
          'sub_1Prw8BSJIEFbQRuHmHfRQ3JQ',
          price='price_1PrvKeSJIEFbQRuHbnkGOOSb'
        )
#

what is the issue?

#

subscription id is correct

arctic cloak
#

can you paste the request id in that screenshot here? the one that starts with the prefix req_

twin jungle
#

this code work fine stripe.Subscription.retrieve('sub_1Prw8BSJIEFbQRuHmHfRQ3JQ')

arctic cloak
#

can you paste the request id in the previous screenshot here? the one that starts with the prefix req_

twin jungle
#
INFO:stripe:message='Request to Stripe api' method=post url=https://api.stripe.com/v1/subscription_items/sub_1Prw8BSJIEFbQRuHmHfRQ3JQ
INFO:stripe:message='Stripe API response' path=https://api.stripe.com/v1/subscription_items/sub_1Prw8BSJIEFbQRuHmHfRQ3JQ response_code=404
INFO:stripe:error_code=None error_message='Invalid subscription_item id: sub_1Prw8BSJIEFbQRuHmHfRQ3JQ' error_param=None error_type=invalid_request_error message='Stripe API error received'
  File "Z:\software\python11\Lib\site-packages\stripe\_subscription_item.py", line 635, in modify
    cls._static_request(
  File "Z:\software\python11\Lib\site-packages\stripe\_api_resource.py", line 177, in _static_request
    return _APIRequestor._global_instance().request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Z:\software\python11\Lib\site-packages\stripe\_api_requestor.py", line 196, in request
    resp = requestor._interpret_response(rbody, rcode, rheaders)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Z:\software\python11\Lib\site-packages\stripe\_api_requestor.py", line 732, in _interpret_response
    self.handle_error_response(rbody, rcode, resp.data, rheaders)
  File "Z:\software\python11\Lib\site-packages\stripe\_api_requestor.py", line 321, in handle_error_response
    raise err
stripe._error.InvalidRequestError: Request req_uN9kylh5nQaLxl: Invalid subscription_item id: sub_1Prw8BSJIEFbQRuHmHfRQ3JQ```
fallen coralBOT
arctic cloak
#

This code is to modify a SubscriptionItem

stripe.SubscriptionItem.modify(
          'sub_1Prw8BSJIEFbQRuHmHfRQ3JQ',
          price='price_1PrvKeSJIEFbQRuHbnkGOOSb'
 )
#

a SubscriptionItem starts with the prefix si_

twin jungle
#

thnx for figure it out alex

#

i have 2 more question

#
import stripe
stripe.api_key = "sk_test_tR3PYbcVNZZ796tH88S4VQ2u"

stripe.SubscriptionItem.modify(
  "si_xxxxxxxxx",
  price="{{NEW_PRICE_ID}}",
)
#what is the different between this two

stripe.Subscription.modify(
  "sub_xxxxxxxxx",
  items=[{"id": "{{SUB_ITEM_ID}}", "deleted": True}, {"price": "{{NEW_PRICE_ID}}"}],
)
#

i do understand in second one u delete the previous subscription but what make it different with first one

#

and ```py
stripe.checkout.Session.modify("cs_test_a1qT06ElW8z7aUd3IdjaXl74tDpmNoFluuaBjKVedNv79ZpvY96GvvZefZ",metadata={'order_customer':None,'order_customer_email':None})

#

anyone their?

light bolt
#

Hi @twin jungle I'm taking over this thread

twin jungle
#

sure bro i just need these two question knowledge

light bolt
twin jungle
#

i didnt understand why u need request id

light bolt
#

So that I can help you troubleshoot

light bolt
#

You mentioned the email is blank, so that I want to see what request you made earlier.

twin jungle
#

ah

#

give me 5min i wil be back

fallen coralBOT
twin jungle
#

alright back

#

do i create a session ? before going to log

light bolt
#

I don't need you to create a new session, you mentioned that an update made the "previous session email to blank ", so that I just need the ID of the update request.

twin jungle
#

sec i will just create an session and send u its id u modify it and make it email and other detail to blank

#

req_rbrVNVxt8bNHza

#

so how do we rest its default value ?

light bolt
#

What default value?

twin jungle
#

like email address to null

#

that the problem i dont want to have it carry email and address i am controlling it from frontend

#

morever i need to create new seassion just for that was worried if wasting those session just for email and address

light bolt
#

req_rbrVNVxt8bNHza isn't an update request, can you share with me the ID of the request that you made to update?

twin jungle
#

req_xCSflGjKPu4JoT

light bolt
#

req_xCSflGjKPu4JoT is the checkout session creation request, not the update request that you mentioned earlier.

light bolt
twin jungle
#

i read it earlier as well but didnt understand what it is

light bolt
#

which part you don't unederstand?

twin jungle
#

what is metadata for ?

#

what does it modifying ?

light bolt
twin jungle
#

forget it i dont need to understand it either

light bolt
#

I'd suggest you read the text

twin jungle
#

yah i read it

#

but not much detail mention what parameter to pass

#

anyway forget about it since it cant update email and address so no use to me

light bolt
#

They are the same

twin jungle
#

ah i got thnx alot

#

thank you jack and alex ❤️ have a nice day

#

wait i forget 1 thing to ask sorry

#

how much hour or day session remain valid? once been created

light bolt
twin jungle
#

so we dont need to have to expire it at all since it automatically does after 24hr

#

that good

light bolt
#

You can set it shorter if you want

#

and you can also manually expire one.

twin jungle
#

yah u right can make it little shorter would be better

#

1hr would be decent

#

thnx >.</ now i am done