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