btcpayserver/BTCPayServer/wwwroot/swagger/v1/swagger.template.payout-processors.json
Andrew Camilleri 4063a5aaee
Quality of life improvements to payout processors (#5135)
* Quality of life improvements to payout processors

* Allows more fleixble intervals for payout processing from 10-60 mins to 1min-24hours(requested by users)
* Cancel ln payotus that expired (bolt11)
* Allow cancelling of ln payotus that have failed to be paid after x attempts
* Allow conifguring a threshold for when to process on-chain payouts (reduces fees)

# Conflicts:
#	BTCPayServer.Tests/SeleniumTests.cs

* Simplify the code

* switch to concurrent dictionary

* Allow ProcessNewPayoutsInstantly

* refactor plugin hook service to have events available and change processor hooks to actions with better args

* add procesor extended tests

* Update BTCPayServer.Tests/GreenfieldAPITests.cs

* fix concurrency issue

* Update BTCPayServer/PayoutProcessors/BaseAutomatedPayoutProcessor.cs

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2023-07-20 22:05:14 +09:00

703 lines
28 KiB
JSON

{
"paths": {
"/api/v1/stores/{storeId}/payout-processors": {
"get": {
"tags": [
"Stores (Payout Processors)"
],
"summary": "Get store configured payout processors",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
}
],
"description": "Get store configured payout processors",
"operationId": "StorePayoutProcessors_GetStorePayoutProcessors",
"responses": {
"200": {
"description": "configured payout processors",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PayoutProcessorData"
}
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to view the specified store"
},
"404": {
"description": "The key is not found for this store"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canviewstoresettings"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/payout-processors/{processor}/{paymentMethod}": {
"delete": {
"tags": [
"Stores (Payout Processors)"
],
"summary": "Remove store configured payout processor",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store",
"schema": {
"type": "string"
}
},
{
"name": "processor",
"in": "path",
"required": true,
"description": "The processor",
"schema": {
"type": "string"
}
},
{
"name": "paymentMethod",
"in": "path",
"required": true,
"description": "The payment method",
"schema": {
"type": "string"
}
}
],
"description": "Remove store configured payout processor",
"operationId": "StorePayoutProcessors_RemoveStorePayoutProcessor",
"responses": {
"200": {
"description": "removed"
},
"403": {
"description": "If you are authenticated but forbidden to view the specified store"
},
"404": {
"description": "The key is not found for this store"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canmodifystoresettings"
],
"Basic": []
}
]
}
},
"/api/v1/payout-processors": {
"get": {
"tags": [
"Payout Processors"
],
"summary": "Get payout processors",
"description": "Get payout processors available in this instance",
"operationId": "PayoutProcessors_GetPayoutProcessors",
"responses": {
"200": {
"description": "available payout processors",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PayoutProcessorData"
}
}
}
}
}
},
"security": [
{
"API_Key": [],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/payout-processors/OnChainAutomatedPayoutSenderFactory/{paymentMethod}": {
"get": {
"tags": [
"Stores (Payout Processors)"
],
"summary": "Get configured store onchain automated payout processors",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
},
{
"name": "paymentMethod",
"in": "path",
"required": true,
"description": "A specific payment method to fetch",
"schema": {
"type": "string"
}
}
],
"description": "Get configured store onchain automated payout processors",
"operationId": "GreenfieldStoreAutomatedOnChainPayoutProcessorsController_GetStoreOnChainAutomatedPayoutProcessorsForPaymentMethod",
"responses": {
"200": {
"description": "configured processors",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OnChainAutomatedTransferSettings"
}
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to view the specified store"
},
"404": {
"description": "The key is not found for this store"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canviewstoresettings"
],
"Basic": []
}
]
},
"put": {
"tags": [
"Stores (Payout Processors)"
],
"summary": "Update configured store onchain automated payout processors",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
},
{
"name": "paymentMethod",
"in": "path",
"required": true,
"description": "A specific payment method to fetch",
"schema": {
"type": "string"
}
}
],
"description": "Update configured store onchain automated payout processors",
"operationId": "GreenfieldStoreAutomatedOnChainPayoutProcessorsController_UpdateStoreOnChainAutomatedPayoutProcessorForPaymentMethod",
"requestBody": {
"x-name": "request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateOnChainAutomatedTransferSettings"
}
}
},
"required": true,
"x-position": 1
},
"responses": {
"200": {
"description": "configured processor",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OnChainAutomatedTransferSettings"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to view the specified store"
},
"404": {
"description": "The key is not found for this store"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canviewstoresettings"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/payout-processors/LightningAutomatedPayoutSenderFactory/{paymentMethod}": {
"get": {
"tags": [
"Stores (Payout Processors)"
],
"summary": "Get configured store Lightning automated payout processors",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
},
{
"name": "paymentMethod",
"in": "path",
"required": true,
"description": "A specific payment method to fetch",
"schema": {
"type": "string"
}
}
],
"description": "Get configured store Lightning automated payout processors",
"operationId": "GreenfieldStoreAutomatedLightningPayoutProcessorsController_GetStoreLightningAutomatedPayoutProcessorsForPaymentMethod",
"responses": {
"200": {
"description": "configured processors",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LightningAutomatedTransferSettings"
}
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to view the specified store"
},
"404": {
"description": "The key is not found for this store"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canviewstoresettings"
],
"Basic": []
}
]
},
"put": {
"tags": [
"Stores (Payout Processors)"
],
"summary": "Update configured store Lightning automated payout processors",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
},
{
"name": "paymentMethod",
"in": "path",
"required": true,
"description": "A specific payment method to fetch",
"schema": {
"type": "string"
}
}
],
"description": "Update configured store Lightning automated payout processors",
"operationId": "GreenfieldStoreAutomatedLightningPayoutProcessorsController_UpdateStoreLightningAutomatedPayoutProcessor",
"requestBody": {
"x-name": "request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateLightningAutomatedTransferSettings"
}
}
},
"required": true,
"x-position": 1
},
"responses": {
"200": {
"description": "configured processor",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LightningAutomatedTransferSettings"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to view the specified store"
},
"404": {
"description": "The key is not found for this store"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canviewstoresettings"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/payout-processors/OnChainAutomatedTransferSenderFactory": {
"get": {
"tags": [
"Stores (Payout Processors)"
],
"summary": "Get configured store onchain automated payout processors",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
}
],
"description": "Get configured store onchain automated payout processors",
"operationId": "GreenfieldStoreAutomatedOnChainPayoutProcessorsController_GetStoreOnChainAutomatedTransferSenderFactory",
"responses": {
"200": {
"description": "configured processors",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OnChainAutomatedTransferSettings"
}
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to view the specified store"
},
"404": {
"description": "The key is not found for this store"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canviewstoresettings"
],
"Basic": []
}
]
},
"put": {
"tags": [
"Stores (Payout Processors)"
],
"summary": "Update configured store onchain automated payout processors",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
}
],
"description": "Update configured store onchain automated payout processors",
"operationId": "GreenfieldStoreAutomatedOnChainPayoutProcessorsController_UpdateStoreOnChainAutomatedTransferSenderFactory",
"requestBody": {
"x-name": "request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateOnChainAutomatedTransferSettings"
}
}
},
"required": true,
"x-position": 1
},
"responses": {
"200": {
"description": "configured processor",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OnChainAutomatedTransferSettings"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to view the specified store"
},
"404": {
"description": "The key is not found for this store"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canviewstoresettings"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/payout-processors/LightningAutomatedPayoutSenderFactory": {
"get": {
"tags": [
"Stores (Payout Processors)"
],
"summary": "Get configured store Lightning automated payout processors",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
}
],
"description": "Get configured store Lightning automated payout processors",
"operationId": "GreenfieldStoreAutomatedLightningPayoutProcessorsController_GetStoreLightningAutomatedPayoutSenderFactory",
"responses": {
"200": {
"description": "configured processors",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LightningAutomatedTransferSettings"
}
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to view the specified store"
},
"404": {
"description": "The key is not found for this store"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canviewstoresettings"
],
"Basic": []
}
]
}
}
},
"components": {
"schemas": {
"PayoutProcessorData": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"description": "unique identifier of the payout processor",
"type": "string"
},
"friendlyName": {
"description": "Human name of the payout processor",
"type": "string"
},
"paymentMethods": {
"nullable": true,
"description": "Supported, payment methods by this processor",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"UpdateLightningAutomatedTransferSettings": {
"type": "object",
"additionalProperties": false,
"properties": {
"intervalSeconds": {
"description": "How often should the processor run",
"allOf": [
{
"$ref": "#/components/schemas/TimeSpanSeconds"
}
]
},
"cancelPayoutAfterFailures": {
"description": "How many failures should the processor tolerate before cancelling the payout",
"type": "number",
"nullable": true
},
"processNewPayoutsInstantly": {
"description": "Skip the interval when ane eligible payout has been approved (or created with pre-approval)",
"type": "boolean",
"default": false
}
}
},
"LightningAutomatedTransferSettings": {
"type": "object",
"additionalProperties": false,
"properties": {
"paymentMethod": {
"description": "payment method of the payout processor",
"type": "string"
},
"intervalSeconds": {
"description": "How often should the processor run",
"allOf": [
{
"$ref": "#/components/schemas/TimeSpanSeconds"
}
]
},
"cancelPayoutAfterFailures": {
"description": "How many failures should the processor tolerate before cancelling the payout",
"type": "number",
"nullable": true
},
"processNewPayoutsInstantly": {
"description": "Skip the interval when ane eligible payout has been approved (or created with pre-approval)",
"type": "boolean",
"default": false
}
}
},
"UpdateOnChainAutomatedTransferSettings": {
"type": "object",
"additionalProperties": false,
"properties": {
"feeTargetBlock": {
"type": "number",
"description": "How many blocks should the fee rate calculation target to confirm in. Set to 1 if not provided",
"nullable": true
},
"intervalSeconds": {
"description": "How often should the processor run",
"allOf": [
{
"$ref": "#/components/schemas/TimeSpanSeconds"
}
]
},
"threshold": {
"type": "string",
"format": "decimal",
"minimum": 0,
"description": "Only process payouts when this payout sum is reached.",
"example": "0.1"
},
"processNewPayoutsInstantly": {
"description": "Skip the interval when ane eligible payout has been approved (or created with pre-approval)",
"type": "boolean",
"default": false
}
}
},
"OnChainAutomatedTransferSettings": {
"type": "object",
"additionalProperties": false,
"properties": {
"paymentMethod": {
"description": "payment method of the payout processor",
"type": "string"
},
"feeTargetBlock": {
"type": "number",
"description": "How many blocks should the fee rate calculation target to confirm in."
},
"intervalSeconds": {
"description": "How often should the processor run",
"allOf": [
{
"$ref": "#/components/schemas/TimeSpanSeconds"
}
]
},
"threshold": {
"type": "string",
"format": "decimal",
"minimum": 0,
"description": "Only process payouts when this payout sum is reached.",
"example": "0.1"
},
"processNewPayoutsInstantly": {
"description": "Skip the interval when ane eligible payout has been approved (or created with pre-approval)",
"type": "boolean",
"default": false
}
}
}
}
},
"tags": [
{
"name": "Stores (Payout Processors)",
"description": "Stores (Payout Processors) operations"
},
{
"name": "Payout Processors",
"description": "Payout Processors operations"
}
]
}