taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

post-conversion-rate-classes.rst (1926B)


      1 .. http:post:: /conversion-rate-classes
      2 
      3   Create a new conversion rate classe.
      4 
      5   Only available to the administrator.
      6 
      7   Since protocol **v9**.
      8 
      9   **Request:**
     10 
     11   .. ts:def:: ConversionRateClassInput
     12 
     13     interface ConversionRateClassInput {
     14       // The name of this class
     15       name: string;
     16 
     17       // A description of the class
     18       description?: string;
     19 
     20       // Minimum fiat amount authorised for cashin before conversion
     21       cashin_min_amount?: Amount;
     22 
     23       // Exchange rate to buy regional currency from fiat
     24       cashin_ratio?: DecimalNumber;
     25 
     26       // Regional amount fee to subtract after applying the cashin ratio.
     27       cashin_fee?: Amount;
     28 
     29       // Rounding mode used during cashin conversion
     30       cashin_rounding_mode?: "zero" | "up" | "nearest";
     31 
     32       // Minimum regional amount authorised for cashout before conversion
     33       cashout_min_amount?: Amount;
     34 
     35       // Exchange rate to sell regional currency for fiat
     36       cashout_ratio?: DecimalNumber;
     37 
     38       // Fiat amount fee to subtract after applying the cashout ratio.
     39       cashout_fee?: Amount;
     40 
     41       // Rounding mode used during cashout conversion
     42       cashout_rounding_mode?: "zero" | "up" | "nearest";
     43     }
     44 
     45   **Response:**
     46 
     47   :http:statuscode:`200 OK`:
     48     The conversion rate class request was correctly created.
     49     This returns the `ConversionRateClassResponse` response.
     50   :http:statuscode:`401 Unauthorized`:
     51     Invalid or missing credentials.
     52   :http:statuscode:`403 Forbidden`:
     53     Missing rights.
     54   :http:statuscode:`409 Conflict`:
     55     * ``TALER_EC_BANK_NAME_REUSE`` : name already used.
     56   :http:statuscode:`501 Not implemented`:
     57     This server does not support conversion, client should check config response.
     58 
     59   **Details:**
     60 
     61   .. ts:def:: ConversionRateClassResponse
     62 
     63     interface ConversionRateClassResponse {
     64       // ID identifying the conversion rate class being created
     65       conversion_rate_class_id: Integer;
     66     }