mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-19 05:33:31 +01:00
76719cdc4a
* Greenfield: Fix payment method update regression Do not exclude if `enabled` is `true`. Got introduced in #5809. * Fix PaymentMethodId Swagger docs
391 lines
16 KiB
JSON
391 lines
16 KiB
JSON
{
|
|
"paths": {
|
|
"/api/v1/stores/{storeId}/payment-methods": {
|
|
"get": {
|
|
"tags": [
|
|
"Store Payment Methods"
|
|
],
|
|
"summary": "Get store payment methods",
|
|
"description": "View information about the stores' configured payment methods",
|
|
"operationId": "StorePaymentMethods_GetStorePaymentMethods",
|
|
"parameters": [
|
|
{
|
|
"name": "storeId",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The store to fetch",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "onlyEnabled",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Fetch payment methods that are enabled/disabled only",
|
|
"schema": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
{
|
|
"name": "includeConfig",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Fetch the config of the payment methods, if `true`, the permission `btcpay.store.canmodifystoresettings` is required.",
|
|
"schema": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "List of payment methods",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/GenericPaymentMethodData"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Missing authorization",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProblemDetails"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "Unexpected error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProblemDetails"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"API_Key": [
|
|
"btcpay.store.canviewstoresettings"
|
|
],
|
|
"Basic": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/stores/{storeId}/payment-methods/{paymentMethodId}": {
|
|
"get": {
|
|
"tags": [
|
|
"Store Payment Methods"
|
|
],
|
|
"summary": "Get store payment method",
|
|
"description": "View information about the stores' configured payment method",
|
|
"operationId": "StorePaymentMethods_GetStorePaymentMethod",
|
|
"parameters": [
|
|
{
|
|
"name": "storeId",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The store to fetch",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "includeConfig",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Fetch the config of the payment methods, if `true`, the permission `btcpay.store.canmodifystoresettings` is required.",
|
|
"schema": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/PaymentMethodId"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "The payment method config",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/GenericPaymentMethodData"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Missing authorization",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProblemDetails"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "Unexpected error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProblemDetails"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"API_Key": [
|
|
"btcpay.store.canviewstoresettings"
|
|
],
|
|
"Basic": []
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"tags": [
|
|
"Store Payment Methods"
|
|
],
|
|
"summary": "Update store's payment method",
|
|
"description": "Update information about the stores' configured payment method",
|
|
"operationId": "StorePaymentMethods_UpdateStorePaymentMethod",
|
|
"parameters": [
|
|
{
|
|
"name": "storeId",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The store to fetch",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/PaymentMethodId"
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/UpdatePaymentMethodConfig"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "The payment method config",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/GenericPaymentMethodData"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Missing authorization",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProblemDetails"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "Unexpected error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProblemDetails"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"API_Key": [
|
|
"btcpay.store.canmodifystoresettings"
|
|
],
|
|
"Basic": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"tags": [
|
|
"Store Payment Methods"
|
|
],
|
|
"summary": "Delete store's payment method",
|
|
"description": "Delete information about the stores' configured payment method",
|
|
"operationId": "StorePaymentMethods_DeleteStorePaymentMethod",
|
|
"parameters": [
|
|
{
|
|
"name": "storeId",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The store to fetch",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/PaymentMethodId"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "The configuration got deleted"
|
|
},
|
|
"401": {
|
|
"description": "Missing authorization",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProblemDetails"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "Unexpected error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProblemDetails"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"API_Key": [
|
|
"btcpay.store.canmodifystoresettings"
|
|
],
|
|
"Basic": []
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"parameters": {
|
|
"PaymentMethodId": {
|
|
"name": "paymentMethodId",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The payment method id of the payment method to update",
|
|
"schema": {
|
|
"$ref": "#/components/schemas/PaymentMethodId"
|
|
},
|
|
"example": "BTC-CHAIN"
|
|
}
|
|
},
|
|
"schemas": {
|
|
"UpdatePaymentMethodConfig": {
|
|
"type": "object",
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"description": "Whether the payment method is enabled, leave null or unspecified to not change current setting",
|
|
"default": null,
|
|
"nullable": true,
|
|
"example": true
|
|
},
|
|
"config": {
|
|
"type": "object",
|
|
"description": "The new payment method config, leave null or unspecified to not change current setting",
|
|
"default": null,
|
|
"nullable": true,
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/components/schemas/OnChainPaymentMethodBaseData"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/LightningNetworkPaymentMethodBaseData"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/LNURLPayPaymentMethodBaseData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"title": "Lightning connection string",
|
|
"description": "A lightning connection string or `Internal Node` (See [this documentation](https://github.com/btcpayserver/btcpayserver.lightning) for the format)"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"title": "Derivation scheme",
|
|
"description": "A derivation scheme in NBXplorer's format (See [this documentation](https://github.com/dgarage/NBXplorer/blob/master/docs/API.md#derivation-scheme) for the format)"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"title": "Output descriptor",
|
|
"description": "An output descriptor. Only a subset of them are supported. (See [this documentation](https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md) for the format)"
|
|
},
|
|
{
|
|
"description": "Any other unofficial payment method data",
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"GenericPaymentMethodData": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"description": "Whether the payment method is enabled"
|
|
},
|
|
"paymentMethodId": {
|
|
"$ref": "#/components/schemas/PaymentMethodId"
|
|
},
|
|
"config": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"description": "Associated dynamic data based on payment method type.",
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/components/schemas/OnChainPaymentMethodBaseData"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/LightningNetworkPaymentMethodBaseData"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/LNURLPayPaymentMethodBaseData"
|
|
},
|
|
{
|
|
"description": "Any other unofficial payment method data",
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "Store Payment Methods",
|
|
"description": "Store Payment Methods operations"
|
|
}
|
|
]
|
|
}
|