#nooneyouknow.
1 messages ยท Page 1 of 1 (latest)
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?
what does that mean?
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?
correct. and yes you can do the same with the API: https://stripe.com/docs/api/prices/create#create_price-currency_options
ah okay thank you, i'll give that a go
Happy to help ๐
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?
that's wrong. it should be currency_options.<currency>.custom_unit_amount.
so what would that look like as a dictionary then?
in JavaScript it would be something like:
currency_options: {
GBP: {
custom_unit_amount: 499
}
}
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
}
}
)
what language is this? Python?
yes
Can you share the request ID (req_xxx)? You can find it here https://dashboard.stripe.com/test/logs
req_JbupyqQwOwt99O
sorry I was wrong. it's currency_options.<currency>.unit_amount you should use
so:
currency_options={
"GBP": {
"unit_amount": 499
}
}
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
}
}
)
ha yes maybe