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