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

# Update a Legal User

export const Aml = ({content}) => <Tooltip tip="Regulations which require companies like Mangopay to implement measures that help ensure the money transacting through their system is legitimate.">
        {content}
    </Tooltip>;

<Warning>
  **Caution - Deprecated endpoint**

  The legacy User endpoints are deprecated. This endpoint will stop working and return an error after **Dec 15, 2025**.

  These endpoints were made redundant by the equivalent SCA-enabled endpoints during the introduction of SCA.

  Instead of calling this endpoint to change the `UserCategory` from `PAYER` to `OWNER`, your platform must call [PUT Categorize a Legal User](/api-reference/users/categorize-legal-user). You must also redirect the user on the `PendingUserAction.RedirectUrl` returned so they can [enroll in SCA](/guides/sca/users#transition-a-payer-to-owner).

  If you are not changing the `UserCategory`, then call the [PUT Update a Legal User (SCA)](/api-reference/users/update-legal-user-sca) endpoint instead of this deprecated endpoint. [SCA re-enrollment](/guides/sca/users#re-enroll-an-enrolled-owner) is required if your platform changes the `Email`, `PhoneNumber`, or `PhoneNumberCountry`.
</Warning>

<Warning>
  **Caution – Modification may cause KYC/B verification downgrade**

  If `KYCLevel` is `REGULAR`, modifying the following values triggers a [verification downgrade](/guides/users/verification/downgrade) to `LIGHT`:

  * `LegalRepresentativeFirstName`
  * `LegalRepresentativeLastName`
  * `LegalRepresentativeBirthday`
  * `LegalRepresentativeNationality`
  * `LegalPersonType`
</Warning>

<Note>
  **Note – Country-based restrictions apply to users**

  Due to Mangopay's [country restrictions](/guides/users/country-restrictions), it is not possible to use blocked countries as the following:

  * `HeadquartersAddress.Country`
  * `LegalRepresentativeNationality`
  * `LegalRepresentativeCountryOfResidence`
  * `LegalRepresentativeAddress.Country`
</Note>

### Path parameters

<ParamField path="UserId" type="string" required>
  The unique identifier of the user.
</ParamField>

### Body parameters

<ParamField body="UserCategory" type="string" required>
  **Allowed values:** `PAYER`, `OWNER`

  The [category](/guides/users/categories) of the user:

  * `PAYER` – User who can only make pay-ins to their wallets and transfers to other wallets (as well as refunds for pay-ins and transfers).
  * `OWNER` – User who can also receive transfers to their wallets. Owners are able to request [KYC verification](/guides/users/verification), which if successful gives them the `KYCLevel` of `REGULAR` and the ability to request payouts.
</ParamField>

<ParamField body="TermsAndConditionsAccepted" type="boolean" required>
  Whether the user has accepted Mangopay's terms and conditions (as defined by your contract, see the [T\&Cs guide](/guides/users/terms) for details).

  Must be `true` if `UserCategory` is `OWNER`.
</ParamField>

<ParamField body="LegalPersonType" type="string">
  **Allowed values:** BUSINESS, PARTNERSHIP, ORGANIZATION, SOLETRADER

  The type of legal user. For information on which `LegalPersonType` to use for a particular local legal structure, see the <a href="/guides/users/verification/requirements" target="_blank">verification requirements</a>.

  **Caution:** Modification of the `LegalPersonType` may result in a <a href="/guides/users/verification/downgrade" target="_blank">verification downgrade</a>.
</ParamField>

<ParamField body="Name" type="string">
  Max. length: 255 characters

  The registered legal name of the entity. The `Name` value should be the one registered with the relevant national authority.
</ParamField>

<ParamField body="Email" type="string">
  Format: A valid email address

  The email address for the entity.
</ParamField>

<ParamField body="HeadquartersAddress" type="object">
  Required if `UserCategory` is `OWNER`. Child parameters returned `null` if `UserCategory` is `PAYER`.

  The legally registered address of the entity’s administrative center.

  <Expandable title="properties">
    <ParamField body="AddressLine1" type="string" required>
      Max. length: 255 characters

      The first line of the address.
    </ParamField>

    <ParamField body="AddressLine2" type="string">
      Max. length: 255 characters

      The second line of the address.
    </ParamField>

    <ParamField body="City" type="string" required>
      Max. length: 255 characters

      The city of the address.
    </ParamField>

    <ParamField body="Region" type="string">
      Max. length: 255 characters

      Required if `Country` is US, CA, or MX.

      The region of the address.
    </ParamField>

    <ParamField body="PostalCode" type="string" required>
      Max. length: 255 characters

      The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
    </ParamField>

    <ParamField body="Country" type="string" required>
      The country of the address.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="CompanyNumber" type="string">
  Required if `UserCategory` is `OWNER` and `LegalPersonType` is `BUSINESS`. Returned `null` if `UserCategory` is `PAYER`.

  The registration number of the entity, assigned by the relevant national authority. For information on the expected format for a specific country, see the [Company number](/guides/users/verification/company-number) guide. To validate the format of a number before submitting documents for verification, use [POST Validate the format of User data](/api-reference/user-data-format/validate-user-data-format).
</ParamField>

<ParamField body="LegalRepresentativeAddress" type="object">
  The address of the entity’s legal representative.

  <Expandable title="properties">
    <ParamField body="AddressLine1" type="string" required>
      Max. length: 255 characters

      The first line of the address.
    </ParamField>

    <ParamField body="AddressLine2" type="string">
      Max. length: 255 characters

      The second line of the address.
    </ParamField>

    <ParamField body="City" type="string" required>
      Max. length: 255 characters

      The city of the address.
    </ParamField>

    <ParamField body="Region" type="string">
      Max. length: 255 characters

      Required if `Country` is US, CA, or MX.

      The region of the address.
    </ParamField>

    <ParamField body="PostalCode" type="string" required>
      Max. length: 255 characters

      The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
    </ParamField>

    <ParamField body="Country" type="string" required>
      Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

      The country of the address.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="LegalRepresentativeFirstName" type="string">
  *Min length: 1; max. length: 100*

  The first name of the entity's legal representative.
</ParamField>

<ParamField body="LegalRepresentativeLastName" type="string">
  *Min length: 1; max. length: 100*

  The last name of the entity's legal representative.
</ParamField>

<ParamField body="LegalRepresentativeEmail" type="string">
  Format: A valid email address

  The email address of the entity’s legal representative.

  Returned `null` if `UserCategory` is `PAYER`.
</ParamField>

<ParamField body="LegalRepresentativeBirthday" type="Unix timestamp">
  Required if `UserCategory` is `OWNER`. Returned `null` if `UserCategory` is `PAYER`.

  The date of birth of the entity’s legal representative.

  **Note:** This is a Unix timestamp in UTC. Ensure you convert your timezone to UTC to avoid midnight being interpreted as the day before.
</ParamField>

<ParamField body="LegalRepresentativeNationality" type="string">
  Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

  Required if `UserCategory` is `OWNER`. Returned `null` if `UserCategory` is `PAYER`.

  The nationality of the entity’s legal representative.
</ParamField>

<ParamField body="LegalRepresentativeCountryOfResidence" type="string">
  Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

  Required if `UserCategory` is `OWNER`. Returned `null` if `UserCategory` is `PAYER`.

  The country of residence of the entity’s legal representative.
</ParamField>

<ParamField body="Tag" type="string">
  Max. length: 255 characters

  Custom data that you can add to this object.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200">
    <ResponseField name="HeadquartersAddress" type="object">
      The legally registered address of the entity’s administrative center.\
      This object’s sub-parameters are `null` if the `UserCategory` is `PAYER`.

      <Expandable title="properties">
        <ResponseField name="AddressLine1" type="string">
          Max. length: 255 characters

          The first line of the address.
        </ResponseField>

        <ResponseField name="AddressLine2" type="string">
          Max. length: 255 characters

          The second line of the address.
        </ResponseField>

        <ResponseField name="City" type="string">
          Max. length: 255 characters

          The city of the address.
        </ResponseField>

        <ResponseField name="Region" type="string">
          Max. length: 255 characters

          The region of the address. This field is optional except if the `Country` is US, CA, or MX.
        </ResponseField>

        <ResponseField name="PostalCode" type="string">
          Max. length: 255 characters

          The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
        </ResponseField>

        <ResponseField name="Country" type="string">
          Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

          The country of the address.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="LegalRepresentativeAddress" type="object">
      The address of the entity’s legal representative.

      <Expandable title="properties">
        <ResponseField name="AddressLine1" type="string">
          Max. length: 255 characters

          The first line of the address.
        </ResponseField>

        <ResponseField name="AddressLine2" type="string">
          Max. length: 255 characters

          The second line of the address.
        </ResponseField>

        <ResponseField name="City" type="string">
          Max. length: 255 characters

          The city of the address.
        </ResponseField>

        <ResponseField name="Region" type="string">
          Max. length: 255 characters

          The region of the address. This field is optional except if the `Country` is US, CA, or MX.
        </ResponseField>

        <ResponseField name="PostalCode" type="string">
          Max. length: 255 characters

          The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
        </ResponseField>

        <ResponseField name="Country" type="string">
          Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

          The country of the address.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="Name" type="string">
      Max. length: 255 characters

      The registered legal name of the entity. The `Name` value should be the one registered with the relevant national authority.
    </ResponseField>

    <ResponseField name="LegalPersonType" type="string">
      **Returned values:** BUSINESS, PARTNERSHIP, ORGANIZATION, SOLETRADER

      The type of legal user. For information on which `LegalPersonType` to use for a particular local legal structure, see the <a href="/guides/users/verification/requirements" target="_blank">verification requirements</a>.

      **Caution:** Modification of the `LegalPersonType` may result in a <a href="/guides/users/verification/downgrade" target="_blank">verification downgrade</a>.
    </ResponseField>

    <ResponseField name="LegalRepresentativeFirstName" type="string">
      Min. length: 1; max. length: 100

      The first name of the entity’s legal representative.
    </ResponseField>

    <ResponseField name="LegalRepresentativeLastName" type="string">
      Min. length: 1; max. length: 100

      The last name of the entity’s legal representative.
    </ResponseField>

    <ResponseField name="LegalRepresentativeEmail" type="string">
      Format: A valid email address

      The email address of the entity’s legal representative.

      Returned `null` if `UserCategory` is `PAYER`.
    </ResponseField>

    <ResponseField name="LegalRepresentativeBirthday" type="Unix timestamp">
      The date of birth of the entity’s legal representative.

      Returned `null` if `UserCategory` is `PAYER`.

      **Note:** This is a Unix timestamp in UTC. Ensure you convert your timezone to UTC to avoid midnight being interpreted as the day before.
    </ResponseField>

    <ResponseField name="LegalRepresentativeNationality" type="string">
      Returned `null` if `UserCategory` is `PAYER`.

      The nationality of the entity’s legal representative.
    </ResponseField>

    <ResponseField name="LegalRepresentativeCountryOfResidence" type="string">
      Returned `null` if `UserCategory` is `PAYER`.

      The country of residence of the entity’s legal representative.
    </ResponseField>

    <ResponseField name="ProofOfRegistration" type="string">
      The `Id` of the KYC Document whose `Type` is `REGISTRATION_PROOF` if validated for the user. If no registration proof is validated, then this value is `null`.
    </ResponseField>

    <ResponseField name="ShareholderDeclaration" type="string">
      The `Id` of the KYC Document whose `Type` is `SHAREHOLDERS_DECLARATION` if validated for the user. If no Shareholder Declaration is validated, then this value is `null`.
    </ResponseField>

    <ResponseField name="Statute" type="string">
      The `Id` of the KYC Document whose `Type` is `ARTICLES_OF_ASSOCIATION` if validated for the user. If no articles of association document is validated, then this value is `null`.
    </ResponseField>

    <ResponseField name="LegalRepresentativeProofOfIdentity" type="string">
      The `Id` of the KYC Document whose `Type` is `IDENTITY_PROOF` if validated for the user. If no identity proof is validated, then this value is `null`.
    </ResponseField>

    <ResponseField name="CompanyNumber" type="string">
      Required if `UserCategory` is `OWNER` and `LegalPersonType` is `BUSINESS`. Returned `null` if `UserCategory` is `PAYER`.

      The registration number of the entity, assigned by the relevant national authority. For information on the expected format for a specific country, see the [Company number](/guides/users/verification/company-number) guide. To validate the format of a number before submitting documents for verification, use [POST Validate the format of User data](/api-reference/user-data-format/validate-user-data-format).
    </ResponseField>

    <ResponseField name="Id" type="string">
      Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details)

      The unique identifier of the object.
    </ResponseField>

    <ResponseField name="Tag" type="string">
      Max. length: 255 characters

      Custom data that you can add to this object.
    </ResponseField>

    <ResponseField name="CreationDate" type="Unix timestamp">
      The date and time at which the object was created.
    </ResponseField>

    <ResponseField name="PersonType" type="string">
      **Returned values:** NATURAL, LEGAL

      The type of the user:

      * `NATURAL` – Natural users are individuals (natural persons).
      * `LEGAL` – Legal users are legal entities (legal persons) like companies, non-profits, and sole proprietors.

      The `PersonType` is defined by the endpoint used to create the user and can’t be modified.
    </ResponseField>

    <ResponseField name="Email" type="string">
      Format: A valid email address

      The email address for the entity.
    </ResponseField>

    <ResponseField name="KYCLevel" type="string">
      **Default value:** `LIGHT`

      **Returned values:** `LIGHT`, `REGULAR`

      The verification status of the user set by Mangopay:

      * `LIGHT` – Unverified, assigned by default to all users.
      * `REGULAR` – Verified, meaning the user has successfully completed the verification process and had the necessary documents validated by Mangopay. Only users whose `UserCategory` is `OWNER` can submit verification documents for validation. Only users whose `KYCLevel` is `REGULAR` can request payouts.
    </ResponseField>

    <ResponseField name="TermsAndConditionsAccepted" type="boolean">
      Whether the user has accepted Mangopay's terms and conditions (as defined by your contract, see the [T\&Cs guide](/guides/users/terms) for details).

      Must be `true` if `UserCategory` is `OWNER`.
    </ResponseField>

    <ResponseField name="TermsAndConditionsAcceptedDate" type="Unix timestamp">
      The date and time at which the `TermsAndConditionsAccepted` value was set to `true`.

      Returned `null` if `UserCategory` is `PAYER`.
    </ResponseField>

    <ResponseField name="UserCategory" type="string">
      **Possible values:** `PAYER`, `OWNER`, `PLATFORM`

      The [category](/guides/users/categories) of the user:

      * `PAYER` – User who can only make pay-ins to their wallets and transfers to other wallets (as well as refunds for pay-ins and transfers).
      * `OWNER` – User who can also receive transfers to their wallets. Owners are able to request [KYC verification](/guides/users/verification), which if successful gives them the `KYCLevel` of `REGULAR` and the ability to request payouts.
      * `PLATFORM` – Single specific user that represents the platform. The `PLATFORM` value is only assigned by Mangopay and may be used as part of the validated workflow implemented by the platform.
    </ResponseField>

    <ResponseField name="UserStatus" type="string">
      **Returned values:** ACTIVE, CLOSED

      Internal use only. This field can only be used and updated by Mangopay teams.
    </ResponseField>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="400 - Platform can't change OWNER to PAYER">
    ```json theme={null}
    {
        "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
        "Type": "param_error",
        "Id": "2633f582-b269-499f-bef0-8ae378b3be35",
        "Date": 1707907057.0,
        "errors": {
            "UserCategory": "A User OWNER can't be modified to a user PAYER"
        }
    }  
    ```
  </Accordion>

  <Accordion title="400 - Data doesn't comply with anti-fraud policy">
    ```json theme={null}
    {
        "Message": "The data you provided does not comply with our anti-fraud policy",
        "Type": "fraud_policy",
        "Id": "51876239-4814-422e-8f4b-6986520414bb#1750420019",
        "Date": 1750420020,
        "errors": null
    }
    ```

    Read more about Mangopay's [AML rules on user data](/guides/users/types#rules-on-user-data) **→**
  </Accordion>

  <Accordion title="400 - Invalid email">
    ```json theme={null}
    {
        "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
        "Type": "param_error",
        "Id": "864a164a-cbb9-4e9d-b140-2b83c720e729",
        "Date": 1690291065.0,
        "errors": {
            "LegalRepresentative.Email": "The field Email must match the regular expression '([a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*)@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?'."
        }
    }  
    ```
  </Accordion>

  <Accordion title="400 - Restricted country">
    ```json theme={null}
    {
        "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
        "Type": "param_error",
        "Id": "733c8dbc-2770-4cc4-80d4-63d684cff38c#1750669115",
        "Date": 1750669116,
        "errors": {
            "HeadquartersAddress.Country": "The HeadquartersAddress.Country used is blocked"
        }
    }
    ```

    Read more about [country restrictions](/guides/users/country-restrictions) **→**
  </Accordion>

  <Accordion title="400 - Terms and conditions acceptance can't be revoked">
    ```json theme={null}
    {
        "Message": "The user cannot revoke the terms and conditions acceptance",
        "Type": "invalid_action",
        "Id": "5d0f2332-3808-4235-ab62-2ebac79f213c",
        "Date": 1690290952.0,
        "errors": null
    }  
    ```
  </Accordion>

  <Accordion title="403 - TermsAndConditionsAccepted must be true if OWNER">
    ```json theme={null}
    {
      "Message": "User must accept the terms and conditions before account creation or modification.",
      "Type": "user_hasnt_accepted_terms_and_conditions",
      "Id": "dbbc752b-6f9f-4248-a4bb-04ee0ba7b4b7",
      "Date": 1730810728,
      "errors": null
    }  
    ```
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json REST - Payer   theme={null}
  {
      "HeadquartersAddress": {
          "AddressLine1": null,
          "AddressLine2": null,
          "City": null,
          "Region": null,
          "PostalCode": null,
          "Country": null
      },
      "LegalRepresentativeAddress": {
          "AddressLine1": "34 rue des Entreprises",
          "AddressLine2": "Appartement 14",
          "City": "Paris",
          "Region": "Île-de-France",
          "PostalCode": "75001",
          "Country": "FR"
      },
      "Name": "Best Business",
      "LegalPersonType": "BUSINESS",
      "LegalRepresentativeFirstName": "Alex",
      "LegalRepresentativeLastName": "Smith",
      "LegalRepresentativeEmail": null,
      "LegalRepresentativeBirthday": null,
      "LegalRepresentativeNationality": null,
      "LegalRepresentativeCountryOfResidence": null,
      "ProofOfRegistration": null,
      "ShareholderDeclaration": null,
      "Statute": null,
      "LegalRepresentativeProofOfIdentity": null,
      "CompanyNumber": null,
      "Id": "user_m_01JHX2YFX51HSR8R2HJ8ABSEFF",
      "Tag": "New tag",
      "CreationDate": 1670863988,
      "PersonType": "LEGAL",
      "Email": "best.business@example.com",
      "KYCLevel": "LIGHT",
      "TermsAndConditionsAccepted": false,
      "TermsAndConditionsAcceptedDate": null,
      "UserCategory": "PAYER",
      "UserStatus": "ACTIVE"
  }  
  ```

  ```json REST - Owner   theme={null}
  {
      "HeadquartersAddress": {
          "AddressLine1": "34 rue des Entreprises",
          "AddressLine2": "Batiment B",
          "City": "Paris",
          "Region": "Île-de-France",
          "PostalCode": "75001",
          "Country": "FR"
      },
      "LegalRepresentativeAddress": {
          "AddressLine1": "3 rue de la Cité",
          "AddressLine2": "Appartement 7",
          "City": "Paris",
          "Region": "Île-de-France",
          "PostalCode": "75004",
          "Country": "FR"
      },
      "Name": "Best Business",
      "LegalPersonType": "BUSINESS",
      "LegalRepresentativeFirstName": "Alex",
      "LegalRepresentativeLastName": "Smith",
      "LegalRepresentativeEmail": "alex.smith@example.com",
      "LegalRepresentativeBirthday": 652117514,
      "LegalRepresentativeNationality": "FR",
      "LegalRepresentativeCountryOfResidence": "FR",
      "ProofOfRegistration": null,
      "ShareholderDeclaration": null,
      "Statute": null,
      "LegalRepresentativeProofOfIdentity": null,
      "CompanyNumber": "123456789",
      "Id": "user_m_01JHX2YFX51HSR8R2HJ8ABSEFF",
      "Tag": "Created using MANGOPAY API Collection Postman",
      "CreationDate": 1670864174,
      "PersonType": "LEGAL",
      "Email": "best.business@example.com",
      "KYCLevel": "LIGHT",
      "TermsAndConditionsAccepted": true,
      "TermsAndConditionsAcceptedDate": 1670864174,
      "UserCategory": "OWNER",
      "UserStatus": "ACTIVE"
  }  
  ```
</ResponseExample>

<RequestExample>
  ```json REST - Payer theme={null}
  {
      "UserCategory": "PAYER",
      "TermsAndConditionsAccepted": false,
      "Tag": "New tag"
  }
  ```

  ```json REST - Owner theme={null}
  {
      "UserCategory": "OWNER",
      "TermsAndConditionsAccepted": true,
      "HeadquartersAddress": {
          "AddressLine1": "34 rue des Entreprises",
          "AddressLine2": "Batiment B",
          "City": "Paris",
          "Region": "Île-de-France",
          "PostalCode": "75001",
          "Country": "FR"
      },
      "CompanyNumber": "123456789",
      "LegalRepresentativeEmail": "alex.smith@example.com",
      "LegalRepresentativeBirthday": 652117514,
      "LegalRepresentativeNationality": "FR",
      "LegalRepresentativeCountryOfResidence": "FR"
  }
  ```

  ```php PHP theme={null}
  <?php 

  require_once 'vendor/autoload.php';

  use MangoPay\MangoPayApi;
  use MangoPay\Libraries\ResponseException as MGPResponseException;
  use MangoPay\Libraries\Exception as MGPException;

  $api = new MangoPayApi();

  $api->Config->ClientId = 'your-client-id';
  $api->Config->ClientPassword = 'your-api-key';
  $api->Config->TemporaryFolder = 'tmp/';

  try {
      $userId = 'user_m_01HYJVHY77NDDM97TQP57W87MH';
      $user = $api->Users->Get($userId);

      $user->Name = 'Smith corp';
      $user->Email = 'smithupdated@example.com';
      $user->LegalPersonType = \MangoPay\LegalPersonType::Business;
      
      $address = new \MangoPay\Address();
      $address->AddressLine1 = 'Rue des plantes';
      $address->AddressLine2 = '2nd floor';
      $address->City = 'Paris';
      $address->Country = 'FR';
      $address->PostalCode = '75000';
      $address->Region = 'IDF';
      
      $user->HeadquartersAddress = $address;
      $user->LegalRepresentativeAddress = $address;
      
      $user->LegalRepresentativeFirstName = 'Alex';
      $user->LegalRepresentativeLastName = 'Smith';
      $user->LegalRepresentativeEmail = 'asmith@example.com';
      $user->LegalRepresentativeBirthday = mktime(0, 0, 0, 12, 21, 1975);
      $user->LegalRepresentativeNationality = 'FR';
      $user->LegalRepresentativeCountryOfResidence = 'FR';
      $user->CompanyNumber = 'LU123456';
      
      $user->Tag = 'Updated using Mangopay PHP SDK';
      
      $user->TermsAndConditionsAccepted = true;
      $user->UserCategory = 'Owner';
      
      $response = $api->Users->Update($user);

      print_r($response);
  } catch(MGPResponseException $e) {
      print_r($e);
  } catch(MGPException $e) {
      print_r($e);
  }  
  ```

  ```javascript NodeJS   theme={null}
  const mangopayInstance = require('mangopay4-nodejs-sdk')
  const mangopay = new mangopayInstance({
    clientId: 'your-client-id',
    clientApiKey: 'your-api-key',
  }) 

  let myLegalUser = {
    Id: 'user_m_01HYJVHY77NDDM97TQP57W87MH',
    HeadquartersAddress: {
      AddressLine1: '57 Main Road',
      AddressLine2: null,
      City: 'London',
      PostalCode: 'NW1 4RG',
      Country: 'GB',
    },
    LegalRepresentativeAddress: {
      AddressLine1: '35 London Road',
      AddressLine2: null,
      City: 'London',
      PostalCode: 'NW1 0AA',
      Country: 'GB',
    },
    Name: 'Executive Consulting',
    LegalPersonType: 'BUSINESS',
    LegalRepresentativeFirstName: 'Juliana',
    LegalRepresentativeLastName: 'Dunn',
    LegalRepresentativeEmail: 'juliana.dunn@example.com',
    LegalRepresentativeBirthday: 188301600,
    LegalRepresentativeNationality: 'GB',
    LegalRepresentativeCountryOfResidence: 'GB',
    CompanyNumber: '12345678',
    Tag: 'Created using the Mangopay NodeJS SDK',
    Email: 'executive.consulting@example.com',
    TermsAndConditionsAccepted: true,
    UserCategory: 'OWNER',
    PersonType: 'LEGAL',
  }

  const updateLegalUser = async (legalUser) => {
    return await mangopay.Users.update(legalUser)
      .then((response) => {
        console.info(response)
        return response
      })
      .catch((err) => {
        console.log(err)
        return false
      })
  }

  updateLegalUser(myLegalUser)  
  ```

  ```ruby Ruby   theme={null}
  require 'mangopay'

  MangoPay.configure do |client|
      client.preproduction = true
      client.client_id = 'your-client-id'
      client.client_apiKey = 'your-api-key'
      client.log_file = File.join(Dir.pwd, 'mangopay.log')
  end

  def updateLegalUser(legalUserId, legalUserObject)
      begin
          response = MangoPay::LegalUser.update(legalUserId, legalUserObject)
          puts response
          return response
      rescue MangoPay::ResponseError => error
          puts "Failed to update User: #{error.message}"
          puts "Error details: #{error.details}"
          return false
      end
  end

  myLegalUser = {
      Id: '194338122',
      HeadquartersAddress: {
      AddressLine1: '57 Main Road',
      AddressLine2: 'PB 456',
      City: 'London',
      PostalCode: 'NW1 4RG',
      Country: 'GB',
    },
    LegalRepresentativeAddress: {
      AddressLine1: '35 London Road',
      City: 'London',
      PostalCode: 'NW1 0AA',
      Country: 'GB',
    },
    Name: 'Executive Consulting',
    LegalPersonType: 'BUSINESS',
    LegalRepresentativeFirstName: 'Juliana',
    LegalRepresentativeLastName: 'Dunn',
    LegalRepresentativeEmail: 'juliana.dunn@example.com',
    LegalRepresentativeBirthday: 188301600,
    LegalRepresentativeNationality: 'GB',
    LegalRepresentativeCountryOfResidence: 'GB',
    CompanyNumber: '12345678',
    Tag: 'Updated using the Mangopay Ruby SDK',
    Email: 'executive.consulting@example.com',
    TermsAndConditionsAccepted: true,
    UserCategory: 'OWNER',
    PersonType: 'LEGAL'
  }

  updateLegalUser(myLegalUser[:Id], myLegalUser)  
  ```

  ```java Java   theme={null}
  import com.mangopay.MangoPayApi;
  import com.mangopay.core.Address;
  import com.mangopay.entities.User;
  import com.mangopay.entities.UserLegal;

  import java.lang.reflect.Field;

  public class UpdateLegalUser {
      public static void main(String[] args) throws Exception {
          MangoPayApi mangopay = new MangoPayApi();
          mangopay.getConfig().setClientId("your-client-id");
          mangopay.getConfig().setClientPassword("your-api-key");

          UserLegal myUser = mangopay.getUserApi().getLegal("user_m_01HRS7PQEGE4YGCM1AZK1ENTGE");

          myUser.setName("C. Dickinson");
          myUser.setEmail("best@dickinson.com");

          User updateUser = mangopay.getUserApi().update(myUser);
          
          System.out.println(String.format("id: %s", updateUser.getId()));
          printObjectFields(updateUser);
      }

      private static void printObjectFields(Object obj) {
          Class<?> objClass = obj.getClass();
          Field[] fields = objClass.getDeclaredFields();
          for (Field field : fields) {
              field.setAccessible(true);
              try {
                  Object value = field.get(obj);
                  if (value instanceof Address) {
                      System.out.println(field.getName() + ": ");
                      printObjectFields(value); 
                  } else {
                      System.out.println(field.getName() + ": " + value);
                  }
              } catch (IllegalAccessException e) {
                  e.printStackTrace();
              }
          }
      }
  }  
  ```

  ```python Python   theme={null}
  from pprint import pprint
  import mangopay

  mangopay.client_id = 'your-client-id'
  mangopay.apikey = 'your-api-key'

  from mangopay.api import APIRequest
  handler = APIRequest(sandbox=True)

  from mangopay.resources import LegalUser

  legal_user = LegalUser(
      id = '210602889',  # ID of legal user to update
      legal_person_type = 'SOLETRADER' # Add elements with update details  
  )

  update_legal_user = legal_user.save()

  pprint(update_legal_user)
  ```

  ```csharp .NET  theme={null}
  using MangoPay.SDK;
  using MangoPay.SDK.Entities.PUT;
  using Newtonsoft.Json;

  class Program
  {
      static async Task Main(string[] args)
      {
          MangoPayApi api = new MangoPayApi();

          api.Config.ClientId = "your-client-id";
          api.Config.ClientPassword = "your-api-key";

          var userId = "user_m_01J2V0P9B1WCX46GEBDWCTXNQ0";

          var myUser = new UserLegalPutDTO {
              TermsAndConditionsAccepted = true,
              Tag = "Updated using the Mangopay .NET SDK"
          };

          var updateNaturalUser = await api.Users.UpdateLegalAsync(myUser, userId);

          string prettyPrint = JsonConvert.SerializeObject(updateNaturalUser, Formatting.Indented);
          Console.WriteLine(prettyPrint);
      }
  }
  ```
</RequestExample>
