» Currency GET API Documentation

Getting All Currencies

Endpoint: GET /admin/currencies

Purpose

The GET /admin/currencies endpoint retrieves a list of available currencies along with their details, including the country they belong to, their currency codes, symbols, and other properties such as rounding rules and decimal precision. The response also includes pagination information for handling large datasets.

Path Parameters

No path parameters for this endpoint.

Query Parameters

Parameter
Type
Description
limit
integer
Number of currencies per request.
offset
integer
Starting point for pagination. 
order_by
string
Field to sort results by.
direction
string
Sort order by ascending or descending.

Use Case

This endpoint is useful for applications that need to display, manage, or process different currencies. It allows fetching a list of supported currencies along with details such as currency symbols, codes, and rounding rules. Developers can use this data to populate dropdown menus for currency selection, implement currency-based transaction calculations, or configure currency-related settings in an admin panel. Additionally, the pagination feature ensures efficient handling of large datasets by allowing the retrieval of currency data in smaller, manageable chunks.

Request Body

No data is required for the request body.

Response

The response contains a list of currencies with details such as their name, ISO code, symbol, rounding rules, and precision. It also includes a pagination object to navigate through multiple pages of records.

GET
https://wcapi.mywebcommander.com/api/v4/admin/currencies
Try It Out
{
    "CURRENCIES": [
        {
            "ID": "CURRENCY_ID",
            "NAME": "CURRENCY_NAME",
            "CODE": "CURRENCY_CODE",
            "COUNTRY": {
                "ID": "COUNTRY_ID",
                "NAME": "COUNTRY_NAME",
                "CODE": "COUNTRY_CODE"
            },
            "SYMBOL": "CURRENCY_SYMBOL",
            "ACTIVE": "IS_ACTIVE",
            "ROUNDING": "ROUNDING_TYPE",
            "PRECISION": "DECIMAL_PRECISION",
            "UPDATED_AT": "LAST_UPDATED_TIMESTAMP"
        },
        {
            "ID": "CURRENCY_ID",
            "NAME": "CURRENCY_NAME",
            "CODE": "CURRENCY_CODE",
            "COUNTRY": {
                "ID": "COUNTRY_ID",
                "NAME": "COUNTRY_NAME",
                "CODE": "COUNTRY_CODE"
            },
            "SYMBOL": "CURRENCY_SYMBOL",
            "ACTIVE": "IS_ACTIVE",
            "ROUNDING": "ROUNDING_TYPE",
            "PRECISION": "DECIMAL_PRECISION",
            "UPDATED_AT": "LAST_UPDATED_TIMESTAMP"
        }
    ],
    "PAGINATION": {
        "RECORDS": "TOTAL_RECORDS",
        "LIMIT": "PAGE_LIMIT",
        "OFFSET": "PAGE_OFFSET",
        "PREVIOUS_PAGE": "PREVIOUS_PAGE_URL",
        "NEXT_PAGE": "NEXT_PAGE_URL"
    }
}

Getting Specific Currency Details

Endpoint: GET /admin/currencies/{currency_id}

Purpose

The /admin/currencies/{currency_id} endpoint retrieves details of a specific currency based on the provided currency_id. The response includes information such as the currency name, ISO code, symbol, country association, rounding rules, precision, and status.

Path Parameters

ParameterTypeDescription
currency_idintegerThe unique identifier of the currency to retrieve.

Query Parameters

This endpoint does not have any query parameters.

Use Case

This endpoint is useful for applications that require detailed information about a specific currency. It can be used to display currency details in financial dashboards, support currency-based transactions, or configure settings related to a particular currency in an admin panel. By fetching a single currency, developers can ensure precise data retrieval without querying the entire list of currencies.

Request Body

No data is required for the request body.

Response

The response contains a currency object with details such as its name, code, country, symbol, rounding rules, precision, and status.

GET
https://wcapi.mywebcommander.com/api/v4/admin/currencies/{currency_id}
Try It Out
{
    "CURRENCY": {
        "ID": "CURRENCY_ID",
        "NAME": "CURRENCY_NAME",
        "CODE": "CURRENCY_CODE",
        "COUNTRY": {
            "ID": "COUNTRY_ID",
            "NAME": "COUNTRY_NAME",
            "CODE": "COUNTRY_CODE"
        },
        "SYMBOL": "CURRENCY_SYMBOL",
        "ACTIVE": "IS_ACTIVE",
        "ROUNDING": "ROUNDING_TYPE",
        "PRECISION": "DECIMAL_PRECISION",
        "UPDATED_AT": "LAST_UPDATED_TIMESTAMP"
    }
}