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?

  • 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 Aug 13 at 0:01
  • 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) – user2315552 Aug 16 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.