Search...
listCurrencies( )
Returns an array of currencies. The array lists all currencies for which Wix supports conversion and their symbols.
Admin Method
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Authorization
Request
This endpoint does not take any parameters
Response Object
NAME
TYPE
DESCRIPTION
currencies
Array<
Currency
>Supported currencies.
Status/Error Codes
Was this helpful?
Get all supported currencies (dashboard page code)
Copy Code
1import { currencies } from 'wix-ecom.v2';23currencies.listCurrencies()4 .then((listOfAllCurrencies) => {5 const firstCurrencyCode = listOfAllCurrencies[0].code;6 const firstCurrencyCSymbol = listOfAllCurrencies[0].symbol;7 });89/*10 * Promise resolves to:11 * {12 * "currencies": [13 * {"code": "BIF", "symbol": "FBu"},14 * {"code": "CVE", "symbol": "$"},15 * {"code": "KMF", "symbol": "CF"}16 * ]17 * }18 */
Get all supported currencies (export from backend code)
Copy Code
1import { Permissions, webMethod } from 'wix-web-module';2import { currencies } from 'wix-ecom.v2';34export const listCurrencies = webMethod(Permissions.Anyone, async () => {5 try {6 const listOfAllCurrencies = await currencies.listCurrencies();7 const firstCurrencyCode = listOfAllCurrencies[0].code;8 const firstCurrencyCSymbol = listOfAllCurrencies[0].symbol;910 return listOfAllCurrencies;11 } catch (error) {12 console.error(error);13 // Handle the error14 }15});1617listCurrencies()18 .then((listOfAllCurrencies) => {19 const firstCurrencyCode = listOfAllCurrencies[0].code;20 const firstCurrencyCSymbol = listOfAllCurrencies[0].symbol;21 });2223/*24 * Promise resolves to:25 * {26 * "currencies": [27 * {"code": "BIF", "symbol": "FBu"},28 * {"code": "CVE", "symbol": "$"},29 * {"code": "KMF", "symbol": "CF"}30 * ]31 * }32 */33