I often know a foreign cost, such as a foreign filing fee, in a local currency, but not an equivalent US dollar (USD) amount. For example, my foreign associates often quote or estimate costs in their local currency. I can store the local-currency cost in a custom matter field or a task field (maybe {Task.BudgetExpense}), but I would like to report it to my client in USD equivalent.
When generating a reporting letter or a letter requesting instructions (such as for requesting examination), it would be handy if AppColl provided a mechanism to call an API to convert a foreign currency to USD. Several such APIs exist, and some provide several hundred free conversions per month. (See, for example, Currency Beacon, Currency API, and Exchange Rates API.)
Please consider adding a field that calls an external API, for example something along the lines of:
{CallAPI.https://api.currencybeacon.com/v1/convert?api_key=abcdefghijklmnopqrst&from={Matter.CurrencySymbol}&to=USD&amount={Task.BudgetExpense}("value",0.00)}
This syntax includes the URL of the API and four parameters to pass to the API (each parameter begins with a question mark): an API key (assigned to a user when the user signs up for an account), a "from" currency symbol (in this example, extracted from a custom matter field), a "to" currency symbol, and an amount (extracted from a task field).
Most of these APIs return values in JSON. The parenthetical in my suggested syntax provides information on what part of the returned JSON values AppColl should return for its field. In this example, the API returns a bunch of things, including the converted USD as "value" followed by a floating point number (ex, "value 62.156").
"0.00" in the parenthetical is the standard AppColl number formatting specification (return a floating point number, with two decimal places).
If AppColl could pull this off, it might have wider applicability, because there may be other useful APIs that could be called, such as EPO OPS (the European Patent Office's Open Patent Services API). The key is for the syntax to allow the AppColl user to: (1) call a URL, including passing parameters, some of which may be extracted from fields, and (2) give the AppColl field evaluator a hint about what to return from the JSON values.
I know this is a big ask, but if we don't dream big, we won't be able to succeed spectacularly.
Edit 1: Alternatively, AppColl could do the foreign currency exchange rate conversion and return the equivalent USD in response to a "ToUSD" text formatting command (somewhat like the "ToUpper" text formatting command). I suggest syntax something like:
{Task.BudgetExpense(ToUSD, {Matter.CurrencySymbol}, 0.00)}
Of course, AppColl would have to subscribe to a foreign exchange API, but the cost would be minimal.
Edit 3: AppColl could assume the "from" currency symbol based on the country code of the matter, although this might not be a safe assumption. For example, my Malaysian cases are handled through an Australian associate, so I pay in AUD, not MYR.
Edit 2: In case anyone wants to try any of the free foreign exchange rate APIs listed above or others, here is a hint: Many of them limit HTTPS requests to paying customers, and they require free accounts to call the APIs with plain HTTP requests. So, ensure your request is in HTTP, not HTTPS.
But, some browsers may be set to "HTTPS-only." In this case, the browser will change all HTTP requests into HTTPS requests behind your back. Thus, the browser will change an HTTP API call into an HTTPS request, which will fail with an "unauthorized" or similar error.
If this happens, add an exception URL to the browser's list (forcing the browser not to change HTTP to HTTPS request for the excepted URL). For example, Firefox > Settings... or Preferences (depending on OS) > Privacy & Security > (scroll to HTTPS-Only Mode) > Manage Exceptions ... > (enter URL of the API in "Address of website" and click "Turn off") > Save Changes.
Thanks,
George