#nftarea

1 messages ยท Page 1 of 1 (latest)

stray zealotBOT
rancid heart
#

Hi there, you can create prices in different currencies for the same product, and you should specify the price in your customer's currency when creating a subscription.

jagged yoke
#

Yup. It's working fine using checkouts but we need to display on a page on our app

#

Is there a way I can retrieve the price in user's currency using API call?

rancid heart
jagged yoke
#

This is the plan. I am trying to get the amount from all the currencies.

#

Thanks

#

I was looking for that.

#

Thanks ๐Ÿ™Œ๐Ÿผ

rancid heart
#

No problem

jagged yoke
#

Will it work for a specific plan? I have multiple prices on a product.

rancid heart
#

Wait, so you are using Plans API, not Prices API?

jagged yoke
#

Yeah

rancid heart
jagged yoke
#

Yeah, that's what I am asking.

rancid heart
#

So I guess you need to retrieve all Plans, and filter by yourself.

jagged yoke
#

Retrieved plan contains amount for just default currency.

#

So, you mean I need to list plans with a currency and then filter the one I need?

rancid heart
#

There's no currency param in the Plan listing API, you can specify a product to retrieve all plans related to this product, and filter the currency in your own code.

jagged yoke
#

Okay. Thanks

#

Still does not work. It only shows the amount in default currency.

#

I have a plan with USD as default currency and the amount is $40. I have set Australian Dolllar as another price using multi currency which is set to say $50. When I retrieve the plan object I only get amount $40.

#

I want to get $50 if I know user's currency is AUD.

#

There's no currency param in the Plan listing API, you can specify a product to retrieve all plans related to this product, and filter the currency in your own code.
I tried doing this but plans have the amount only in default currency.

rancid heart
#

The Plan listing API returns all plans in all currencies.

#

Can you share with me the product ID?

jagged yoke
#

Sure

#

prod_K99MIpyDAIzNPR

#

This is a test product.

rancid heart
#

Hm, you were actually using Prices API, not Plans API.

jagged yoke
#

So, there is not way to get it amount in all currencies?

rancid heart
jagged yoke
#

It doesn't return anything if I pass call API like this.
Stripe::Price.list({ product: "prod_K99MIpyDAIzNPR", currency: "NZD"})

#

Maybe I am unable to make you understand what I want.

#

Thanks for the help. I will try something.

rancid heart
#

I don't see any prices in NZD, there are prices in USD and AUD, but no NZD.

jagged yoke
#

This plan has price in NZD

#

price_1M7IKyLyyYrd44AgpfEAwNw1

#

I added it using multi currencies option

#

Yeah, I think I am unable to make you understand what I want.

#

If you see in the screenshot, the plan has amount in AUD, INR and NZD. I want to get the amount in all these currencies along with the default USD amount.

rancid heart
#

Ah, I understand now

jagged yoke
#

Is it possible?

rancid heart
#

Yup, the currency_options is not included in response by default, you need to expand it.

#

Stripe::Price.list({ product: "prod_K99MIpyDAIzNPR", currency:
"NZD", expand:['currency_options']})

jagged yoke
#

Is it available on latest version only?

rancid heart
#

My mistake, it should be expand:['data.currency_options']

jagged yoke
#

Still doesn't return anything.

rancid heart
#

remove currency param

jagged yoke
#

Yeah, I tried that and got the prices. Thanks

#

Thanks for going through all this. I appreciate it a lot. Thanks Jack

rancid heart
#

I'm happy that your problem is resolved!

jagged yoke
#

When can we find documentation about the expand feature?

rancid heart
jagged yoke
#

Thanks

#

Have a great day, Jack.