diff --git a/BTCPayServer.Client/JsonConverters/LightMoneyJsonConverter.cs b/BTCPayServer.Client/JsonConverters/LightMoneyJsonConverter.cs new file mode 100644 index 000000000..71581c2e6 --- /dev/null +++ b/BTCPayServer.Client/JsonConverters/LightMoneyJsonConverter.cs @@ -0,0 +1,15 @@ +using System.Globalization; +using BTCPayServer.Lightning; +using Newtonsoft.Json; + +namespace BTCPayServer.Client.JsonConverters +{ + public class LightMoneyJsonConverter : BTCPayServer.Lightning.JsonConverters.LightMoneyJsonConverter + { + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + if (value != null) + writer.WriteValue(((LightMoney)value).MilliSatoshi.ToString(CultureInfo.InvariantCulture)); + } + } +} diff --git a/BTCPayServer.Client/Models/LightningInvoiceData.cs b/BTCPayServer.Client/Models/LightningInvoiceData.cs index 6a76e25f9..8a22439c4 100644 --- a/BTCPayServer.Client/Models/LightningInvoiceData.cs +++ b/BTCPayServer.Client/Models/LightningInvoiceData.cs @@ -1,6 +1,6 @@ using System; +using BTCPayServer.Client.JsonConverters; using BTCPayServer.Lightning; -using BTCPayServer.Lightning.JsonConverters; using Newtonsoft.Json; using Newtonsoft.Json.Converters; diff --git a/BTCPayServer.Client/Models/LightningNodeInformationData.cs b/BTCPayServer.Client/Models/LightningNodeInformationData.cs index 11d83def4..e3e8a7b18 100644 --- a/BTCPayServer.Client/Models/LightningNodeInformationData.cs +++ b/BTCPayServer.Client/Models/LightningNodeInformationData.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using BTCPayServer.Client.JsonConverters; using BTCPayServer.Lightning; using NBitcoin; using NBitcoin.JsonConverters; @@ -20,10 +21,10 @@ namespace BTCPayServer.Client.Models public bool IsActive { get; set; } - [JsonProperty(ItemConverterType = typeof(MoneyJsonConverter))] + [JsonProperty(ItemConverterType = typeof(LightMoneyJsonConverter))] public LightMoney Capacity { get; set; } - [JsonProperty(ItemConverterType = typeof(MoneyJsonConverter))] + [JsonProperty(ItemConverterType = typeof(LightMoneyJsonConverter))] public LightMoney LocalBalance { get; set; } public string ChannelPoint { get; set; } diff --git a/BTCPayServer/Controllers/GreenField/LightningNodeApiController.Internal.cs b/BTCPayServer/Controllers/GreenField/LightningNodeApiController.Internal.cs index c1f2f9572..2933e1b07 100644 --- a/BTCPayServer/Controllers/GreenField/LightningNodeApiController.Internal.cs +++ b/BTCPayServer/Controllers/GreenField/LightningNodeApiController.Internal.cs @@ -13,14 +13,14 @@ namespace BTCPayServer.Controllers.GreenField { [ApiController] [Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)] - public class InternalLightningNodeApiInternalController : LightningNodeApiController + public class InternalLightningNodeApiController : LightningNodeApiController { private readonly BTCPayServerOptions _btcPayServerOptions; private readonly BTCPayNetworkProvider _btcPayNetworkProvider; private readonly LightningClientFactoryService _lightningClientFactory; - public InternalLightningNodeApiInternalController(BTCPayServerOptions btcPayServerOptions, + public InternalLightningNodeApiController(BTCPayServerOptions btcPayServerOptions, BTCPayNetworkProvider btcPayNetworkProvider, BTCPayServerEnvironment btcPayServerEnvironment, CssThemeManager cssThemeManager, LightningClientFactoryService lightningClientFactory) : base( btcPayNetworkProvider, btcPayServerEnvironment, cssThemeManager) diff --git a/BTCPayServer/wwwroot/swagger/v1/swagger.template.lightning.common.json b/BTCPayServer/wwwroot/swagger/v1/swagger.template.lightning.common.json index a00ca9bae..1a86f2222 100644 --- a/BTCPayServer/wwwroot/swagger/v1/swagger.template.lightning.common.json +++ b/BTCPayServer/wwwroot/swagger/v1/swagger.template.lightning.common.json @@ -4,41 +4,35 @@ "ConnectToNodeRequest": { "oneOf": [ { - "$ref": "#/components/schemas/ConnectToNodeRequest1" + "type": "object", + "additionalProperties": false, + "properties": { + "nodeInfo": { + "type": "string", + "nullable": true + } + } }, { - "$ref": "#/components/schemas/ConnectToNodeRequest2" + "type": "object", + "additionalProperties": false, + "properties": { + "nodeId": { + "type": "string", + "nullable": true + }, + "nodeHost": { + "type": "string", + "nullable": true + }, + "nodePort": { + "type": "integer", + "format": "int32" + } + } } ] }, - "ConnectToNodeRequest1": { - "type": "object", - "additionalProperties": false, - "properties": { - "nodeInfo": { - "type": "string", - "nullable": true - } - } - }, - "ConnectToNodeRequest2": { - "type": "object", - "additionalProperties": false, - "properties": { - "nodeId": { - "type": "string", - "nullable": true - }, - "nodeHost": { - "type": "string", - "nullable": true - }, - "nodePort": { - "type": "integer", - "format": "int32" - } - } - }, "CreateLightningInvoiceRequest": { "type": "object", "additionalProperties": false, @@ -65,8 +59,9 @@ } }, "LightMoney": { - "type": "integer", + "type": "string", "format": "int64", + "description": "The id of the store", "additionalProperties": false }, "LightningChannelData": { @@ -235,10 +230,5 @@ ] } } - }, - "tags": [ - { - "name": "Lightning" - } - ] + } } diff --git a/BTCPayServer/wwwroot/swagger/v1/swagger.template.lightning.internal.json b/BTCPayServer/wwwroot/swagger/v1/swagger.template.lightning.internal.json new file mode 100644 index 000000000..e91204b8d --- /dev/null +++ b/BTCPayServer/wwwroot/swagger/v1/swagger.template.lightning.internal.json @@ -0,0 +1,470 @@ +{ + "paths": { + "/api/v1/server/lightning/{cryptoCode}/info": { + "get": { + "tags": [ + "Lightning (Internal Node)" + ], + "summary": "Get node information", + "parameters": [ + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "View information about the lightning node", + "operationId": "InternalLightningNodeApi_GetInfo", + "responses": { + "200": { + "description": "Lightning node information such as reachable nodeinfos", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LightningNodeInformationData" + } + } + } + }, + "400": { + "description": "A list of errors that occurred", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "security": [ + { + "API Key": [ + "btcpay.server.canuseinternallightningnode" + ], + "Basic": [] + } + ] + } + }, + "/api/v1/server/lightning/{cryptoCode}/connect": { + "post": { + "tags": [ + "Lightning (Internal Node)" + ], + "summary": "Connect to lightning node", + "parameters": [ + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "Connect to another lightning node.", + "operationId": "InternalLightningNodeApi_ConnectToNode", + "responses": { + "200": { + "description": "Successfully connected" + }, + "400": { + "description": "A list of errors that occurred when attempting to connect to the lightning node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectToNodeRequest" + } + } + } + }, + "security": [ + { + "API Key": [ + "btcpay.server.canuseinternallightningnode" + ], + "Basic": [] + } + ] + } + }, + "/api/v1/server/lightning/{cryptoCode}/channels": { + "get": { + "tags": [ + "Lightning (Internal Node)" + ], + "summary": "Get channels", + "parameters": [ + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "View information about the current channels of the lightning node", + "operationId": "InternalLightningNodeApi_GetChannels", + "responses": { + "200": { + "description": "list of channels", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LightningChannelData" + } + } + } + } + }, + "400": { + "description": "A list of errors that occurred", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "security": [ + { + "API Key": [ + "btcpay.server.canuseinternallightningnode" + ], + "Basic": [] + } + ] + }, + "post": { + "tags": [ + "Lightning (Internal Node)" + ], + "summary": "Open channel", + "parameters": [ + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "Open a channel with another lightning node. You should connect to that node first.", + "operationId": "InternalLightningNodeApi_OpenChannel", + "responses": { + "200": { + "description": "Successfully opened" + }, + "400": { + "description": "A list of errors that occurred when attempting to connect to the lightning node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenLightningChannelRequest" + } + } + } + }, + "security": [ + { + "API Key": [ + "btcpay.server.canuseinternallightningnode" + ], + "Basic": [] + } + ] + } + }, + "/api/v1/server/lightning/{cryptoCode}/address": { + "get": { + "tags": [ + "Lightning (Internal Node)" + ], + "summary": "Get deposit address", + "parameters": [ + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "Get an on-chain deposit address for the lightning node ", + "operationId": "InternalLightningNodeApi_GetDepositAddress", + "responses": { + "200": { + "description": "deposit address", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "A list of errors that occurred", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "security": [ + { + "API Key": [ + "btcpay.server.canuseinternallightningnode" + ], + "Basic": [] + } + ] + } + }, + + "/api/v1/server/lightning/{cryptoCode}/invoices/{id}": { + "get": { + "tags": [ + "Lightning (Internal Node)" + ], + "summary": "Get invoice", + "parameters": [ + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } , { + "name": "id", + "in": "path", + "required": true, + "description": "The id of the lightning invoice.", + "schema": { + "type": "string" + } + } + ], + "description": "View information about the requested lightning invoice", + "operationId": "InternalLightningNodeApi_GetInvoice", + "responses": { + "200": { + "description": "Lightning invoice data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LightningInvoiceData" + } + } + } + }, + "400": { + "description": "A list of errors that occurred", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "security": [ + { + "API Key": [ + "btcpay.server.canuseinternallightningnode" + ], + "Basic": [] + } + ] + } + }, + "/api/v1/server/lightning/{cryptoCode}/invoices/pay": { + "post": { + "tags": [ + "Lightning (Internal Node)" + ], + "summary": "Pay Lightning Invoice", + "parameters": [ + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "Pay a lightning invoice.", + "operationId": "InternalLightningNodeApi_PayInvoice", + "responses": { + "200": { + "description": "Successfully paid" + }, + "400": { + "description": "A list of errors that occurred when attempting to pay the lightning invoice", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayLightningInvoiceRequest" + } + } + } + }, + "security": [ + { + "API Key": [ + "btcpay.server.canuseinternallightningnode" + ], + "Basic": [] + } + ] + } + }, + "/api/v1/server/lightning/{cryptoCode}/invoices": { + "post": { + "tags": [ + "Lightning (Internal Node)" + ], + "summary": "Create lightning invoice", + "parameters": [ + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "Create a lightning invoice.", + "operationId": "InternalLightningNodeApi_CreateInvoice", + "responses": { + "200": { + "description": "Successfully created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LightningInvoiceData" + } + } + } + }, + "400": { + "description": "A list of errors that occurred when attempting to create the lightning invoice", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayLightningInvoiceRequest" + } + } + } + }, + "security": [ + { + "API Key": [ + "btcpay.server.cancreatelightninginvoiceinternalnode" + ], + "Basic": [] + } + ] + } + } + }, + "tags": [ + { + "name": "Lightning (Internal Node)" + } + ] +} diff --git a/BTCPayServer/wwwroot/swagger/v1/swagger.template.lightning.store.json b/BTCPayServer/wwwroot/swagger/v1/swagger.template.lightning.store.json new file mode 100644 index 000000000..dd3095b09 --- /dev/null +++ b/BTCPayServer/wwwroot/swagger/v1/swagger.template.lightning.store.json @@ -0,0 +1,542 @@ +{ + "paths": { + "/api/v1/stores/{storeId}/lightning/{cryptoCode}/info": { + "get": { + "tags": [ + "Lightning (Store)" + ], + "summary": "Get node information", + "parameters": [ + { + "name": "storeId", + "in": "path", + "required": true, + "description": "The store id with the lightning node configuration you wish to use", + "schema": { + "type": "string" + } + }, + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "View information about the lightning node", + "operationId": "StoreLightningNodeApi_GetInfo", + "responses": { + "200": { + "description": "Lightning node information such as reachable nodeinfos", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LightningNodeInformationData" + } + } + } + }, + "400": { + "description": "A list of errors that occurred", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "security": [ + { + "API Key": [ + "btcpay.store.canuselightningnode" + ], + "Basic": [] + } + ] + } + }, + "/api/v1/stores/{storeId}/lightning/{cryptoCode}/connect": { + "post": { + "tags": [ + "Lightning (Store)" + ], + "summary": "Connect to lightning node", + "parameters": [ + { + "name": "storeId", + "in": "path", + "required": true, + "description": "The store id with the lightning node configuration you wish to use", + "schema": { + "type": "string" + } + }, + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "Connect to another lightning node.", + "operationId": "StoreLightningNodeApi_ConnectToNode", + "responses": { + "200": { + "description": "Successfully connected" + }, + "400": { + "description": "A list of errors that occurred when attempting to connect to the lightning node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectToNodeRequest" + } + } + } + }, + "security": [ + { + "API Key": [ + "btcpay.store.canuselightningnode" + ], + "Basic": [] + } + ] + } + }, + "/api/v1/stores/{storeId}/lightning/{cryptoCode}/channels": { + "get": { + "tags": [ + "Lightning (Store)" + ], + "summary": "Get channels", + "parameters": [ + { + "name": "storeId", + "in": "path", + "required": true, + "description": "The store id with the lightning node configuration you wish to use", + "schema": { + "type": "string" + } + }, + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "View information about the current channels of the lightning node", + "operationId": "StoreLightningNodeApi_GetChannels", + "responses": { + "200": { + "description": "list of channels", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LightningChannelData" + } + } + } + } + }, + "400": { + "description": "A list of errors that occurred", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "security": [ + { + "API Key": [ + "btcpay.store.canuselightningnode" + ], + "Basic": [] + } + ] + }, + "post": { + "tags": [ + "Lightning (Store)" + ], + "summary": "Open channel", + "parameters": [ + { + "name": "storeId", + "in": "path", + "required": true, + "description": "The store id with the lightning node configuration you wish to use", + "schema": { + "type": "string" + } + }, + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "Open a channel with another lightning node. You should connect to that node first.", + "operationId": "StoreLightningNodeApi_OpenChannel", + "responses": { + "200": { + "description": "Successfully opened" + }, + "400": { + "description": "A list of errors that occurred when attempting to connect to the lightning node", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenLightningChannelRequest" + } + } + } + }, + "security": [ + { + "API Key": [ + "btcpay.store.canuselightningnode" + ], + "Basic": [] + } + ] + } + }, + "/api/v1/stores/{storeId}/lightning/{cryptoCode}/address": { + "get": { + "tags": [ + "Lightning (Store)" + ], + "summary": "Get deposit address", + "parameters": [ + { + "name": "storeId", + "in": "path", + "required": true, + "description": "The store id with the lightning node configuration you wish to use", + "schema": { + "type": "string" + } + }, + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "Get an on-chain deposit address for the lightning node ", + "operationId": "StoreLightningNodeApi_GetDepositAddress", + "responses": { + "200": { + "description": "deposit address", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "A list of errors that occurred", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "security": [ + { + "API Key": [ + "btcpay.store.canuselightningnode" + ], + "Basic": [] + } + ] + } + }, + "/api/v1/stores/{storeId}/lightning/{cryptoCode}/invoices/{id}": { + "get": { + "tags": [ + "Lightning (Store)" + ], + "summary": "Get invoice", + "parameters": [ + { + "name": "storeId", + "in": "path", + "required": true, + "description": "The store id with the lightning node configuration you wish to use", + "schema": { + "type": "string" + } + }, + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "required": true, + "description": "The id of the lightning invoice.", + "schema": { + "type": "string" + } + } + ], + "description": "View information about the requested lightning invoice", + "operationId": "StoreLightningNodeApi_GetInvoice", + "responses": { + "200": { + "description": "Lightning invoice data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LightningInvoiceData" + } + } + } + }, + "400": { + "description": "A list of errors that occurred", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "security": [ + { + "API Key": [ + "btcpay.store.canuselightningnode" + ], + "Basic": [] + } + ] + } + }, + "/api/v1/stores/{storeId}/lightning/{cryptoCode}/invoices/pay": { + "post": { + "tags": [ + "Lightning (Store)" + ], + "summary": "Pay Lightning Invoice", + "parameters": [ + { + "name": "storeId", + "in": "path", + "required": true, + "description": "The store id with the lightning node configuration you wish to use", + "schema": { + "type": "string" + } + }, + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "Pay a lightning invoice.", + "operationId": "StoreLightningNodeApi_PayInvoice", + "responses": { + "200": { + "description": "Successfully paid" + }, + "400": { + "description": "A list of errors that occurred when attempting to pay the lightning invoice", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayLightningInvoiceRequest" + } + } + } + }, + "security": [ + { + "API Key": [ + "btcpay.store.canuselightningnode" + ], + "Basic": [] + } + ] + } + }, + "/api/v1/stores/{storeId}/lightning/{cryptoCode}/invoices": { + "post": { + "tags": [ + "Lightning (Store)" + ], + "summary": "Create lightning invoice", + "parameters": [ + { + "name": "storeId", + "in": "path", + "required": true, + "description": "The store id with the lightning node configuration you wish to use", + "schema": { + "type": "string" + } + }, + { + "name": "cryptoCode", + "in": "path", + "required": true, + "description": "The cryptoCode of the lightning-node to query", + "schema": { + "type": "string" + } + } + ], + "description": "Create a lightning invoice.", + "operationId": "StoreLightningNodeApi_CreateInvoice", + "responses": { + "200": { + "description": "Successfully created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LightningInvoiceData" + } + } + } + }, + "400": { + "description": "A list of errors that occurred when attempting to create the lightning invoice", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationProblemDetails" + } + } + } + }, + "403": { + "description": "If you are authenticated but forbidden" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayLightningInvoiceRequest" + } + } + } + }, + "security": [ + { + "API Key": [ + "btcpay.store.cancreatelightninginvoice" + ], + "Basic": [] + } + ] + } + } + }, + "tags": [ + { + "name": "Lightning (Store)" + } + ] +}