btcpayserver/BTCPayServer/wwwroot/swagger/v1/swagger.template.stores-payment-methods.on-chain.json
2021-02-15 10:05:54 +01:00

461 lines
18 KiB
JSON

{
"paths": {
"/api/v1/stores/{storeId}/payment-methods/OnChain": {
"get": {
"tags": [
"Store Payment Methods (On Chain)"
],
"summary": "Get store on-chain payment methods",
"description": "View information about the stores' configured on-chain payment methods",
"operationId": "StoreOnChainPaymentMethods_GetOnChainPaymentMethods",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "list of payment methods",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OnChainPaymentMethodDataList"
}
}
}
}
},
"security": [
{
"API Key": [
"btcpay.store.canviewstoresettings"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/payment-methods/OnChain/{cryptoCode}": {
"get": {
"tags": [
"Store Payment Methods (On Chain)"
],
"summary": "Get store on-chain payment method",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
},
{
"name": "cryptoCode",
"in": "path",
"required": true,
"description": "The crypto code of the payment method to fetch",
"schema": {
"type": "string"
}
}
],
"description": "View information about the specified payment method",
"operationId": "StoreOnChainPaymentMethods_GetOnChainPaymentMethod",
"responses": {
"200": {
"description": "specified payment method",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OnChainPaymentMethodData"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to view the specified store"
},
"404": {
"description": "The key is not found for this store/payment method"
}
},
"security": [
{
"API Key": [
"btcpay.store.canviewstoresettings"
],
"Basic": []
}
]
},
"put": {
"tags": [
"Store Payment Methods (On Chain)"
],
"summary": "Update store on-chain payment method",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
},
{
"name": "cryptoCode",
"in": "path",
"required": true,
"description": "The crypto code of the payment method to update",
"schema": {
"type": "string"
}
}
],
"description": "Update the specified store's payment method",
"requestBody": {
"x-name": "request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OnChainPaymentMethodData"
}
}
},
"required": true,
"x-position": 1
},
"operationId": "StoreOnChainPaymentMethods_UpdateOnChainPaymentMethod",
"responses": {
"200": {
"description": "updated specified payment method",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OnChainPaymentMethodData"
}
}
}
},
"400": {
"description": "A list of errors that occurred when updating the store payment method",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to update the specified store"
},
"404": {
"description": "The key is not found for this store"
}
},
"security": [
{
"API Key": [
"btcpay.store.canmodifystoresettings"
],
"Basic": []
}
]
},
"delete": {
"tags": [
"Store Payment Methods (On Chain)"
],
"summary": "Remove store on-chain payment method",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
},
{
"name": "cryptoCode",
"in": "path",
"required": true,
"description": "The crypto code of the payment method to update",
"schema": {
"type": "string"
}
}
],
"description": "Removes the specified store payment method.",
"responses": {
"200": {
"description": "The payment method has been removed"
},
"400": {
"description": "A list of errors that occurred when removing the payment method",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to remove the specified payment method"
},
"404": {
"description": "The key is not found for this store/payment-method"
}
},
"security": [
{
"API Key": [
"btcpay.store.canmodifystoresettings"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/payment-methods/OnChain/{cryptoCode}/preview": {
"get": {
"tags": [
"Store Payment Methods (On Chain)"
],
"summary": "Preview store on-chain payment method addresses",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
},
{
"name": "cryptoCode",
"in": "path",
"required": true,
"description": "The crypto code of the payment method to fetch",
"schema": {
"type": "string"
}
},
{
"name": "offset",
"in": "query",
"required": false,
"description": "From which index to fetch the addresses",
"schema": {
"type": "number"
}
},
{
"name": "amount",
"in": "query",
"required": false,
"description": "Number of addresses to preview",
"schema": {
"type": "number"
}
}
],
"description": "View addresses of the current payment method of the store",
"operationId": "StoreOnChainPaymentMethods_GetOnChainPaymentMethodPreview",
"responses": {
"200": {
"description": "specified payment method addresses",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OnChainPaymentMethodPreviewResultData"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to view the specified store"
},
"404": {
"description": "The key is not found for this store/payment method"
}
},
"security": [
{
"API Key": [
"btcpay.store.canviewstoresettings"
],
"Basic": []
}
]
},
"post": {
"tags": [
"Store Payment Methods (On Chain)"
],
"summary": "Preview proposed store on-chain payment method addresses",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
},
{
"name": "cryptoCode",
"in": "path",
"required": true,
"description": "The crypto code of the payment method to fetch",
"schema": {
"type": "string"
}
},
{
"name": "offset",
"in": "query",
"required": false,
"description": "From which index to fetch the addresses",
"schema": {
"type": "number"
}
},
{
"name": "amount",
"in": "query",
"required": false,
"description": "Number of addresses to preview",
"schema": {
"type": "number"
}
}
],
"description": "View addresses of a proposed payment method of the store",
"operationId": "StoreOnChainPaymentMethods_GetOnChainPaymentMethodPreview",
"requestBody": {
"x-name": "request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OnChainPaymentMethodData"
}
}
},
"required": true,
"x-position": 1
},
"responses": {
"200": {
"description": "specified payment method addresses",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OnChainPaymentMethodPreviewResultData"
}
}
}
},
"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": {
"OnChainPaymentMethodDataList": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OnChainPaymentMethodData"
}
},
"OnChainPaymentMethodData": {
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether the payment method is enabled"
},
"cryptoCode": {
"type": "string",
"description": "Crypto code of the payment method"
},
"derivationScheme": {
"type": "string",
"description": "The derivation scheme",
"example": "xpub..."
},
"label": {
"type": "string",
"description": "A label that will be shown in the UI"
},
"accountKeyPath": {
"type": "string",
"description": "The wallet fingerprint followed by the keypath to derive the account key used for signing operation or creating PSBTs",
"example": "abcd82a1/84'/0'/0'"
}
}
},
"OnChainPaymentMethodPreviewResultData": {
"type": "object",
"additionalProperties": false,
"properties": {
"addresses": {
"type": "array",
"description": "a list of addresses generated by the derivation scheme",
"items": {
"$ref": "#/components/schemas/OnChainPaymentMethodPreviewResultAddressItem"
}
}
}
},
"OnChainPaymentMethodPreviewResultAddressItem": {
"type": "object",
"additionalProperties": false,
"properties": {
"keyPath": {
"type": "string",
"description": "The key path relative to the account key path."
},
"address": {
"type": "string",
"description": "The address generated at the key path"
}
}
}
}
},
"tags": [
{
"name": "Store Payment Methods (On Chain)"
}
]
}