Umbraco Commerce
CMSCloudHeartcoreDXP
14.latest
14.latest
  • Umbraco Commerce Documentation
  • Release Notes
    • v14.0.0
    • v14.0.0-Alpha
  • Commerce Products
    • Commerce Packages
    • Commerce Payment Providers
    • Commerce Shipping Providers
  • Getting Started
    • Requirements
    • Installation
    • Licensing
    • Configuration
    • User Interface
  • Upgrading
    • Upgrading Umbraco Commerce
    • Version Specific Upgrade Notes
    • Migrate from Vendr to Umbraco Commerce
      • Migrate Umbraco Commerce Checkout
      • Migrate custom Payment Providers
  • How-To Guides
    • Overview
    • Configure SQLite support
    • Limit Order Line Quantity
    • Use an Alternative Database for Umbraco Commerce Tables
    • Add item to Cart
    • Update Cart
    • Delete item from Cart
  • Key Concepts
    • Get to know the main features
    • Base Currency
    • Calculators
    • Currency Exchange Rate Service Provider
    • Dependency Injection
    • Discount Rules / Rewards
    • Events
      • List of validation events
      • List of notification events
    • Fluent API
    • Order Calculation State
    • Payment Forms
    • Payment Providers
    • Pipelines
    • Price/Amount Adjustments
    • Price Freezing
    • Product Adapters
    • Product Bundles
    • Product Variants
      • Complex Variants
    • Properties
    • ReadOnly and Writable Entities
    • Sales Tax Providers
    • Search Specifications
    • Settings Objects
    • Shipping Package Factories
    • Shipping Providers
    • Shipping Range/Rate Providers
    • Tax Sources
    • UI Extensions
      • Analytics Widgets
      • Entity Quick Actions
      • Order Properties
      • Order Collection Properties
      • Order Line Properties
      • Store Menu Items
    • Umbraco Properties
    • Unit of Work
    • Umbraco Commerce Builder
    • Webhooks
  • Reference
    • Stores
    • Shipping
      • Fixed Rate Shipping
      • Dynamic Rate Shipping
      • Realtime Rate Shipping
    • Taxes
      • Fixed Tax Rates
      • Calculated Tax Rates
    • Storefront API
      • Endpoints
        • Order
        • Checkout
        • Product
        • Customer
        • Store
        • Currency
        • Country
        • Payment method
        • Shipping method
        • Content
    • Management API
    • Go behind the scenes
    • Telemetry
  • Tutorials
    • Overview
    • Getting started with Umbraco Commerce: The Backoffice
Powered by GitBook
On this page
  • Currency Exchange Rate Services
  • Historic Orders

Was this helpful?

Edit on GitHub
Export as PDF
  1. Key Concepts

Currency Exchange Rate Service Provider

Currency Exchange Rate Service Provider for currency conversion in Umbraco Commerce.

PreviousCalculatorsNextDependency Injection

Last updated 9 months ago

Was this helpful?

Umbraco Commerce can track the current exchange rate of orders compared to the stores . This is necessary to produce reports and analytics in a single currency.

Currency Exchange Rate Services

Umbraco Commerce uses an ICurrencyExchangeRateService to retrieve the most up-to-date rate and track the current exchange rate. This is done for each order.

Out of the box, Umbraco Commerce comes with a number of available services you can choose to use. Some are free services, while others require a paid subscription.

  • ExchangeRateHostCurrencyExchangeRateService uses the free API.

  • ExchangeRatesApiCurrencyExchangeRateService uses the free API.

  • FixerCurrencyExchangeRateService uses the API which is a reliable paid option (with a reasonable free plan).

  • CurrencyLayerCurrencyExchangeRateService uses the API which is another reliable paid option (with a reasonable free plan).

If you are using multiple currencies in your store then you should sign up for and configure an exchange rate service to ensure accurate reporting. You can do so via the approach. This is used to override the default service configuration. For services that require configuration to be passed in, such as service API keys, you'll need to use the factory-based override as follows:

public static class UmbracoCommerceUmbracoBuilderExtensions
{
    public static IUmbracoCommerceBuilder AddMyServices(IUmbracoCommerceBuilder builder)
    {
        // Register the fixer tax service with your API key
        builder.Services.AddUnique<ICurrencyExchangeRateService>(new FixerCurrencyExchangeRateService("YOUR_FIXER_API_KEY"));
        
        // Return the builder to continue the chain
        return builder;
    }
}

If you have multiple currencies enabled but have not configured an exchange rate service, Umbraco Commerce will display a warning. This alert appears on the store dashboard and analytics section, indicating that the reported data may be inaccurate.

Historic Orders

Umbraco Commerce has a background service that will attempt to ensure that all historic orders without an exchange rate defined get updated. This is done in case the third-party APIs fail and we need a method of cleaning data. It is also done in case the store base currency is ever changed. In this case, we need to re-process all orders again with the newly selected base currency.

The currency exchange rate background task will run once every 24 hours or after 20 seconds after an app pool recycle.

Base Currency
exchangerate.host
exchangeratesapi.io
fixer.io
currencylayer.com
dependency injection
No Exchange Rate Service Provider Warning