# externalSource query


`externalSource` is a GraphQL query 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).

Returns the external source with this code. Use it to check that an external source exists
before you write references to it.

- Requires the `integration.read` permission.
- The code matches regardless of case.
- Returns null when no external source has the code.

## Arguments

- `code`: `String!` · required

## Returns

[`ExternalSource`](/chameleoon-max/type/external-source)

## Example

**Query**

```graphql
query externalSource($code: String!) {
  externalSource(code: $code) {
    code
    name
    kind
    archived
    invoicePrintAllowed
  }
}
```

**Variables**

```json
{
  "code": "example"
}
```

**Response**

```json
{
  "data": {
    "externalSource": {
      "code": "example",
      "name": "example",
      "kind": "example",
      "archived": true,
      "invoicePrintAllowed": true
    }
  }
}
```

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