getCurrencyRate

In SOAP web services, you use the getCurrencyRate operation to get the exchange rate between two currencies based on a certain date. The exchange rate values are those that appear in the Exchange Rate column of the Currency Exchange Rates table, which you can view at Lists > Accounting > Currency Exchange Rates.

The role used to perform this operation must have at least View level of the Currency permission (a Lists type permission).

The Multiple Currencies feature must be enabled in your account before using the getCurrencyRate operation.

SOAP Request

The following example shows the usage of the getCurrencyRate operation.

            <soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>
        <ns1:passport soapenv:mustUnderstand="0" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" xmlns:ns1="urn:messages_2025_1.platform.webservices.netsuite.com">
            <ns2:email xmlns:ns2="urn:core_2025_1.platform.webservices.netsuite.com">email@netsuite.com</ns2:email>
            <ns3:password xmlns:ns3="urn:core_2025_1.platform.webservices.netsuite.com">*******</ns3:password>
            <ns4:account xmlns:ns4="urn:core_2025_1.platform.webservices.netsuite.com">1234567</ns4:account>
            <ns5:role internalId="37" xmlns:ns5="urn:core_2025_1.platform.webservices.netsuite.com"/>
        </ns1:passport>
    </soapenv:Header>
    <soapenv:Body>
        <getCurrencyRate xmlns="urn:messages_2025_1.platform.webservices.netsuite.com">
            <currencyRateFilter>
                <ns6:baseCurrency internalId="2" xmlns:ns6="urn:core_2025_1.platform.webservices.netsuite.com"/>
                <ns7:fromCurrency internalId="1" xmlns:ns7="urn:core_2025_1.platform.webservices.netsuite.com">
                <ns8:effectiveDate xmlns:ns8="urn:core_2025_1.platform.webservices.netsuite.com">2012-08
         11T06:58:59.628Z</ns8:effectiveDate>
            </currencyRateFilter>
        </getCurrencyRate>
    </soapenv:Body>
</soapenv:Envelope> 

          

SOAP Response

The following sample shows the response to a getCurrencyRate request.

            <soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>
        <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2025_1.platform.webservices.netsuite.com">
            <platformMsgs:nsId>WEBSERVICES_1326288_08092012257172984776216537_6c7c330232bb5</platformMsgs:nsId>
        </platformMsgs:documentInfo>
    </soapenv:Header>
    <soapenv:Body>
        <getCurrencyRateResponse xmlns="urn:messages_2025_1.platform.webservices.netsuite.com">
            <platformCore:getCurrencyRateResult xmlns:platformCore="urn:core_2025_1.platform.webservices.netsuite.com">
                <platformCore:status isSuccess="true"/>
                <platformCore:currencyRateList>
                    <platformCore:currencyRate>
                        <platformCore:baseCurrency internalId="2"/>
                        <platformCore:fromCurrency internalId="1"/>
                        <platformCore:exchangeRate>0.42283298</platformCore:exchangeRate>
                        <platformCore:effectiveDate>1970-01-01T00:00:00.000-08:00</platformCore:effectiveDate>
                    </platformCore:currencyRate>
                </platformCore:currencyRateList>
            </platformCore:getCurrencyRateResult>
        </getCurrencyRateResponse>
    </soapenv:Body>
</soapenv:Envelope> 

          

REST Request

In REST web services, you can work with currency exchange rates by sending a GET request for a specific currency exchange rate record.

You must enable the Multiple Currencies feature before you can use this record through REST web services.

The following example retrieves a specific currency exchange rate record.

            GET https://test.suitetalk.api.netsuite.com/services/rest/record/v1/currencyrate/20208 

          

REST Response

The following example shows the result of the GET operation.

            {
    "links": [
        {
            "rel": "self",
            "href": "https://test.suitetalk.api.netsuite.com/services/rest/record/v1/currencyrate/20208"
        }
    ],
    "baseCurrency": {
        "links": [
            {
                "rel": "self",
                "href": "https://test.suitetalk.api.netsuite.com/services/rest/record/v1/currency/1"
            }
        ],
        "id": "1",
        "refName": "USA"
    },
    "effectiveDate": "2025-07-22",
    "exchangeRate": 1.34956,
    "fxSourceMethod": "DIRECT",
    "id": "20208",
    "lastModifiedDate": "2025-07-22T10:16:00Z",
    "transactionCurrency": {
        "links": [
            {
                "rel": "self",
                "href": "https://test.suitetalk.api.netsuite.com/services/rest/record/v1/currency/2"
            }
        ],
        "id": "2",
        "refName": "British pound"
    }
} 

          

Related Topics

General Notices