# Update a company

Source: https://developer.avalara.com/products/e-invoicing/integration-guides/elr/tgb3611067281997/

Guide: E-Invoicing and Live Reporting

# Update a company

Update a company in ELR and map it to a business system using identifiers.

**Endpoint**: `PUT /scs/companies/:companyId`

Update a company.

Use this endpoint after a successful connection to map your business system company to an Avalara company. Add the ERP company identifier to the company record using `aspects.namespace` and `aspects.identifier`.

An identifier within a namespace must be unique. A namespace must be unique to the tenant.

For details, see [UpdateCompany](https://developer.avalara.com/api-reference/sharedservice/sharedCompanyService/methods/Companies/UpdateCompany/).

**Headers**

Name

Description

**X-Avalara-Client**

Provided by Avalara.

**avalara-version**

API version.

**Content-Type**

application/json

**Accept**

application/json

**Path parameters**

Name

Description

`companyId`

(Required) The company ID.

**Body**

```
// {{companyToUpdate}}
{
    "id": "e7defd5c-f76c-43c4-9271-d77b16f7e7a5",
    "companyName": "US Test Company Incorp",
    "defaultCountry": "US",
    "tenant": {
        "identifier": "65dc62ad9a7a160c118f4e4a",
        "displayName": "Avalara - ELR - plsprovtest",
        "location": "https://sandbox-rest.avatax.com/iam/tenants/65dc62ad9a7a160c118f4e4a"
    },
    "companyCode": "USDBNA",
    "isActive": true,
    "aspects": [
        {
            "identifier": "USDBNA",
            "namespace": "urn:erp:emeapls:companies"
        }
    ],
    "tags": [ ],
    "meta": {
        "createdBy": "app-65dc633c4b2132844b63b4e8",
        "created": "2024-08-01T12:21:46",
        "modifiedBy": "app-65dc633c4b2132844b63b4e8",
        "lastModified": "2024-08-01T12:21:46"
    }
}
```

## Example request

```
curl --location -g --request PUT '/scs/companies/{{companyId}}' \
--header 'X-Avalara-Client: ProvidedToYouByAvalara' \
--header 'avalara-version: 1.0' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '// {{companyToUpdate}}
{
    "id": "e7defd5c-f76c-43c4-9271-d77b16f7e7a5",
    "companyName": "US Test Company Incorp",
    "defaultCountry": "US",
    "tenant": {
        "identifier": "65dc62ad9a7a160c118f4e4a",
        "displayName": "Avalara - ELR - plsprovtest",
        "location": "https://sandbox-rest.avatax.com/iam/tenants/65dc62ad9a7a160c118f4e4a"
    },
    "companyCode": "USDBNA",
    "isActive": true,
    "aspects": [
        {
            "identifier": "USDBNA",
            "namespace": "urn:erp:emeapls:companies"
        }
    ],
    "tags": [ ],
    "meta": {
        "createdBy": "app-65dc633c4b2132844b63b4e8",
        "created": "2024-08-01T12:21:46",
        "modifiedBy": "app-65dc633c4b2132844b63b4e8",
        "lastModified": "2024-08-01T12:21:46"
    }
}'
```