<p>How can I return the available store currencies using the Element API? I think it uses  <code>craft\commerce\Plugin::getInstance()-&gt;getCurrencies();</code>but unsure how to go about creating an endpoint for this?</p>

CC BY-SA 4.0
2019-08-13T00:01:12.237Z
Currencies (and stores) aren't an "element" in Craft (like an Entry, Product, etc.).  Is the endpoint going to the in the context of an actual element?
Brad Bell
CC BY-SA 4.0
2019-08-16T14:44:01.623Z
Ah that makes sense. I was looking to pull in the available currencies to make a currency dropdown, and allow the user to switch currencies (POSTing the new currency to the backend)
Jai Sandhu
<plugin-craftcommerce>
Getting Store Currencies Using Element API and Craft 3
# Getting Store Currencies Using Element API and Craft 3

(Asked by: username_0 on 2019-08-12)

How can I return the available store currencies using the Element API? I think it uses `craft\commerce\Plugin::getInstance()->getCurrencies();`but unsure how to go about creating an endpoint for this?

**Tags:** plugin-craftcommerce
> **Comments:**
> **username_1**: Currencies (and stores) aren't an "element" in Craft (like an Entry, Product, etc.).  Is the endpoint going to the in the context of an actual element?  
> **username_0**: Ah that makes sense. I was looking to pull in the available currencies to make a currency dropdown, and allow the user to switch currencies (POSTing the new currency to the backend)  

---

## 0 answers

