data-src=../../../../../includes/commerce-only.md

updateCompany mutation

The updateCompany mutation allows you to update a company's address as well as top-level string attributes such as the name, legal name, and email. You cannot update the administrator or other objects such as teams, roles, or resources with this mutation.

This mutation requires a valid customer authentication token.

Syntax

mutation {
  updateCompany(
    input: CompanyUpdateInput!
  ) {
    UpdateCompanyOutput
  }
}

Reference

The updateCompany reference provides detailed information about the types and fields defined in this mutation.

Example usage

The following call updates the legal address of a company

Request:

mutation {
  updateCompany(
    input: {
      legal_address: {
        street: ["265 Cambridge Ave"]
        city: "Palo Alto"
        region: {
          region_code:"CA"
          region_id: 12
        }
        postcode: "94306"
      }
    }
  ) {
    company {
      legal_address {
        street
        city
        region {
          region_code
        }
        postcode
      }
    }
  }
}

Response:

{
  "data": {
    "updateCompany": {
      "company": {
        "legal_address": {
          "street": [
            "265 Cambridge Ave"
          ],
          "city": "Palo Alto",
          "region": {
            "region_code": "CA"
          },
          "postcode": "94306"
        }
      }
    }
  }
}