# removeProductVariantExternalRef mutation


`removeProductVariantExternalRef` is a GraphQL mutation of the Chameleoon MAX API. Send it as `POST https://max-api.chameleoon.sk/api/v1/graphql` with your API key, see [Chameleoon MAX](/chameleoon-max).

Removes the variant's reference in an external source. Call it when your system's record no
longer matches this variant.

- Returns `changed: false` when the variant had no reference in the external source.
- Works for an archived external source too.
- Permissions and `NOT_FOUND` are as in [`setProductVariantExternalRef`](/chameleoon-max/mutation/set-product-variant-external-ref).

> An error whose path runs below this field does not mean the call failed: the reference was
> removed, so do not retry. See [`Mutation`](/chameleoon-max/mutations).

## Arguments

- `id`: [`UUID!`](/chameleoon-max/type/uuid) · required
- `source`: `String!` · required

## Returns

[`ProductVariantExternalRefResult!`](/chameleoon-max/type/product-variant-external-ref-result)

## Example

**Mutation**

```graphql
mutation removeProductVariantExternalRef($id: UUID!, $source: String!) {
  removeProductVariantExternalRef(id: $id, source: $source) {
    productVariant {
      id
      sku
      isDefault
      archivedAt
      ean
      weightG
    }
    changed
  }
}
```

**Variables**

```json
{
  "id": "00000000-0000-4000-8000-000000000001",
  "source": "example"
}
```

**Response**

```json
{
  "data": {
    "removeProductVariantExternalRef": {
      "productVariant": {
        "id": "00000000-0000-4000-8000-000000000001",
        "sku": "example",
        "isDefault": true,
        "archivedAt": "2026-01-01T00:00:00Z",
        "ean": "example",
        "weightG": 1
      },
      "changed": true
    }
  }
}
```

Values are illustrative: replace IDs and codes with your own before you send the call.
