taler-docs

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

post-accounts.rst (4475B)


      1 .. http:post:: /accounts
      2 
      3   Create a new bank account.  Depending on the configuration,
      4   the account creation is self-serve, or only restricted to
      5   the administrators.
      6 
      7   **Request:**
      8 
      9   .. ts:def:: RegisterAccountRequest
     10 
     11     interface RegisterAccountRequest {
     12       // Username of the account
     13       // Must match [a-zA-Z0-9-._~]{1, 126}
     14       username: string;
     15 
     16       // Password of the account used for authentication
     17       password: string;
     18 
     19       // Legal name of the account owner
     20       name: string;
     21 
     22       // Make this account visible to anyone?
     23       // Defaults to false.
     24       is_public?: boolean;
     25 
     26       // Make this account a taler exchange account?
     27       // If true:
     28       // - incoming transactions to the account that do not
     29       //   have a valid reserve public key are automatically
     30       // - the account provides the taler-wire-gateway-api endpoints
     31       // Defaults to false.
     32       is_taler_exchange?: boolean;
     33 
     34       // Addresses where to send the TAN for protected operations.
     35       contact_data?: ChallengeContactData;
     36 
     37       // Payto URI of a fiat bank account.
     38       // Payments will be sent to this bank account
     39       // when the user wants to convert the regional currency
     40       // back to fiat currency outside bank.
     41       cashout_payto_uri?: string;
     42 
     43       // Simple payto URI of this bank account.
     44       // Used mostly for testing, this field is ignored if the bank payment
     45       // method is not IBAN.
     46       payto_uri?: string;
     47 
     48       // If present, set the max debit allowed for this user
     49       // Only admin can set this property.
     50       debit_threshold?: Amount;
     51 
     52       // If present, set the user conversion rate class
     53       // Only admin can set this property.
     54       // @since **v9**
     55       conversion_rate_class_id?: Integer;
     56 
     57       // @deprecated in **v10**
     58       // If present, enables 2FA and set the TAN channel used for challenges
     59       // Only admin can set this property, other user can reconfig their account
     60       // after creation.
     61       tan_channel?: TanChannel;
     62 
     63       // If present, enables 2FA and set the TAN channels used for challenges
     64       // Only admin can set this property, other user can reconfig their account
     65       // after creation.
     66       // @since **v10**
     67       tan_channels?: TanChannel[];
     68 
     69       // @deprecated in **v9**, use conversion_rate_class_id instead
     70       min_cashout?: Amount;
     71     }
     72 
     73   .. ts:def:: ChallengeContactData
     74 
     75     interface ChallengeContactData {
     76       // E-Mail address
     77       email?: EmailAddress;
     78 
     79       // Phone number.
     80       phone?: PhoneNumber;
     81     }
     82 
     83 
     84   **Response:**
     85 
     86   :http:statuscode:`200 OK`:
     87     Response is a `RegisterAccountResponse`.
     88   :http:statuscode:`400 Bad request`:
     89     Input data was invalid.  For example, the client specified a invalid
     90     phone number or e-mail address.
     91   :http:statuscode:`401 Unauthorized`:
     92     Invalid or missing credentials.
     93   :http:statuscode:`403 Forbidden`:
     94     Missing rights.
     95   :http:statuscode:`409 Conflict`:
     96     * ``TALER_EC_BANK_REGISTER_USERNAME_REUSE`` : username already used.
     97     * ``TALER_EC_BANK_REGISTER_PAYTO_URI_REUSE`` : payto URI already used.
     98     * ``TALER_EC_BANK_UNALLOWED_DEBIT`` : admin account does not have sufficient funds to grant bonus.
     99     * ``TALER_EC_BANK_RESERVED_USERNAME_CONFLICT`` : a reserved username was attempted, like ``admin`` or ``bank``
    100     * ``TALER_EC_BANK_NON_ADMIN_PATCH_DEBT_LIMIT`` : a non-admin user has tried to create an account with a customer debt limit.
    101     * ``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**
    102     * ``TALER_EC_BANK_NON_ADMIN_SET_TAN_CHANNEL`` : a non-admin user has tried to create an account with 2fa.
    103     * ``TALER_EC_BANK_TAN_CHANNEL_NOT_SUPPORTED``: ``tan_channel`` or one of ``tan_channels`` is not supported, check bank config to find supported ones.
    104     * ``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``.
    105     * ``TALER_EC_BANK_PASSWORD_TOO_SHORT``: password is shorter than 8 characters.
    106     * ``TALER_EC_BANK_PASSWORD_TOO_LONG``: password is longer than 64 characters.
    107     * ``TALER_EC_BANK_CONVERSION_RATE_CLASS_UNKNOWN`` : no conversion rate class found for this id. Since **v9**
    108 
    109   **Details:**
    110 
    111   .. ts:def:: RegisterAccountResponse
    112 
    113     interface RegisterAccountResponse {
    114       // Full payto URI of this bank account.
    115       internal_payto_uri: string;
    116     }