diff --git a/BTCPayServer.Client/Models/InvoiceData.cs b/BTCPayServer.Client/Models/InvoiceData.cs index 95ba3e55e..a457c3f22 100644 --- a/BTCPayServer.Client/Models/InvoiceData.cs +++ b/BTCPayServer.Client/Models/InvoiceData.cs @@ -7,6 +7,7 @@ namespace BTCPayServer.Client.Models public class InvoiceData : CreateInvoiceRequest { public string Id { get; set; } + public string StoreId { get; set; } public string CheckoutLink { get; set; } [JsonConverter(typeof(StringEnumConverter))] public InvoiceStatus Status { get; set; } diff --git a/BTCPayServer.Tests/GreenfieldAPITests.cs b/BTCPayServer.Tests/GreenfieldAPITests.cs index 3875172e2..017d5cf51 100644 --- a/BTCPayServer.Tests/GreenfieldAPITests.cs +++ b/BTCPayServer.Tests/GreenfieldAPITests.cs @@ -1019,7 +1019,7 @@ namespace BTCPayServer.Tests RedirectAutomatically = true }}); Assert.True(newInvoice.Checkout.RedirectAutomatically); - + Assert.Equal(user.StoreId, newInvoice.StoreId); //list var invoices = await viewOnly.GetInvoices(user.StoreId); diff --git a/BTCPayServer/Controllers/GreenField/InvoiceController.cs b/BTCPayServer/Controllers/GreenField/InvoiceController.cs index a78c3110f..1b3027b08 100644 --- a/BTCPayServer/Controllers/GreenField/InvoiceController.cs +++ b/BTCPayServer/Controllers/GreenField/InvoiceController.cs @@ -385,6 +385,7 @@ namespace BTCPayServer.Controllers.GreenField { return new InvoiceData() { + StoreId = entity.StoreId, ExpirationTime = entity.ExpirationTime, MonitoringExpiration = entity.MonitoringExpiration, CreatedTime = entity.InvoiceTime, diff --git a/BTCPayServer/wwwroot/swagger/v1/swagger.template.invoices.json b/BTCPayServer/wwwroot/swagger/v1/swagger.template.invoices.json index 387efc85e..7a9b2f0b8 100644 --- a/BTCPayServer/wwwroot/swagger/v1/swagger.template.invoices.json +++ b/BTCPayServer/wwwroot/swagger/v1/swagger.template.invoices.json @@ -749,6 +749,10 @@ "type": "string", "description": "The identifier of the invoice" }, + "storeId": { + "type": "string", + "description": "The store identifier that the invoice belongs to" + }, "checkoutLink": { "type": "string", "description": "The link to the checkout page, where you can redirect the customer"