Skip to main content
POST
/
v1
/
auth
/
register
/
email
/
verify
{
  "hasAccount": true,
  "onboardingId": "<string>",
  "user": {}
}

Overview

Verify the code received by email and create a user account. This endpoint:
  1. Validates the verification code sent to the user’s email
  2. Creates a new user account with email and password
  3. Generates an onboarding ID for completing registration
  4. Returns user details and onboarding status
After successful verification, the user enters the onboarding flow to complete their profile.

Request

Body

email
string
required
User’s email addressExample: [email protected]
password
string
required
User’s chosen passwordSecurity: Should meet minimum strength requirementsExample: x1x2x3x4y1y2y3y4!!
verificationCode
string
required
6-digit code received by emailExample: 123456
contactVerificationId
string
required
Verification ID from email send stepExample: US_100a99cf-f4d3-4fa1-9be9-2e9828b20ebb
countryOfResidence
string
required
User’s country of residenceFormat: ISO 3166-1 alpha-2 codeExample: GB
allowMarketing
boolean
required
User consent for marketing communicationsExample: true
allowSms
boolean
required
User consent for SMS communicationsExample: true

Response

hasAccount
boolean
Whether email already has an accountExample: false
onboardingId
string
Onboarding ID for completing registrationStore this for subsequent onboarding stepsExample: US_100a99cf-f4d3-4fa1-c123-2e9833440ebb
user
object
Initial user object with minimal detailsAdditional details added in subsequent onboarding steps

Code Examples

const response = await fetch('https://dev.api.baanx.com/v1/auth/register/email/verify', {
  method: 'POST',
  headers: {
    'x-client-key': 'your-client-key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    email: '[email protected]',
    password: 'SecurePassword123!',
    verificationCode: '123456',
    contactVerificationId: sessionStorage.getItem('contactVerificationId'),
    countryOfResidence: 'GB',
    allowMarketing: true,
    allowSms: true
  })
});

const { onboardingId, user } = await response.json();
sessionStorage.setItem('onboardingId', onboardingId);
console.log('Account created, continue onboarding');

Next Steps

Send Phone Verification

Continue onboarding by verifying phone number