mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 10:40:29 +01:00
c59798e9c4
* GreenField: Generate Store OnChain Wallet * Greenfield: Do not generate wallet if already configured
576 lines
23 KiB
JSON
576 lines
23 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"
|
|
}
|
|
},
|
|
{
|
|
"name": "enabled",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Fetch payment methods that are enabled/disabled only",
|
|
"schema": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
],
|
|
"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"
|
|
}
|
|
},
|
|
"OnChainPaymentMethodDataWithSensitiveData": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/OnChainPaymentMethodData"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"mnemonic": {
|
|
"type": "string",
|
|
"description": "The mnemonic used to generate the wallet",
|
|
"nullable": false
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"OnChainPaymentMethodBaseData": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"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'"
|
|
}
|
|
}
|
|
},
|
|
"OnChainPaymentMethodData": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"$ref": "#/components/schemas/OnChainPaymentMethodBaseData"
|
|
},
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"description": "Whether the payment method is enabled"
|
|
},
|
|
"cryptoCode": {
|
|
"type": "string",
|
|
"description": "Crypto code of the payment method"
|
|
}
|
|
}
|
|
},
|
|
"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"
|
|
}
|
|
}
|
|
},
|
|
"GenerateOnChainWalletRequest": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"existingMnemonic": {
|
|
"type": "string",
|
|
"description": "An existing BIP39 mnemonic seed to generate the wallet with"
|
|
},
|
|
"passphrase": {
|
|
"type": "string",
|
|
"description": "A passphrase for the BIP39 mnemonic seed"
|
|
},
|
|
"accountNumber": {
|
|
"type": "number",
|
|
"default": 0,
|
|
"description": "The account to derive from the BIP39 mnemonic seed"
|
|
},
|
|
"savePrivateKeys": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Whether to store the seed inside BTCPay Server to enable some additional services. IF `false` AND `existingMnemonic` IS NOT SPECIFIED, BE SURE TO SECURELY STORE THE SEED IN THE RESPONSE!"
|
|
},
|
|
"importKeysToRPC": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Whether to import all addresses generated via BTCPay Server into the underlying node wallet. (Private keys will also be imported if `savePrivateKeys` is set to true."
|
|
},
|
|
"wordList": {
|
|
"type": "string",
|
|
"description": "If `existingMnemonic` is not set, a mnemonic is generated using the specified wordList.",
|
|
"default": "English",
|
|
"x-enumNames": [
|
|
"English",
|
|
"Japanese",
|
|
"Spanish",
|
|
"ChineseSimplified",
|
|
"ChineseTraditional",
|
|
"French",
|
|
"PortugueseBrazil",
|
|
"Czech"
|
|
],
|
|
"enum": [
|
|
"English",
|
|
"Japanese",
|
|
"Spanish",
|
|
"ChineseSimplified",
|
|
"ChineseTraditional",
|
|
"French",
|
|
"PortugueseBrazil",
|
|
"Czech"
|
|
]
|
|
},
|
|
"wordCount": {
|
|
"type": "number",
|
|
"description": "If `existingMnemonic` is not set, a mnemonic is generated using the specified wordCount.",
|
|
"default": 12,
|
|
"x-enumNames": [
|
|
12,15,18,21,24
|
|
],
|
|
"enum": [
|
|
12,15,18,21,24
|
|
]
|
|
},
|
|
"scriptPubKeyType": {
|
|
"type": "string",
|
|
"description": "the type of wallet to generate",
|
|
"default": "Segwit",
|
|
"x-enumNames": [
|
|
"Legacy",
|
|
"Segwit",
|
|
"SegwitP2SH"
|
|
],
|
|
"enum": [
|
|
"Legacy",
|
|
"Segwit",
|
|
"SegwitP2SH"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "Store Payment Methods (On Chain)"
|
|
}
|
|
]
|
|
}
|