#nooneyouknow.

1 messages ยท Page 1 of 1 (latest)

silver ploverBOT
mortal hollow
#

Hi there!

#

no you would need to create a new Price instead.

unreal shadow
#

is there a way to create a new price with all of currencies loaded?

#

or do i have to do it through the web interface manually?

mortal hollow
#

what does that mean?

unreal shadow
#

so one price can have multiple values for currencies right?

#

is that possible via the api?

#

or do i have to do it via the web interface?

mortal hollow
unreal shadow
#

ah okay thank you, i'll give that a go

mortal hollow
#

Happy to help ๐Ÿ™‚

unreal shadow
#
stripe.Price.create(
  currency="usd",
  unit_amount=499,
  recurring={"interval": "week"},
  product="",
  currency_options={
    "GBP": 499
  }
)

doing this for some reason causes a InvalidRequestError

if i remove currency_options it's fine, is the currency option dictionary wrong?

mortal hollow
#

that's wrong. it should be currency_options.<currency>.custom_unit_amount.

unreal shadow
#

so what would that look like as a dictionary then?

mortal hollow
#

in JavaScript it would be something like:

currency_options: {
  GBP: {
   custom_unit_amount: 499
  }
}
unreal shadow
#

yeah i tried that and still the same error

#
stripe.Price.create(
  currency="usd",
  unit_amount=499,
  recurring={"interval": "week"},
  product="",
  currency_options={
    "GBP": {
      "custom_unit_amount": 499
    }  
  }
)
mortal hollow
#

what language is this? Python?

unreal shadow
#

yes

mortal hollow
unreal shadow
#

req_JbupyqQwOwt99O

mortal hollow
#

sorry I was wrong. it's currency_options.<currency>.unit_amount you should use

#

so:

  currency_options={
    "GBP": {
      "unit_amount": 499
    }  
  }
unreal shadow
#

ah yeah just stumbled upon the same thing myself, weirdly also currency codes in dictionaries must be lowercase ๐Ÿ˜•

thanks so much for your help

#
stripe.Price.create(
  currency="usd",
  unit_amount=499,
  recurring={"interval": "week"},
  product="",
  currency_options={
    "gbp": {
      "unit_amount": 499
    }  
  }
)
mortal hollow
#

ha yes maybe