taler-docs

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

post-accounts-USERNAME-withdrawals.rst (1701B)


      1 .. http:post:: /accounts/$USERNAME/withdrawals
      2 
      3   Create a withdrawal operation, resulting in a ``taler://withdraw`` URI.
      4 
      5   **Request:**
      6 
      7   The request must be a `BankAccountCreateWithdrawalRequest`.
      8 
      9   **Response:**
     10 
     11   :http:statuscode:`200 Ok`:
     12     The bank responds with an `BankAccountCreateWithdrawalResponse` object.
     13   :http:statuscode:`401 Unauthorized`:
     14     Invalid or missing credentials.
     15   :http:statuscode:`403 Forbidden`:
     16     Missing rights.
     17   :http:statuscode:`404 Not found`:
     18     The account pointed by ``$USERNAME`` was not found.
     19   :http:statuscode:`409 Conflict`:
     20     The account does not have sufficient funds.
     21 
     22   **Details:**
     23 
     24   .. ts:def:: BankAccountCreateWithdrawalRequest
     25 
     26     interface BankAccountCreateWithdrawalRequest {
     27       // Amount to withdraw.  If given, the wallet
     28       // cannot change the amount.
     29       // Optional since **v6**.
     30       amount?: Amount;
     31 
     32       // Suggested amount to withdraw. The wallet can
     33       // still change the suggestion.
     34       // @since **v6**
     35       suggested_amount?: Amount;
     36 
     37       // If true, tell the wallet not to allow the user to
     38       // specify an amount to withdraw and to not provide
     39       // any amount when registering with the withdrawal
     40       // operation. The amount to withdraw will be set
     41       // by the final ``/withdrawals/$WITHDRAWAL_ID/confirm`` step.
     42       // @since **v8**
     43       no_amount_to_wallet?: boolean;
     44     }
     45 
     46   .. ts:def:: BankAccountCreateWithdrawalResponse
     47 
     48     interface BankAccountCreateWithdrawalResponse {
     49       // ID identifying the operation being created
     50       withdrawal_id: string;
     51 
     52       // URI that can be passed to the wallet to initiate the withdrawal
     53       taler_withdraw_uri: string;
     54     }