const response = await fetch('https://dev.api.baanx.com/v1/auth/register/personal-details', {
method: 'POST',
headers: {
'x-client-key': 'your-client-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
onboardingId: sessionStorage.getItem('onboardingId'),
firstName: 'John',
lastName: 'Doe',
dateOfBirth: '1990-01-01',
countryOfNationality: 'GB',
// ssn: '123456789' // Only for US residents
})
});
const { user } = await response.json();
console.log('Personal details updated');