getCurrencyRate SOAP Operation

Use this operation to get the exchange rate between two currencies based on a certain date. The exchange rate values you are getting 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 execute this operation must have at least View level of the Currency permission (a Lists type permission).

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/'
    xmlns:platformCore='urn:core_2021_2.platform.webservices.netsuite.com'
    xmlns:listRel='urn:relationships_2021_2.lists.webservices.netsuite.com'
    xmlns:listAcct='urn:accounting_2021_2.lists.webservices.netsuite.com'
    xmlns:platformMsgs='urn:messages_2021_2.platform.webservices.netsuite.com'>
    <soapenv:Header>
        <tokenPassport xsi:type='platformCore:TokenPassport'>
            <account xsi:type='xsd:string'>{{accountId}}</account>
            <consumerKey xsi:type='xsd:string'>{{consumerKey}}</consumerKey>
            <token xsi:type='xsd:string'>{{tokenId}}</token>
            <nonce xsi:type='xsd:string'>{{nonce}}</nonce>
            <timestamp xsi:type='xsd:long'>{{timestamp}}</timestamp>
            <signature algorithm='HMAC_SHA256' xsi:type='platformCore:TokenPassportSignature'>{{signature}}</signature>
        </tokenPassport>
    </soapenv:Header>
    <soapenv:Body>
        <getCurrencyRate xsi:type='platformMsgs:GetCurrencyRateRequest'>
            <currencyRateFilter xsi:type='platformCore:CurrencyRateFilter'>
                <baseCurrency xsi:type='platformCore:RecordRef' internalId='1' type='salesOrder'></baseCurrency>
            </currencyRateFilter>
        </getCurrencyRate>
    </soapenv:Body>
</soapenv:Envelope>

Response

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <platformMsgs:documentInfo
            xmlns:platformMsgs="urn:messages_2021_2.platform.webservices.netsuite.com">
            <platformMsgs:nsId>WEBSERVICES_TSTDRV2782962_073120231421571035146261074_9f3377</platformMsgs:nsId>
        </platformMsgs:documentInfo>
    </soapenv:Header>
    <soapenv:Body>
        <getCurrencyRateResponse
            xmlns="">
            <platformCore:getCurrencyRateResult
                xmlns:platformCore="urn:core_2021_2.platform.webservices.netsuite.com">
                <platformCore:status isSuccess="true"/>
                <platformCore:currencyRateList>
                    <platformCore:currencyRate>
                        <platformCore:baseCurrency internalId="1"/>
                        <platformCore:fromCurrency internalId="1"/>
                        <platformCore:exchangeRate>1.0</platformCore:exchangeRate>
                        <platformCore:effectiveDate>1985-04-01T00:00:00.000-08:00</platformCore:effectiveDate>
                    </platformCore:currencyRate>
                    <platformCore:currencyRate>
                        <platformCore:baseCurrency internalId="1"/>
                        <platformCore:fromCurrency internalId="2"/>
                        <platformCore:exchangeRate>2.365</platformCore:exchangeRate>
                        <platformCore:effectiveDate>1985-04-01T00:00:00.000-08:00</platformCore:effectiveDate>
                    </platformCore:currencyRate>
                    <platformCore:currencyRate>
                        <platformCore:baseCurrency internalId="1"/>
                        <platformCore:fromCurrency internalId="3"/>
                        <platformCore:exchangeRate>1.559</platformCore:exchangeRate>
                        <platformCore:effectiveDate>1985-04-01T00:00:00.000-08:00</platformCore:effectiveDate>
                    </platformCore:currencyRate>
                    <platformCore:currencyRate>
                        <platformCore:baseCurrency internalId="1"/>
                        <platformCore:fromCurrency internalId="4"/>
                        <platformCore:exchangeRate>1.509</platformCore:exchangeRate>
                        <platformCore:effectiveDate>1985-04-01T00:00:00.000-08:00</platformCore:effectiveDate>
                    </platformCore:currencyRate>
                </platformCore:currencyRateList>
            </platformCore:getCurrencyRateResult>
        </getCurrencyRateResponse>
    </soapenv:Body>
</soapenv:Envelope>

Leave a comment

Your email address will not be published. Required fields are marked *