commit 595f538463bb43c1299d1d9151267cf16ec9b4ac
parent 6148711d1534a44566e1e75d04f8d1a30ca99470
Author: Antoine A <>
Date: Fri, 24 Nov 2023 12:43:10 +0000
Update conversion info API
Diffstat:
1 file changed, 52 insertions(+), 34 deletions(-)
diff --git a/core/api-bank-conversion-info.rst b/core/api-bank-conversion-info.rst
@@ -66,40 +66,7 @@ is used by wallets for withdrawals that involve a currency conversion.
// Additional information on conversion rates.
// Those informations should never be used to perform conversions,
// use /cashin-rate or /cashout-rate instead.
- // They are provided for information purposes only and may be changed
- // at any time. Adding or deleting fields is not considered a breaking
- // change and client should not break if this happens.
- conversion_info: {
- // Exchange rate to buy regional currency from fiat
- cashin_ratio: DecimalNumber;
-
- // Exchange rate to sell regional currency for fiat
- cashout_ratio: DecimalNumber;
-
- // Fee to subtract after applying the cashin ratio.
- cashin_fee: Amount;
-
- // Fee to subtract after applying the cashout ratio.
- cashout_fee: Amount;
-
- // Minimum amount authorised for cashin, in fiat before conversion
- cashin_min_amount: Amount;
-
- // Minimum amount authorised for cashout, in regional before conversion
- cashout_min_amount: Amount;
-
- // Smallest possible regional amount, converted amount is rounded to this amount
- cashin_tiny_amount: Amount;
-
- // Smallest possible fiat amount, converted amount is rounded to this amount
- cashout_tiny_amount: Amount;
-
- // Rounding mode used during cashin conversion
- cashin_rounding_mode: "zero" | "up" | "nearest";
-
- // Rounding mode used during cashout conversion
- cashout_rounding_mode: "zero" | "up" | "nearest";
- }
+ conversion_rate: ConversionRate;
}
@@ -195,3 +162,54 @@ is used by wallets for withdrawals that involve a currency conversion.
// bank account, according to 'amount_debit'.
amount_credit: Amount;
}
+
+.. http:post:: /conversion-rate
+
+ This endpoint allows the administrator to update
+ the exchange rate between the regional currency
+ and the fiat currency of the banking system.
+
+ **Request:**
+
+ .. ts:def:: ConversionRate
+
+ interface ConversionRate {
+ // Exchange rate to buy regional currency from fiat
+ cashin_ratio: DecimalNumber;
+
+ // Exchange rate to sell regional currency for fiat
+ cashout_ratio: DecimalNumber;
+
+ // Fee to subtract after applying the cashin ratio.
+ cashin_fee: Amount;
+
+ // Fee to subtract after applying the cashout ratio.
+ cashout_fee: Amount;
+
+ // Minimum amount authorised for cashin, in fiat before conversion
+ cashin_min_amount: Amount;
+
+ // Minimum amount authorised for cashout, in regional before conversion
+ cashout_min_amount: Amount;
+
+ // Smallest possible regional amount, converted amount is rounded to this amount
+ cashin_tiny_amount: Amount;
+
+ // Smallest possible fiat amount, converted amount is rounded to this amount
+ cashout_tiny_amount: Amount;
+
+ // Rounding mode used during cashin conversion
+ cashin_rounding_mode: "zero" | "up" | "nearest";
+
+ // Rounding mode used during cashout conversion
+ cashout_rounding_mode: "zero" | "up" | "nearest";
+ }
+
+ **Response:**
+
+ :http:statuscode:`204 No content`:
+ Operation successful.
+ :http:statuscode:`401 Unauthorized`:
+ Invalid credentials or missing rights.
+ :http:statuscode:`501 Not implemented`:
+ This server does not support conversion, client should check config response.