diff --git a/BTCPayServer/Controllers/GreenField/GreenfieldStoreRatesConfigurationController.cs b/BTCPayServer/Controllers/GreenField/GreenfieldStoreRatesConfigurationController.cs index 6d30ca129..f92817956 100644 --- a/BTCPayServer/Controllers/GreenField/GreenfieldStoreRatesConfigurationController.cs +++ b/BTCPayServer/Controllers/GreenField/GreenfieldStoreRatesConfigurationController.cs @@ -95,8 +95,17 @@ namespace BTCPayServer.Controllers.GreenField var storeData = HttpContext.GetStoreData(); var storeBlob = storeData.GetStoreBlob(); var blob = storeBlob.GetRateSettings(fallback); - if (blob is null) + + // If fallback rates are not enabled but someone is trying to configure them, enable them automatically + if (blob is null && fallback) + { + blob = storeBlob.GetOrCreateRateSettings(fallback); + } + else if (blob is null) + { return this.CreateAPIError(404, "fallback-disabled", "The fallback rates are disabled"); + } + ValidateAndSanitizeConfiguration(configuration, storeBlob, blob); if (!ModelState.IsValid) return this.CreateValidationError(ModelState);