# DiscountCodeAliasExists

> Check whether codes are already used as a code or alias in this workspace. Read access, discounts toolset, MCP tool get_discount_code_alias_exists.

**Access:** [Read](https://developer.missin.co.uk/get-started/authentication.md#access-levels)

## Variables

| Variable | Type | Required | Accepts | Description |
|---|---|---|---|---|
| `codes` | `[String!]!` | yes |  |  |
| `excludeDiscountId` | `UUID` | no |  |  |
| `workspaceId` | `UUID!` | yes |  |  |

## Call it

```bash curl
curl https://api.missin.co.uk/graphql/v1 \
  -H "Authorization: Bearer $MISSIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"operationName":"DiscountCodeAliasExists","variables":{"codes":[],"workspaceId":"00000000-0000-0000-0000-000000000000"},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"a65f9ae28811e50699c8ac932aa164d841ab14c0056627653ac76025f8830241"}}}'
```

## Document

```graphql
query DiscountCodeAliasExists($codes: [String!]!, $excludeDiscountId: UUID, $workspaceId: UUID!) { __typename discountCodeAliasExists( pWorkspaceId: $workspaceId pCodes: $codes pExcludeDiscountId: $excludeDiscountId ) { __typename nodes { __typename code discountCodeId placedOn primaryCode valueAmount valuePercent } } }
```

Source: https://developer.missin.co.uk/reference/discounts/discount-code-alias-exists
