> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tesouro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Syntax errors

> Common GraphQL syntax errors such as invalid request structure, unknown fields, and missing required variables.

Syntax errors occur when Tesouro can't parse your request. Here are the most common ones you'll hit when starting your integration:

### Invalid request structure

If the request does not match the structure of a valid GraphQL request.

<Note>
  **scenario**

  A missing closing brace caused an error while processing a transaction from Maple Street Coffee, one of Clearpath Payment's acceptors.
</Note>

```graphql Request with Syntax Error lines theme={null}
mutation AuthorizeAndCaptureCard($input: CardPaymentInput!) {
        authorizeAndCaptureCard(input: $input) {
            transactionInformation {
                paymentId
            }
        }
```

```json title="Response: Invalid Request" lines theme={null}
{
  "errors": [
    {
      "message": "parsing error: ERROR@722:723 \"expected }\" )",
      "extensions": {
        "code": "PARSING_ERROR"
      }
    }
  ]
}
```

### Invalid mutation/query identifier

If the mutation/query identifier doesn't exist.

<Callout icon="clapperboard-play" color="#6938EF" type="scenario">
  **Scenario**

  Sending `authorizeAndCaptureCards` instead of `authorizeAndCaptureCard` caused an error on an authorization request for Maple Street Coffee, one of Clearpath Payment's acceptors.
</Callout>

```graphql Request with Syntax Error lines highlight={2} theme={null}
mutation AuthorizeAndCaptureCard($input: CardPaymentInput!) {
  authorizeAndCaptureCards(input: $input) {
    transactionInformation {
      paymentId
    }
  }
}
```

```json title="Response: Invalid Request" lines theme={null}
{
  "errors": [
    {
      "message": "parsing error: ERROR@722:723 \"expected }\" )",
      "extensions": {
        "code": "PARSING_ERROR"
      }
    }
  ]
}
```

### Invalid mutation/query input field

If the mutation/query identifier is correct, but one of the input fields does not match the schema

<Callout icon="clapperboard-play" color="#6938EF" type="scenario">
  **Scenario**

  Sending `transactionCurrencys` instead of `transactionCurrency` caused an error while processing a transaction from Maple Street Coffee, one of Clearpath Payment's acceptors.
</Callout>

```json Request Variables with Syntax Error lines  highlight={5} theme={null}
{
  "input": {
    "amountInformation": {
      "transactionAmount": 150,
      "transactionCurrencys": "USD"
    }
  }
}
```

```json title="Response: Invalid Request" lines theme={null}
{
  "errors": [
    {
      "message": "Field \"transactionCurrencyss\" is not defined by type \"AmountInformationInput\". Did you mean \"transactionCurrency\" or \"transactionAmount\"?",
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED"
      }
    }
  ]
}
```

### Incorrect mutation/query input field type

If an input variable field type is incorrect

<Callout icon="clapperboard-play" color="#6938EF" type="scenario">
  **Scenario**

  Sending `"150.10"` instead of `150.10` in the `DecimalAmount` field caused an error on a \$150.10 transaction for Maple Street Coffee, one of Clearpath Payment's acceptors.
</Callout>

```json Request Variables with Syntax Error lines  highlight={4} theme={null}
{
  "input": {
    "amountInformation": {
      "transactionAmount": "150.10",
      "transactionCurrencys": "USD"
    }
  }
}
```

```json title="Response: Invalid Request" lines expandable theme={null}
{
  "data": null,
  "errors": [
    {
      "message": "HTTP fetch failed from 'paymentprocessing': 400: Bad Request",
      "extensions": {
        "code": "SUBREQUEST_HTTP_ERROR",
        "service": "paymentprocessing",
        "reason": "400: Bad Request",
        "http": {
          "status": 400
        }
      }
    },
    {
      "message": "The specified value type of field `transactionAmount` does not match the field type.",
      "locations": [
        {
          "line": 1,
          "column": 287
        }
      ],
      "path": ["authorizeAndCaptureCard"],
      "extensions": {
        "fieldName": "transactionAmount",
        "fieldType": "DecimalAmount!",
        "locationType": "DecimalAmount!",
        "specifiedBy": "http://spec.graphql.org/October2021/#sec-Values-of-Correct-Type"
      }
    }
  ]
}
```
