How to create/update tax ID via graphQL?

Topic summary

A developer needed to update customer tax IDs via GraphQL but encountered an error when attempting to use companyLocationUpdate mutation with the taxRegistrationId field.

Problem encountered:

  • The CompanyLocationUpdateInput object doesn’t accept taxRegistrationId as an argument
  • Error message: “InputObject ‘CompanyLocationUpdateInput’ doesn’t accept argument ‘taxRegistrationId’”

Solution provided:
Use the companyLocationTaxSettingsUpdate mutation instead (available in GraphQL Admin API version 2025-01):

mutation companyLocationTaxSettingsUpdate(
  $companyLocationId: ID!, 
  $taxRegistrationId: String
) {
  companyLocationTaxSettingsUpdate(
    companyLocationId: $companyLocationId, 
    taxRegistrationId: $taxRegistrationId
  ) {
    companyLocation {
      id
      taxRegistrationId
    }
    userErrors {
      field
      message
    }
  }
}

This mutation specifically handles tax registration ID updates for company locations in Shopify’s B2B functionality.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

i need to update customer’s tax iDs via GraphQL.

I cannot find a mutation to do this.

looking into this field, which i think is labeled “Tax Id” in the browser:
https://shopify.dev/docs/api/liquid/objects#company_location-tax_registration_id

i try this:

mutation {
    companyLocationUpdate(
    companyLocationId: "gid://shopify/CompanyLocation/99999999"
    input: {
        taxRegistrationId: "DE999999999"
    }
  ) {
    companyLocation {
      id
      taxRegistrationId
      }
    }
  }

and get this:

{
    "errors": [
        {
            "message": "InputObject 'CompanyLocationUpdateInput' doesn't accept argument 'taxRegistrationId'",
            "locations": [
                {
                    "line": 9,
                    "column": 9
                }
            ],
            "path": [
                "mutation",
                "companyLocationUpdate",
                "input",
                "taxRegistrationId"
            ],
            "extensions": {
                "code": "argumentNotAccepted",
                "name": "CompanyLocationUpdateInput",
                "typeName": "InputObject",
                "argumentName": "taxRegistrationId"
            }
        }
    ]
}

companyLocationTaxSettingsUpdate with GraphQL Admin API version 2025-01:

mutation companyLocationTaxSettingsUpdate(
  $companyLocationId: ID!, 
  $taxRegistrationId: String
) {
  companyLocationTaxSettingsUpdate(
    companyLocationId: $companyLocationId, 
    taxRegistrationId: $taxRegistrationId
  ) {
    companyLocation {
      id
      taxRegistrationId
    }
    userErrors {
      field
      message
    }
  }
}

Variables:

{
  "companyLocationId": "gid://shopify/CompanyLocation/10079785100",
  "taxRegistrationId": "123456789"
}
1 Like