Contents

GET /cashout-rate#

This public endpoint allows clients to calculate the exchange rate between the regional currency and the fiat currency of the banking system.

This endpoint shows how the bank would apply the cash-out ratio and fee to one input amount. Typically, frontends ask this endpoint before creating cash-in operations.

Request:

Query Parameters:
  • amount_debit – this is the amount that the user will get deducted from their regional bank account.

or

Query Parameters:
  • amount_credit – this is the amount that the user will receive in their fiat bank account.

Response:

200 OK:

Response is a CashoutConversionResponse.

400 Bad request:
  • TALER_EC_GENERIC_PARAMETER_MISSING : none of the parameters have been provided.

  • TALER_EC_GENERIC_PARAMETER_MALFORMED : both of the parameters have been provided or one of them is not a valid Taler amount.

  • TALER_EC_GENERIC_CURRENCY_MISMATCH : the parameter is in the wrong currency.

401 Unauthorized:

Invalid credentials or missing rights.

403 Forbidden:

Missing rights.

409 Conflict:

The amount is too small to be converted because it produces an amount less than zero.

501 Not implemented:

This server does not support conversion, client should check config response.

Details:

interface CashoutConversionResponse {
  // Amount that the user will get deducted from their regional
  // bank account, according to the 'amount_credit' value.
  amount_debit: Amount;
  // Amount that the user will receive in their fiat
  // bank account, according to 'amount_debit'.
  amount_credit: Amount;
}