Information Services at Web-Merchant/WM

Certain information is available from the "info" servlet on the Web-Merchant/WM server. At the moment the only service available is to return the current exchange rates. Other services will follow as required.

Exchange Rates

The exchange rates used by Web-Merchant/WM are updated every 24 hours at midnight GMT. These rates are then guaranteed for the next 24 hours for all transactions through Web-Merchant/WM. You can obtain a file containing the exchange rates that are valid for the current day or, after 18:00 GMT, you can request the file for the next day. To obtain the latest rates file request the following URL:

https://select.WM.com/wcc/info?op=rates&instId=<inst Id>&infoPW=<password>
Hence, if your installation ID is 1234 and your info password is "abcd", the URL is:
https://select.WM.com/wcc/info?op=rates&instId=1234&infoPW=abcd
The infoPW is set up via the Web-Merchant/WM Administration Server (WAS) and is initially left blank. Hence you can omit the infoPW parameter if you have not specified a password via WAS.

You can specify different values for "op" to obtain different exchange rates files as follows:

op=rates or op=rates-latest
returns the latest available exchange rates. This is usually for the current day but if any data is missing then data from previous days is used and the field "allRatesCurrent" is set to false. "allRatesCurrent" is true if all the data is for the current day.
op=rates-today
returns the rates for today. If any or all of the data is missing then an error message is returned. "allRatesCurrent" is always true.
op=rates-tomorrow
returns the rates for tomorrow. If any or all of the data is missing then an error message is returned. This data is only available after 18:00 GMT and is valid from the next midnight GMT. "allRatesCurrent" is always true.

Response Formats

If a rates file is successfully generated then it is returned as content-type "text/plain" and has the following format:

#Exchange rates for installation 1234
#Fri Oct 01 15:53:51 GMT 1999
DEM_CHF=0.8293301380534893
DEM_NLG=1.1267390120015601
DEM_DEM=1.0
DEM_CAD=0.7811273640705966
rateDateString=1999-10-01
DEM_BEF=20.625463396943164
rateDateMillis=938736000000
allRatesCurrent=true
DEM_FRF=3.353854814359919
DEM_GBP=0.3364112383046616
This is a standard Java properties file format. The lines prefixed by # are comments and are always present at the top of the file. The date in the comment at the head of the file is the date and time of generation of this file.

All other lines are of the form:

<property name>=<value>
The property names for the exchange rates are given as:
<source ISO code>_<destination ISO code>
For example:

DEM_GBP=0.3364112383046616
means that to convert from Deutschmark to Pounds Sterling you must multiply by the given number. Rates are given for converting from all your settlement currencies to all your acquisition currencies.

Note that the property name=value lines are generated in a random order so you cannot rely on any particular ordering of the items.

The property "rateDateMillis" is the date and time from which the rates are valid (always a midnight GMT), expressed as milliseconds since the start of 1970. This is the standard system date in Java. "rateDateString" expresses this date as "yyyy-mm-dd". The rates are valid for 24 hours (i.e. until the next midnight GMT).

The property "allRatesCurrent" is set to true if the rates are all for the date requested. If some rates are from a previous day then it is set to false. This only happens if you request op=rates or op=rates-latest.

If a rates file cannot be generated then the content-type returned is text/html and starts with the string "Error:". Hence you can check for an error either by testing the content type or parsing the first line of the content. The rest of the content for an error is a human-readable description of the problem.

Automatic Exchange Rate Updates

If you are using Select Pro then you can have the exchange rates sent to you automatically every 24 hours. This facility is described in the Select Pro documentation.
Back to contents page

$Revision: 1.9 $