#momovsky_api

1 messages ยท Page 1 of 1 (latest)

zenith sedgeBOT
#

๐Ÿ‘‹ 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/1230133287024853033

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

hybrid ploverBOT
chilly venture
#

Here is my code, basically. Can't realize what am I doing wrong:

data = {'items': [{'deleted': True, 'id': '123'}, {'price': '123'}], 'proration_behavior': 'none'}
stripe.Subscription.modify(subscription_id=123, **data)
eternal tapir
#

hi there!

chilly venture
#

Sure, req_kev9lzJxKzMnaJ

#

post body is shown as

{
  "items": {
    "0": {
      "id": "si_PwQ4xnCi6k7QXv",
      "deleted": "True"
    },
    "1": {
      "price": "price_1OZD11HZBjdJVnGyDLW1ULp5"
    }
  }
}
eternal tapir
#

I confirm that no parameter was set here. I'm not a Python expert, byt can you try something like this instead:

stripe.Subscription.modify("sub_xxx",
  proration_behavior="none",
  items=[ ... ],
)
chilly venture
#

I can see in my logs that final data formed for request looks like this (ids omitted for convenience):
'items[0][deleted]=True&items[0][id]=123&items[1][price]=123&proration_behavior=none'
Does this look correct?

eternal tapir
#

looks correct to me yes

chilly venture
#

๐Ÿค” Order does not matter also?

#

I mean, if proration_behavior comes before or after items - it should not matter?

eternal tapir
#

it should not matter no.

#

have you tried the solution I suggested above?

chilly venture
#

I'm in process right now, will come back once I check it.