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.

Syntax

function listCurrencies(): Promise<ListCurrenciesResponse>

listCurrencies Parameters

This function does not take any parameters.

Returns

Return Type:

Promise<
ListCurrenciesResponse
>
NAME
TYPE
DESCRIPTION
currencies
Array<
Currency
>

Supported currencies.

Was this helpful?

Get all supported currencies (dashboard page code)

Copy Code
1import { currencies } from 'wix-ecom.v2';
2
3currencies.listCurrencies()
4 .then((listOfAllCurrencies) => {
5 const firstCurrencyCode = listOfAllCurrencies[0].code;
6 const firstCurrencyCSymbol = listOfAllCurrencies[0].symbol;
7 });
8
9/*
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';
3
4export 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;
9
10 return listOfAllCurrencies;
11 } catch (error) {
12 console.error(error);
13 // Handle the error
14 }
15});
16
17listCurrencies()
18 .then((listOfAllCurrencies) => {
19 const firstCurrencyCode = listOfAllCurrencies[0].code;
20 const firstCurrencyCSymbol = listOfAllCurrencies[0].symbol;
21 });
22
23/*
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