Currency Rate

The currency rate record is defined in the listAcct (accounting) XSD.

The currency rate record is the same record that appears as the Exchange Rate record in the UI (see figure). In the UI, access this record by going to Lists > Accounting > Currency Exchange Rates > New.

Note:

The Multiple Currencies feature must be enabled in your account before using this record. For information on enabling this feature, see Enabling the Multiple Currencies Feature.

The exchange rate record in the UI.

In SOAP web services, you can add new currency rate records, but you cannot update them. That is, after added the record, you cannot use any of the update operations to update the record. Update operations include update, updateList, upsert, and upsertList.

After adding a currency rate record, your data will appear in the Currency Exchange Rates table (see below).

Currency exchange rates in the NetSuite UI.

In SOAP web services you must use the getCurrencyRate operation to get the exchange rate between two currencies based on a certain date. (See getCurrencyRate for more information on using this operation.)

Note that in both the UI and in SOAP web services, the Exchange Rate (exchangeRate) field is a create-time-only field that is used to specify the initial exchange rate with respect to the base currency. After the initial exchange rate value is set, this value does not get updated to reflect real-time exchange rates. Therefore, if you were to attempt to get today’s current exchange rate, the value returned could be inaccurate.

Note:

The Previous Effective Date and the Previous Exchange Rate fields are not currently available in SOAP web services.

Supported Operations

The following operations can be used with the currency rate record.

add | addList | delete | deleteList | get | getList | getCurrencyRate | search | getDeleted

Note:

You can also use the asynchronous equivalents of SOAP web services list operations. For information about asynchronous operations, see SOAP Web Services Asynchronous Operations. For more information about request processing, see Synchronous Versus Asynchronous Request Processing.

Field Definitions

The SOAP Schema Browser includes definitions for all body fields, sublist fields, search filters, and search joins available to this record. For details, see the SOAP Schema Browser’s currency reference page.

Note:

For information on using the SOAP Schema Browser, see SOAP Schema Browser.

Usage Notes

The follow sample shows how to add a currency rate record through SOAP web services.

Code Sample

Java

              // USD -> GBP, from tomorrow, with rate 1.4488
   public void addCurrencyRate() throws Exception
   {
      this.login();
 
      RecordRef usd = new RecordRef();
      usd.setInternalId("1");
      usd.setType(RecordType.currency);
 
      RecordRef gbp = new RecordRef();
      gbp.setInternalId("2");
      gbp.setType(RecordType.currency);
 
      com.netsuite.devtools.lists.accounting.CurrencyRate crs = new com.netsuite.devtools.lists.accounting.CurrencyRate();
      crs.setBaseCurrency(usd);
      crs.setTransactionCurrency(gbp);
      crs.setExchangeRate(1.4488D);
 
      Calendar cal = Calendar.getInstance();
      cal.add(Calendar.DAY_OF_YEAR, +1);   //tomorrow
      crs.setEffectiveDate(cal);
 
      _port.add(crs);
   } 

        

SOAP 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>
        <ns1:passport soapenv:mustUnderstand="0" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" xmlns:ns1="urn:messages_2017_1.platform.webservices.netsuite.com">
            <ns2:email xmlns:ns2="urn:core_2017_1.platform.webservices.netsuite.com">email@netsuite.com</ns2:email>
            <ns3:password xmlns:ns3="urn:core_2017_1.platform.webservices.netsuite.com">*******</ns3:password>
            <ns4:account xmlns:ns4="urn:core_2017_1.platform.webservices.netsuite.com">1234567</ns4:account>
            <ns5:role internalId="37" xmlns:ns5="urn:core_2017_1.platform.webservices.netsuite.com"/>
        </ns1:passport>
    </soapenv:Header>
    <soapenv:Body>
        <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
            <record xsi:type="ns6:CurrencyRate" xmlns:ns6="urn:accounting_2017_1.lists.webservices.netsuite.com">
                <ns6:baseCurrency xsi:type="ns7:RecordRef" type="currency" internalId="1" xmlns:ns7="urn:core_2017_1.platform.webservices.netsuite.com"/>
                <ns6:transactionCurrency xsi:type="ns8:RecordRef" type="currency" internalId="2" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"/>
                <ns6:exchangeRate xsi:type="xsd:double">1.4488</ns6:exchangeRate>
                <ns6:effectiveDate xsi:type="xsd:dateTime">2012-08-11T06:50:09.038Z</ns6:effectiveDate>
            </record>
        </add>
    </soapenv:Body>
</soapenv:Envelope> 

        

SOAP Response

          <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_2017_1.platform.webservices.netsuite.com">
            <platformMsgs:nsId>WEBSERVICES_1326288_080920122566427461899365710_9bfa26bd40b8</platformMsgs:nsId>
        </platformMsgs:documentInfo>
    </soapenv:Header>
    <soapenv:Body>
        <addResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
            <writeResponse>
                <platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
                <baseRef xsi:type="platformCore:RecordRef" type="currencyRate" internalId="58" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
            </writeResponse>
        </addResponse>
    </soapenv:Body>
</soapenv:Envelope> 

        

Related Topics

Lists
Other Lists
How to Use the SOAP Web Services Records Help
SOAP Web Services Supported Records
SOAP Schema Browser
SuiteTalk SOAP Web Services Platform Overview

General Notices