post-accounts.rst (4631B)
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 // FIXME-REMOVED-ALREADY: LibEuFin no longer implements this field 71 // (the min_cashout column was dropped); deprecated here but gone from code. 72 min_cashout?: Amount; 73 } 74 75 .. ts:def:: ChallengeContactData 76 77 interface ChallengeContactData { 78 // E-Mail address 79 email?: EmailAddress; 80 81 // Phone number. 82 phone?: PhoneNumber; 83 } 84 85 86 **Response:** 87 88 :http:statuscode:`200 OK`: 89 Response is a `RegisterAccountResponse`. 90 :http:statuscode:`400 Bad request`: 91 Input data was invalid. For example, the client specified a invalid 92 phone number or e-mail address. 93 :http:statuscode:`401 Unauthorized`: 94 Invalid or missing credentials. 95 :http:statuscode:`403 Forbidden`: 96 Missing rights. 97 :http:statuscode:`409 Conflict`: 98 * ``TALER_EC_BANK_REGISTER_USERNAME_REUSE`` : username already used. 99 * ``TALER_EC_BANK_REGISTER_PAYTO_URI_REUSE`` : payto URI already used. 100 * ``TALER_EC_BANK_UNALLOWED_DEBIT`` : admin account does not have sufficient funds to grant bonus. 101 * ``TALER_EC_BANK_RESERVED_USERNAME_CONFLICT`` : a reserved username was attempted, like ``admin`` or ``bank`` 102 * ``TALER_EC_BANK_NON_ADMIN_PATCH_DEBT_LIMIT`` : a non-admin user has tried to create an account with a customer debt limit. 103 * ``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** 104 * ``TALER_EC_BANK_NON_ADMIN_SET_TAN_CHANNEL`` : a non-admin user has tried to create an account with 2fa. 105 * ``TALER_EC_BANK_TAN_CHANNEL_NOT_SUPPORTED``: ``tan_channel`` or one of ``tan_channels`` is not supported, check bank config to find supported ones. 106 * ``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``. 107 * ``TALER_EC_BANK_PASSWORD_TOO_SHORT``: password is shorter than 8 characters. 108 * ``TALER_EC_BANK_PASSWORD_TOO_LONG``: password is longer than 64 characters. 109 * ``TALER_EC_BANK_CONVERSION_RATE_CLASS_UNKNOWN`` : no conversion rate class found for this id. Since **v9** 110 111 **Details:** 112 113 .. ts:def:: RegisterAccountResponse 114 115 interface RegisterAccountResponse { 116 // Full payto URI of this bank account. 117 internal_payto_uri: string; 118 }