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

# Update Legal Data

> Update the legal and fiscal information of an organization

## Description

Updates the legal and fiscal data of an organization including tax system, legal name, address, and contact information. Only the organization owner can perform this action.

## Authorization

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication
</ParamField>

## Path Parameters

<ParamField path="id" type="string" required>
  The unique ID of the organization
</ParamField>

## Body Parameters

<ParamField body="name" type="string">
  Organization display name (1-100 characters)
</ParamField>

<ParamField body="legal_name" type="string">
  Legal name / Razón Social (1-250 characters)
</ParamField>

<ParamField body="tax_system" type="string">
  Tax system code / Régimen Fiscal (e.g., "601", "603")
</ParamField>

<ParamField body="website" type="string">
  Organization website URL
</ParamField>

<ParamField body="support_email" type="string">
  Support email address
</ParamField>

<ParamField body="phone" type="string">
  Phone number (10-20 characters)
</ParamField>

<ParamField body="address" type="object">
  Organization address

  <Expandable title="address properties">
    <ParamField body="street" type="string" required>
      Street name (1-200 characters)
    </ParamField>

    <ParamField body="exterior" type="integer" required>
      Exterior number (minimum 1)
    </ParamField>

    <ParamField body="interior" type="integer">
      Interior number or unit (minimum 1)
    </ParamField>

    <ParamField body="neighborhood" type="string" required>
      Neighborhood or colony (1-100 characters)
    </ParamField>

    <ParamField body="city" type="string" required>
      City name (1-100 characters)
    </ParamField>

    <ParamField body="municipality" type="string" required>
      Municipality name (1-100 characters)
    </ParamField>

    <ParamField body="zip" type="integer" required>
      ZIP code (5 digits, 10000-99999)
    </ParamField>

    <ParamField body="state" type="string" required>
      State name (1-100 characters)
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="id" type="string">
  Organization ID
</ResponseField>

<ResponseField name="name" type="string">
  Organization name
</ResponseField>

<ResponseField name="razonSocial" type="string">
  Legal name (Razón Social)
</ResponseField>

<ResponseField name="regimenFiscalId" type="string">
  Tax system UUID
</ResponseField>

<ResponseField name="website" type="string">
  Organization website
</ResponseField>

<ResponseField name="phone" type="string">
  Phone number
</ResponseField>

<ResponseField name="selfInvoiceSupportEmail" type="string">
  Support email
</ResponseField>

<ResponseField name="addressStreet" type="string">
  Street name
</ResponseField>

<ResponseField name="addressExterior" type="string">
  Exterior number
</ResponseField>

<ResponseField name="addressInterior" type="string">
  Interior number
</ResponseField>

<ResponseField name="addressNeighborhood" type="string">
  Neighborhood
</ResponseField>

<ResponseField name="addressCity" type="string">
  City
</ResponseField>

<ResponseField name="addressMunicipality" type="string">
  Municipality
</ResponseField>

<ResponseField name="addressZip" type="string">
  ZIP code
</ResponseField>

<ResponseField name="addressState" type="string">
  State
</ResponseField>

<ResponseField name="updatedAt" type="string">
  Last update timestamp
</ResponseField>

## Example Request

```bash theme={null}
curl -X PUT "https://api.timbrix.com/organizations/550e8400-e29b-41d4-a716-446655440000/legal" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Mi Empresa",
    "legal_name": "Mi Empresa S.A. de C.V.",
    "tax_system": "601",
    "website": "https://miempresa.com",
    "support_email": "soporte@miempresa.com",
    "phone": "+52 644 123 4567",
    "address": {
      "street": "Blvd. Atardecer",
      "exterior": 142,
      "interior": 4,
      "neighborhood": "Centro",
      "city": "Huatabampo",
      "municipality": "Huatabampo",
      "zip": 86500,
      "state": "Sonora"
    }
  }'
```

## Response Codes

<ResponseField name="200" type="OK">
  Organization legal data updated successfully
</ResponseField>

<ResponseField name="400" type="Bad Request">
  Invalid input data or tax system code not found
</ResponseField>

<ResponseField name="401" type="Unauthorized">
  Authentication required
</ResponseField>

<ResponseField name="403" type="Forbidden">
  Access denied. Only organization owners can update legal data
</ResponseField>

<ResponseField name="404" type="Not Found">
  Organization not found
</ResponseField>

## Security

⚠️ **OWNER ONLY**: Only the organization OWNER can update legal and fiscal information. Admins and members cannot perform this action.

## Notes

* All fields are optional - you can update only the fields you need to change
* The `tax_system` field accepts tax regime codes (e.g., "601", "603") and automatically resolves to the corresponding UUID
* If the tax system code doesn't exist in the database, a 400 error will be returned
* Address can be updated partially or completely
