How to create a user account for an existing borrower.
The Create Borrower Account API creates a new user account for an existing borrower. This API should be used when you want to create a digital lending account for a borrower.
After the account is created, they will be signed in. You can add additional logic to your sign-in flow, including multi-factor phone authentication and email verification, by referring to response header. The header contains two fields encoded in the x-digifi-account JSON base64 string: isEmailNotVerified and isMfaIncomplete. These will either be true or undefined (no falsy value). Check these flags to optionally enforce phone authentication or email verification.
You can specify refresh token expiration time using refreshTokenExpirationTimeMinutes body param. By default it equals to "30" (minutes). Min value is 30 (a half an hour), Max value is 10080 (1 week).
Make sure to add this parameter to each API call
Create Account
Create Account (Accept Invitation)
Sign In (Create Session)
Please note the following validations:
- Each borrower can have only one user account (or zero).
- Every user account should have a unique email address.
- The "password" parameter must meet the following criteria: 8+ characters, at least 1 digit, lower case letter, upper case letter. (optional, if not passed, then we will generate a strong/unique password)
Example Requests
Below please find the JSON body for two example requests:
- Example 1: Creating an account that includes a phone number.
- Example 2: Creating an account without a phone number.
- Example 3: Creating an account without a password.
{
"email": "[email protected]",
"password": "123QW@qwe!",
"phone": "+19172249999",
"borrowerId": "507f281e810c19729de860ea"
}
{
"email": "[email protected]",
"password": "123QWEqwe",
"borrowerId": "507f281e810c19729de860ea"
}
{
"email": "[email protected]",
"phone": "+19172249999",
"borrowerId": "507f281e810c19729de860ea"
}