taler-docs

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

patch-accounts-USERNAME.rst (4772B)


      1 .. http:patch:: /accounts/$USERNAME
      2 
      3   Allows reconfiguring the account data of ``$USERNAME``.
      4 
      5   **Request:**
      6 
      7   .. ts:def:: AccountReconfiguration
      8 
      9     interface AccountReconfiguration {
     10       // Sparse update of the addresses where TANs are sent.
     11       // The object is merged with the stored contact data; it does not
     12       // replace the complete object.
     13       contact_data?: ChallengeContactDataPatch;
     14 
     15       // Payto URI of a fiat bank account.
     16       // Payments will be sent to this bank account
     17       // when the user wants to convert the regional currency
     18       // back to fiat currency outside bank.
     19       // Only admin can change this property if not allowed in config
     20       // Sending null will disable cashout
     21       cashout_payto_uri?: string | null;
     22 
     23       // If present, change the legal name associated with $username.
     24       // Only admin can change this property if not allowed in config
     25       name?: string;
     26 
     27       // Make this account visible to anyone?  Changing this to true
     28       // immediately exposes the balance, payto URI and complete existing and
     29       // future transaction history, including subjects and both parties'
     30       // payto URIs, without authentication.
     31       is_public?: boolean;
     32 
     33       // If present, change the max debit allowed for this user
     34       // Only admin can change this property.
     35       debit_threshold?: Amount;
     36 
     37       // If present, set the user conversion rate class
     38       // Only admin can set this property.
     39       // Sending null will remove the class and switch to default class
     40       // @since **v9**
     41       conversion_rate_class_id?: Integer | null;
     42 
     43       // @deprecated in **v10**
     44       // If present, enables 2FA and set the TAN channel used for challenges
     45       // Sending null will disable 2FA
     46       tan_channel?: TanChannel | null;
     47 
     48       // If present and not empty, enables 2FA and sets the TAN channels used
     49       // for challenges.  An empty array is the only representation for
     50       // disabling all TAN channels.
     51       // @since **v10**
     52       tan_channels?: TanChannel[];
     53 
     54       // @deprecated in **v9**, user conversion rate classes instead
     55       // FIXME-REMOVED-ALREADY: LibEuFin no longer implements this field
     56       // (the min_cashout column was dropped); deprecated here but gone from code.
     57       min_cashout?: Amount;
     58     }
     59 
     60   .. ts:def:: ChallengeContactDataPatch
     61 
     62     interface ChallengeContactDataPatch {
     63       // New e-mail address.  Null removes the stored e-mail address.
     64       // An omitted member leaves it unchanged.
     65       email?: EmailAddress | null;
     66 
     67       // New phone number.  Null removes the stored phone number.
     68       // An omitted member leaves it unchanged.
     69       phone?: PhoneNumber | null;
     70     }
     71 
     72   ``AccountReconfiguration`` is a sparse merge.  Omitting ``contact_data``
     73   leaves all contact data unchanged.  Within ``contact_data``, an omitted
     74   member is unchanged, a string replaces that member and ``null`` removes
     75   that member.  For example, the following removes only the phone number and
     76   preserves the e-mail address:
     77 
     78   .. code-block:: json
     79 
     80     {
     81       "contact_data": {
     82         "phone": null
     83       }
     84     }
     85 
     86   Removing contact data that is required by an enabled TAN channel is invalid
     87   unless the same PATCH also removes that channel from ``tan_channels``.
     88   Send ``"tan_channels": []`` to disable multi-factor authentication.  JSON
     89   ``null`` is not accepted for ``tan_channels``.
     90 
     91   **Response:**
     92 
     93   :http:statuscode:`202 Accepted`:
     94     2FA is required for this operation. This returns the `ChallengeResponse` response. @since **v10**
     95   :http:statuscode:`204 No content`:
     96     Operation successful.
     97   :http:statuscode:`401 Unauthorized`:
     98     Invalid or missing credentials.
     99   :http:statuscode:`403 Forbidden`:
    100     Missing rights.
    101   :http:statuscode:`404 Not found`:
    102     The account pointed by ``$USERNAME`` was not found.
    103   :http:statuscode:`409 Conflict`:
    104     * ``TALER_EC_BANK_NON_ADMIN_PATCH_LEGAL_NAME`` : a non-admin user has tried to change their legal name.
    105     * ``TALER_EC_BANK_NON_ADMIN_PATCH_CASHOUT`` : a non-admin user has tried to change their cashout account.
    106     * ``TALER_EC_BANK_NON_ADMIN_PATCH_DEBT_LIMIT`` : a non-admin user has tried to change their debt limit.
    107     * ``TALER_EC_BANK_NON_ADMIN_SET_CONVERSION_RATE_CLASS`` : a non-admin user has tried to create an account with a conversion rate class. Since **v9**
    108     * ``TALER_EC_BANK_TAN_CHANNEL_NOT_SUPPORTED`` : ``tan_channel`` or one of ``tan_channels`` is not supported, check bank config to find supported ones.
    109     * ``TALER_EC_BANK_MISSING_TAN_INFO`` : the user did not share any contact data where to send the TAN via ``tan_channel`` or one of ``tan_channels``.
    110     * ``TALER_EC_BANK_CONVERSION_RATE_CLASS_UNKNOWN`` : no conversion rate class found for this id. Since **v9**