btcpayserver/BTCPayServer/wwwroot/swagger/v1/swagger.template.payout-processors.json
Andrew Camilleri 51690b47a3
Transfer Processors (#3476)
* Automated Transfer processors

This PR introduces a few things:
* Payouts can now be directly nested under a store instead of through a pull payment.
* The Wallet Send screen now has an option to "schedule" instead of simply creating a transaction. When you click on schedule, all transaction destinations are converted into approved payouts. Any options relating to fees or coin selection are discarded.
* There is a new concept introduced, called "Transfer Processors".  Transfer Processors are services for stores that process payouts that are awaiting payment. Each processor specifies which payment methods it can handle.  BTCPay Server will have some forms of transfer processors baked in but it has been designed to allow the Plugin System to provide additional processors.
* The initial transfer processors provided are "automated processors", for on chain and lightning payment methods. They can be configured to process payouts every X amount of minutes. For  on-chain, this means payments are batched into one transaction, resulting in more efficient and cheaper fees for processing.
*

* fix build

* extract

* remove magic string stuff

* fix error message when scheduling

* Paginate migration

* add payout count to payment method tab

* remove unused var

* add protip

* optimzie payout migration dramatically

* Remove useless double condition

* Fix bunch of warnings

* Remove warning

* Remove warnigns

* Rename to Payout processors

* fix typo

Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
2022-04-24 12:19:34 +09:00

669 lines
26 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",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
}
],
"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/OnChainAutomatedTransferSenderFactory/{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_GetStoreOnChainAutomatedPayoutProcessors",
"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_UpdateStoreOnChainAutomatedPayoutProcessor",
"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/LightningAutomatedTransferSenderFactory/{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_GetStoreLightningAutomatedPayoutProcessors",
"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_GetStoreOnChainAutomatedPayoutProcessors",
"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_UpdateStoreOnChainAutomatedPayoutProcessor",
"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/LightningAutomatedTransferSenderFactory": {
"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_GetStoreLightningAutomatedPayoutProcessors",
"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"
}
]
}
}
},
"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"
}
]
}
}
},
"UpdateOnChainAutomatedTransferSettings": {
"type": "object",
"additionalProperties": false,
"properties": {
"intervalSeconds": {
"description": "How often should the processor run",
"allOf": [
{
"$ref": "#/components/schemas/TimeSpanSeconds"
}
]
}
}
},
"OnChainAutomatedTransferSettings": {
"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"
}
]
}
}
}
}
},
"tags": [
{
"name": "Stores (Payout Processors)"
},
{
"name": "Payout Processors"
}
]
}