Skip to main content

Currency conversion enrichment

This enrichment uses Open Exchange Rates to convert the currencies used in transactions. It requires an Open Exchange Rates.

When transactional data is collected in multiple currencies, it can be useful to convert it in the one that is used for reporting for instance. This could help to lower discrepancies when reporting revenue amounts across multiple currencies.

The conversion is done by the enrich job at processing time with Open Exchange Rates API so that it can be stored directly with the right currency in the database.

Configuration

Testing with Micro

Unsure if your enrichment configuration is correct or works as expected? You can easily test it using Snowplow Micro on your machine. Follow the Micro usage guide to set up Micro and configure it to use your enrichment.

FieldDescription
accountTypeLevel of Open Exchange Rates account. Must be “developer”, “enterprise”, or “unlimited”.
apiKeyOpen Exchange Rates API key
baseCurrencyCurrency to convert all transaction values to
rateAtDetermines which exchange rate will be used. Currently only “EOD_PRIOR” is supported, meaning that the enrichment uses the exchange rate from the end of the previous day.

Input

This enrichment uses the following fields :

  • tr_currency
  • tr_total
  • tr_tax
  • tr_shipping
  • ti_currency
  • ti_price

Output

This enrichment updates the following fields of the atomic event :

FieldPurpose
base_currencyBase currency code according to ISO_4217
tr_total_baseTotal amount of transaction in base currency
tr_tax_baseTax applied in base currency
tr_shipping_baseShipping cost in base currency
ti_price_baseItem price in base currency
Was this page helpful?