2022-10-12 15:19:33 +02:00
{
"paths" : {
"/api/v1/stores/{storeId}/rates/configuration" : {
"get" : {
"tags" : [
"Stores (Rates Config)"
] ,
"summary" : "Get store rate settings" ,
"parameters" : [
{
"name" : "storeId" ,
"in" : "path" ,
"required" : true ,
"description" : "The store to fetch" ,
"schema" : {
"type" : "string"
}
}
] ,
"description" : "View rate settings of the specified store" ,
"operationId" : "Stores_GetStoreRateConfiguration" ,
"responses" : {
"200" : {
"description" : "specified store rate settings" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/StoreRateConfiguration"
}
}
}
} ,
"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" : [ ]
}
]
} ,
"put" : {
"tags" : [
"Stores (Rates Config)"
] ,
"parameters" : [
{
"name" : "storeId" ,
"in" : "path" ,
"required" : true ,
"description" : "The store to fetch" ,
"schema" : {
"type" : "string"
}
}
] ,
"summary" : "Update store rate settings" ,
"description" : "Update a store's rate settings" ,
"operationId" : "Stores_UpdateStoreRateConfiguration" ,
"requestBody" : {
"x-name" : "request" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/StoreRateConfiguration"
}
}
} ,
"required" : true ,
"x-position" : 1
} ,
"responses" : {
"200" : {
"description" : "The settings were updated" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/StoreRateConfiguration"
}
}
}
} ,
"400" : {
"description" : "A list of errors that occurred when updating the settings" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ValidationProblemDetails"
}
}
}
} ,
"403" : {
"description" : "If you are authenticated but forbidden to modify the store"
}
} ,
"security" : [
{
"API_Key" : [
"btcpay.store.canmodifystoresettings"
] ,
"Basic" : [ ]
}
]
}
} ,
"/api/v1/stores/{storeId}/rates/configuration/preview" : {
"post" : {
"tags" : [
"Stores (Rates Config)"
] ,
"parameters" : [
{
"name" : "storeId" ,
"in" : "path" ,
"required" : true ,
"description" : "The store to fetch" ,
"schema" : {
"type" : "string"
}
} ,
{
"name" : "currencyPair" ,
"description" : "The currency pairs to preview" ,
"in" : "query" ,
"style" : "form" ,
"explode" : true ,
"schema" : {
"type" : "array" ,
"nullable" : true ,
"items" : {
"type" : "string"
}
} ,
"x-position" : 1
}
] ,
"summary" : "Preview rate configuration results" ,
"description" : "Preview rate configuration results before you set it on the store" ,
2022-10-25 13:37:36 +02:00
"operationId" : "Stores_PreviewStoreRateConfiguration" ,
2022-10-12 15:19:33 +02:00
"requestBody" : {
"x-name" : "request" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/StoreRateConfiguration"
}
}
} ,
"required" : true ,
"x-position" : 1
} ,
"responses" : {
"200" : {
"description" : "The settings were executed and a preview was returned" ,
"content" : {
"application/json" : {
"schema" : {
"type" : "array" ,
"items" : {
2023-01-31 06:42:25 +01:00
"$ref" : "#/components/schemas/StoreRateResult"
2022-10-12 15:19:33 +02:00
}
}
}
}
} ,
"400" : {
"description" : "A list of errors that occurred when previewing the settings" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ValidationProblemDetails"
}
}
}
} ,
"403" : {
"description" : "If you are authenticated but forbidden to modify the store"
}
} ,
"security" : [
{
2022-10-25 13:37:36 +02:00
"API_Key" : [
2022-10-12 15:19:33 +02:00
"btcpay.store.canmodifystoresettings"
] ,
"Basic" : [ ]
}
]
}
}
} ,
"components" : {
"schemas" : {
"StoreRateConfiguration" : {
"type" : "object" ,
"additionalProperties" : false ,
"properties" : {
"spread" : {
"type" : "string" ,
"description" : "A spread applies to the rate fetched in `%`. Must be `>= 0` or `<= 100`"
} ,
"preferredSource" : {
"type" : "string" ,
"description" : "If `isCustomerScript` is `false` affect use this source in the default's `effectiveScript`, if `isCustomerScript` is `false`, this setting is set to `null`. (See /misc/rate-sources for the available sources)"
} ,
"isCustomScript" : {
"type" : "boolean" ,
"description" : "Whether to use `preferredSource` with default script or a custom `effectiveScript`."
} ,
"effectiveScript" : {
"type" : "string" ,
"description" : "When `isCustomScript` is `true`, this represent the custom script used to calculate a currency pair's exchange rate. Else, it represent the script generated by the default rules and `preferredSource`."
}
}
} ,
2023-01-31 06:42:25 +01:00
"StoreRateResult" : {
2022-10-12 15:19:33 +02:00
"type" : "object" ,
"additionalProperties" : false ,
"properties" : {
"currencyPair" : {
"type" : "string" ,
2023-01-31 06:42:25 +01:00
"example" : "BTC_USD" ,
"description" : "Currency pair in the format of `BTC_USD`"
2022-10-12 15:19:33 +02:00
} ,
"errors" : {
"type" : "array" ,
"nullable" : true ,
"items" : {
"type" : "string"
} ,
"description" : "Errors relating to this currency pair fetching based on your config"
} ,
"rate" : {
2023-02-08 19:18:37 +09:00
"type" : "string" ,
"format" : "decimal" ,
"example" : "64392.23" ,
2023-01-31 06:42:25 +01:00
"description" : "the rate fetched based on the currency pair"
2022-10-12 15:19:33 +02:00
}
}
}
}
} ,
"tags" : [
{
2022-10-25 13:37:36 +02:00
"name" : "Stores (Rates Config)" ,
"description" : "Store Rates Config operations"
2022-10-12 15:19:33 +02:00
}
]
}