> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baanx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Physical Address

> Submit physical address during registration onboarding

## Overview

Submit user's physical residential address. This is required for KYC verification and compliance purposes.

For US residents, you can optionally specify a separate mailing address. For non-US residents, mailing address must be the same as physical address.

## Request

### Body

<ParamField body="onboardingId" type="string" required>
  Onboarding ID from previous step
</ParamField>

<ParamField body="addressLine1" type="string" required>
  Primary address line

  **Example**: `23 Werrington Bridge Rd`
</ParamField>

<ParamField body="addressLine2" type="string">
  Secondary address line (optional)

  **Example**: `Milking Nook`
</ParamField>

<ParamField body="city" type="string" required>
  City name

  **Example**: `Peterborough`
</ParamField>

<ParamField body="zip" type="string" required>
  Postal/ZIP code

  **Example**: `PE6 7PP`
</ParamField>

<ParamField body="usState" type="string">
  US state postal abbreviation

  **Required only if**: `countryOfResidence = US`

  **Example**: `CA`
</ParamField>

<ParamField body="isSameMailingAddress" type="boolean" required>
  Whether mailing address is same as physical

  **Must be true unless**: `countryOfResidence = US`

  **Example**: `true`
</ParamField>

## Response

<ResponseField name="accessToken" type="string">
  Access token (only if registration complete)

  Returned when `isSameMailingAddress = true` OR non-US resident

  **Example**: `US_100a99cf-f4d3-4fa1-c321-2e9833440ebb`
</ResponseField>

<ResponseField name="onboardingId" type="string">
  Updated onboarding ID
</ResponseField>

<ResponseField name="user" type="object">
  Updated user object with address
</ResponseField>

## Code Examples

<CodeGroup>
  ```javascript JavaScript theme={null}
  const response = await fetch('https://dev.api.baanx.com/v1/auth/register/address', {
    method: 'POST',
    headers: {
      'x-client-key': 'your-client-key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      onboardingId: sessionStorage.getItem('onboardingId'),
      addressLine1: '23 Werrington Bridge Rd',
      addressLine2: 'Milking Nook',
      city: 'Peterborough',
      zip: 'PE6 7PP',
      isSameMailingAddress: true
    })
  });

  const { accessToken, user } = await response.json();

  if (accessToken) {
    // Registration complete
    localStorage.setItem('access_token', accessToken);
    console.log('Registration complete!');
  } else {
    // US resident - need mailing address
    console.log('Proceed to mailing address step');
  }
  ```
</CodeGroup>

<Note>
  If `accessToken` is returned, registration is complete. Otherwise, proceed to mailing address step (US only).
</Note>

## Next Steps

<Card title="Update Mailing Address" href="/api-reference/auth/register-mailing-address">
  Add mailing address (US residents only)
</Card>
